diff options
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) { |