public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16783] New: Accepts invalid integral constant expression for array size
@ 2004-07-27 13:24 bangerth at dealii dot org
  2004-07-27 13:25 ` [Bug c++/16783] " bangerth at dealii dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2004-07-27 13:24 UTC (permalink / raw)
  To: gcc-bugs

As stated in PR 16711, we accept this code: 
---------------- 
int array [((int)(void*)1)]; 
---------------- 
even though the array size is not an integral constant expression. 
That's odd, since we reject this expression in various other 
places (see PR 16711), but accept it here. We shouldn't. 
 
W.

-- 
           Summary: Accepts invalid integral constant expression for array
                    size
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16783


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/16783] Accepts invalid integral constant expression for array size
  2004-07-27 13:24 [Bug c++/16783] New: Accepts invalid integral constant expression for array size bangerth at dealii dot org
@ 2004-07-27 13:25 ` bangerth at dealii dot org
  2004-07-27 13:27 ` bangerth at dealii dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2004-07-27 13:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-07-27 13:25 -------
*** Bug 16711 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |romixlev at yahoo dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16783


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/16783] Accepts invalid integral constant expression for array size
  2004-07-27 13:24 [Bug c++/16783] New: Accepts invalid integral constant expression for array size bangerth at dealii dot org
  2004-07-27 13:25 ` [Bug c++/16783] " bangerth at dealii dot org
@ 2004-07-27 13:27 ` bangerth at dealii dot org
  2004-07-31  0:28 ` giovannibajo at libero dot it
  2005-01-02  1:32 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2004-07-27 13:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-07-27 13:27 -------
Confirmed by jsm already. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-27 13:27:19
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16783


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/16783] Accepts invalid integral constant expression for array size
  2004-07-27 13:24 [Bug c++/16783] New: Accepts invalid integral constant expression for array size bangerth at dealii dot org
  2004-07-27 13:25 ` [Bug c++/16783] " bangerth at dealii dot org
  2004-07-27 13:27 ` bangerth at dealii dot org
@ 2004-07-31  0:28 ` giovannibajo at libero dot it
  2005-01-02  1:32 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-31  0:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-31 00:28 -------
This patch of mines:

        2004-03-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>

	PR c++/14545
	* parser.c (cp_parser_functional_cast): A cast to anything
	but integral or enumaration type is not an integral constant
	expression.

should also handle this case. If it does not, it probably means that for some 
reason the expression within the braces is not being parsed as a constant 
expression. This strikes me as odd though, and I wonder if the extra level of 
parenthesis is confusing the parser somehow. There is some complex code to 
handle extra-level of parenthesis which are disambiguators in many situations, 
so it is very possible that somewhere we forget to set/propagate the constant-
expression flag.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16783


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/16783] Accepts invalid integral constant expression for array size
  2004-07-27 13:24 [Bug c++/16783] New: Accepts invalid integral constant expression for array size bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2004-07-31  0:28 ` giovannibajo at libero dot it
@ 2005-01-02  1:32 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-02  1:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-02 01:32 -------
Fixed in 4.0.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16783


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-01-02  1:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-27 13:24 [Bug c++/16783] New: Accepts invalid integral constant expression for array size bangerth at dealii dot org
2004-07-27 13:25 ` [Bug c++/16783] " bangerth at dealii dot org
2004-07-27 13:27 ` bangerth at dealii dot org
2004-07-31  0:28 ` giovannibajo at libero dot it
2005-01-02  1:32 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).