This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/38377] __builtin_constant_p(t) ? t : 1 is not considered a constant integer expression



------- Comment #2 from joseph at codesourcery dot com  2008-12-06 19:09 -------
Subject: Re:  __builtin_constant_p(t) ? t : 1 is not considered
 a constant integer expression

On Sat, 6 Dec 2008, sabre at nondot dot org wrote:

> This is a bug in the C front-end.  They need to use __builtin_choose_expr.

No, it's a bug in the C++ front end, at least as regards the initializer.  
It's expressly documented that this is allowed in initializers.  See also 
my note in <http://gcc.gnu.org/ml/gcc-patches/2008-10/msg01061.html> about 
how what should be allowed with __builtin_constant_p goes beyond what I 
put in my formal models of desired constant expression semantics for GCC 
in 2004.

If you get this wrong for C then GCC will fail to bootstrap, as it's part 
of the GNU C semantics GCC relies on when being built with GCC.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]