diff options
author | Jason Merrill <jason@redhat.com> | 2014-05-28 11:55:03 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-05-28 11:55:03 -0400 |
commit | a33ad58be16a5288cb2874aded7b83b163a829b4 (patch) | |
tree | b3fccecbf4c53c5a6b2a691fcec914765d4edc77 /gcc/cp/call.c | |
parent | ecc7533ad758552159107457ede65148c991159b (diff) | |
download | gcc-a33ad58be16a5288cb2874aded7b83b163a829b4.zip gcc-a33ad58be16a5288cb2874aded7b83b163a829b4.tar.gz gcc-a33ad58be16a5288cb2874aded7b83b163a829b4.tar.bz2 |
re PR c++/61242 (Bogus "no matching function for call to ‘Foo::Create(<brace-enclosed initializer list>)")
PR c++/61242
* call.c (build_aggr_conv): Ignore passed in flags.
(build_array_conv, build_complex_conv): Likewise.
From-SVN: r211024
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 20af0e3..77aa8ca 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -890,7 +890,9 @@ build_aggr_conv (tree type, tree ctor, int flags, tsubst_flags_t complain) if (ctor == error_mark_node) return NULL; - flags |= LOOKUP_NO_NARROWING; + /* The conversions within the init-list aren't affected by the enclosing + context; they're always simple copy-initialization. */ + flags = LOOKUP_IMPLICIT|LOOKUP_NO_NARROWING; for (; field; field = next_initializable_field (DECL_CHAIN (field))) { @@ -963,6 +965,8 @@ build_array_conv (tree type, tree ctor, int flags, tsubst_flags_t complain) return NULL; } + flags = LOOKUP_IMPLICIT|LOOKUP_NO_NARROWING; + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (ctor), i, val) { conversion *sub @@ -1007,6 +1011,8 @@ build_complex_conv (tree type, tree ctor, int flags, if (len != 2) return NULL; + flags = LOOKUP_IMPLICIT|LOOKUP_NO_NARROWING; + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (ctor), i, val) { conversion *sub |