aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorMatt Austern <austern@apple.com>2005-02-03 00:02:10 +0000
committerMatt Austern <austern@gcc.gnu.org>2005-02-03 00:02:10 +0000
commit100d337a9d06bbc8f367e37debbe69610b04e72f (patch)
tree54f1d79812354b990fbbfe75895aedd5f2372e9c /gcc/cp/semantics.c
parent89d12f5d49829d3dbf9a78040b88df833923c0df (diff)
downloadgcc-100d337a9d06bbc8f367e37debbe69610b04e72f.zip
gcc-100d337a9d06bbc8f367e37debbe69610b04e72f.tar.gz
gcc-100d337a9d06bbc8f367e37debbe69610b04e72f.tar.bz2
re PR c++/19628 (g++ no longer accepts __builtin_constant_p in constant-expressions)
PR c++/19628 * cp-tree.h (builtin_valid_in_constant_expr_p): Declare. * parser.c (cp_parser_postfix_expression): Accept function call in constant expression if builtin_valid_in_constant_expr_p is true for that function. * pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly. * semantics.c (finish_id_expression): Accept function call in constant expression if builtin_valid_in_constant_expr_p is true for that function. * tree.c (builtin_valid_in_constant_expr_p): New. * g++/ext/builtin7.C: New. * g++/ext/builtin8.C: New. From-SVN: r94635
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c0e68d1..ebc213d 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2663,7 +2663,8 @@ finish_id_expression (tree id_expression,
expression. Enumerators and template parameters have already
been handled above. */
if (integral_constant_expression_p
- && !DECL_INTEGRAL_CONSTANT_VAR_P (decl))
+ && ! DECL_INTEGRAL_CONSTANT_VAR_P (decl)
+ && ! builtin_valid_in_constant_expr_p (decl))
{
if (!allow_non_integral_constant_expression_p)
{