aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/constexpr.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2de9dcb..2240913 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/82461 - constexpr list-initialized member
+ * constexpr.c (potential_constant_expression_1): Check
+ TARGET_EXPR_DIRECT_INIT_P.
+
2018-01-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/81013
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 8984613..9a548d2 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -5726,7 +5726,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
return RECUR (TREE_OPERAND (t, 1), want_rval);
case TARGET_EXPR:
- if (!literal_type_p (TREE_TYPE (t)))
+ if (!TARGET_EXPR_DIRECT_INIT_P (t)
+ && !literal_type_p (TREE_TYPE (t)))
{
if (flags & tf_error)
{