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++/19628] [3.4/4.0 Regression] g++ no longer accepts __builtin_constant_p in constant-expressions


------- 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


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