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