diff options
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/call.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/initlist99.C | 13 |
3 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 648a71d..4a9f999 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2018-04-03 Jason Merrill <jason@redhat.com> + PR c++/85092 - C++17 ICE with unused list constructor. + * call.c (conv_binds_ref_to_prvalue): Also count ck_identity + from a TARGET_EXPR. + PR c++/85113 - ICE with constexpr and __builtin_constant_p. * constexpr.c (cxx_eval_builtin_function_call): Only defer __builtin_constant_p if ctx->quiet. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 9351918..901f18c 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -7611,6 +7611,9 @@ conv_binds_ref_to_prvalue (conversion *c) return true; if (c->kind == ck_user && TREE_CODE (c->type) != REFERENCE_TYPE) return true; + if (c->kind == ck_identity && c->u.expr + && TREE_CODE (c->u.expr) == TARGET_EXPR) + return true; return false; } diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist99.C b/gcc/testsuite/g++.dg/cpp0x/initlist99.C new file mode 100644 index 0000000..d96f793 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist99.C @@ -0,0 +1,13 @@ +// PR c++/85092 +// { dg-do compile { target c++11 } } + +#include <initializer_list> + +struct A +{ + A (std::initializer_list<char>); +}; + +A f (); + +A a { f () }; |