[Bug c++/19628] [3.4/4.0 Regression] g++ no longer accepts __builtin_constant_p in constant-expressions

austern at apple dot com gcc-bugzilla@gcc.gnu.org
Fri Jan 28 20:17:00 GMT 2005


------- Additional Comments From austern at apple dot com  2005-01-28 20:17 -------
This was undoubtedly caused by Mark's large checkin on 2003-01-29, which included changes to 
constant-expression handling.

I do not believe the __builtin_constant_p change was deliberate.  The intent behind this patch, as far as 
I can tell, was to reject constructs that the C++ standard explicitly says are not constant-expressions, 
such as "(1, 2)".  It looks to me like rejecting GNU extensions like __builtin_constant_p in constant-
expressions was just a side effect. 

As far as I can tell, rejecting __builtin_constant_p is a change that (a) was not deliberate; (b) is 
undocumented; (c) introduced a C/C++ incompatbility; and (d) causes previously working code to 
break.  I think that justifies calling it a bug.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |


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



More information about the Gcc-bugs mailing list