This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38377] __builtin_constant_p(t) ? t : 1 is not considered a constant integer expression
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Dec 2008 19:09:08 -0000
- Subject: [Bug c++/38377] __builtin_constant_p(t) ? t : 1 is not considered a constant integer expression
- References: <bug-38377-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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