]> gcc.gnu.org Git - gcc.git/commitdiff
semantics.c (maybe_constant_value): Check instantiation_dependent_expression_p.
authorJason Merrill <jason@redhat.com>
Mon, 1 Apr 2013 21:18:33 +0000 (17:18 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 1 Apr 2013 21:18:33 +0000 (17:18 -0400)
* semantics.c (maybe_constant_value): Check
instantiation_dependent_expression_p.
* pt.c (build_non_dependent_expr): Don't check it here.

From-SVN: r197327

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/cp/semantics.c

index 6374fff4348a74ae8625b17648d0a5d3ab95ff25..af7194997135993ea0ea1c10a69d1319f7ebc287 100644 (file)
@@ -1,5 +1,9 @@
 2013-04-01  Jason Merrill  <jason@redhat.com>
 
+       * semantics.c (maybe_constant_value): Check
+       instantiation_dependent_expression_p.
+       * pt.c (build_non_dependent_expr): Don't check it here.
+
        PR c++/56772
        * init.c (build_new): Don't try to process an array initializer
        at template definition time.
index f1f8fe2dba5c36d8c9d7135cb651f1dbed9f6247..2335dd3be96a71a46ff86a79e93b73361a9d7d46 100644 (file)
@@ -20444,8 +20444,7 @@ build_non_dependent_expr (tree expr)
 #ifdef ENABLE_CHECKING
   /* Try to get a constant value for all non-dependent expressions in
       order to expose bugs in *_dependent_expression_p and constexpr.  */
-  if (cxx_dialect >= cxx0x
-      && !instantiation_dependent_expression_p (expr))
+  if (cxx_dialect >= cxx0x)
     maybe_constant_value (fold_non_dependent_expr_sfinae (expr, tf_none));
 #endif
 
index 281ba75949aef6940a4b3b8c4cf28c87c35a62fb..3a558b0f67659a8e4372df0bf46d41a5511a2d95 100644 (file)
@@ -8270,11 +8270,10 @@ maybe_constant_value (tree t)
 {
   tree r;
 
-  if (type_dependent_expression_p (t)
+  if (instantiation_dependent_expression_p (t)
       || type_unknown_p (t)
       || BRACE_ENCLOSED_INITIALIZER_P (t)
-      || !potential_constant_expression (t)
-      || value_dependent_expression_p (t))
+      || !potential_constant_expression (t))
     {
       if (TREE_OVERFLOW_P (t))
        {
This page took 0.085719 seconds and 5 git commands to generate.