Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 16783
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Wolfgang Bangerth <bangerth@gmail.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 16783 depends on: Show dependency tree
Show dependency graph
Bug 16783 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-10-03 18:21 Opened: 2004-07-27 13:24
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.

------- Comment #1 From Wolfgang Bangerth 2004-07-27 13:25 -------
*** Bug 16711 has been marked as a duplicate of this bug. ***

------- Comment #2 From Wolfgang Bangerth 2004-07-27 13:27 -------
Confirmed by jsm already. 

------- Comment #3 From Giovanni Bajo 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.

------- Comment #4 From Andrew Pinski 2005-01-02 01:32 -------
Fixed in 4.0.0.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug