aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-04-01 17:18:33 -0400
committerJason Merrill <jason@gcc.gnu.org>2013-04-01 17:18:33 -0400
commit2ad8cf261d6a26f72ec26ef2dc9dbf4455dc484b (patch)
tree85d8f39bae65b51ba79e82ee7c7a7e62c941635d
parent879b0a1db9b13b1cb3632c974178d05c70ed8d57 (diff)
downloadgcc-2ad8cf261d6a26f72ec26ef2dc9dbf4455dc484b.zip
gcc-2ad8cf261d6a26f72ec26ef2dc9dbf4455dc484b.tar.gz
gcc-2ad8cf261d6a26f72ec26ef2dc9dbf4455dc484b.tar.bz2
semantics.c (maybe_constant_value): Check instantiation_dependent_expression_p.
* semantics.c (maybe_constant_value): Check instantiation_dependent_expression_p. * pt.c (build_non_dependent_expr): Don't check it here. From-SVN: r197327
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c3
-rw-r--r--gcc/cp/semantics.c5
3 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6374fff..af71949 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f1f8fe2..2335dd3 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 281ba75..3a558b0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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))
{