This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19628] [3.4/4.0 Regression] g++ no longer accepts __builtin_constant_p in constant-expressions
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jan 2005 01:39:37 -0000
- Subject: [Bug c++/19628] [3.4/4.0 Regression] g++ no longer accepts __builtin_constant_p in constant-expressions
- References: <20050125203257.19628.austern@apple.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-01-31 01:39 -------
I agree that __builtin_constant_p should be allowed in an integral
constant-expression.
The only thing I don't like about the patch is that the documentation for
builtin_is_constant_p doesn't obviously match the name; the documentation says
it checks for built-ins that can appear in consant-expressions, but the name
might seem to refer exclusively to __builtin_constant_p. A name like
"builtin_valid_in_constant_expr_p" would seem better.
The patch is OK with that change.
(Matt, I think you should also check what happens when __builtin_constant_p is
used as a template argument with dependent arguments, like:
template <int I>
void f(int &[__builtin_constant_p (I) + 2]);
Do we issue errors at substitution time? If not, do we emit reasonable
manglings? Etc. We don't have to fix these issues before re-enabling the core
functionality, but if there are problems we should open new PRs for them.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19628