From c1e4c34a522d131403e31e8786f4a11c40d637d9 Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 15 Jul 2010 20:45:35 +0000 Subject: PR c++/44909 * call.c (add_function_candidate): If we're working on an implicit declaration, don't consider candidates that won't match. * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn. * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust. Revert: * cp-tree.h (struct lang_type_class): Add has_user_opeq. (TYPE_HAS_USER_OPEQ): New. * decl.c (grok_special_member_properties): Set it. * class.c (add_implicitly_declared_members): Don't lazily declare constructors/operator= if a base or member has a user-declared one. (check_bases_and_members, check_bases): Adjust. (check_field_decls, check_field_decl): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162233 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/g++.dg/cpp0x/implicit7.C | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/implicit7.C (limited to 'gcc/testsuite/g++.dg/cpp0x/implicit7.C') diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit7.C b/gcc/testsuite/g++.dg/cpp0x/implicit7.C new file mode 100644 index 00000000000..f29e5009fbd --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/implicit7.C @@ -0,0 +1,37 @@ +// PR c++/44909 +// { dg-options -std=c++0x } +// Declaring A>'s copy ctor means choosing a ctor to initialize D, +// which means choosing a ctor for C>, which meant considering +// C(const B&) which means choosing a ctor for B, which means choosing +// a ctor for A>. Cycle. + +template +struct A +{ + T t; +}; + +template +struct B +{ + typename T::U u; +}; + +template +struct C +{ + C(const T&); +}; + +template +struct D +{ + C > v; +}; + +struct E { + typedef A > U; +}; + +extern A > a; +A > a2(a); -- cgit v1.2.1