re PR c++/55261 ([C++0x] ICE (SIGSEGV) when inheriting implicit constructor)
authorJason Merrill <jason@redhat.com>
Mon, 19 Nov 2012 14:05:36 +0000 (09:05 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 19 Nov 2012 14:05:36 +0000 (09:05 -0500)
PR c++/55261
* class.c (add_implicitly_declared_members): Use
lookup_fnfields_slot to get the base constructors.

From-SVN: r193621

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/g++.dg/cpp0x/inh-ctor14.C [new file with mode: 0644]

index a4e76a6f926a1de4f7c8c186e491518895256f49..6d4ab8bedde8a9d25b5040190d3fe3df1fecc8b6 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-19  Jason Merrill  <jason@redhat.com>
+
+       PR c++/55261
+       * class.c (add_implicitly_declared_members): Use
+       lookup_fnfields_slot to get the base constructors.
+
 2012-11-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/54630
index 2737cbc3ecf77664bab4f271a2b574a6a642d27a..04f9df5a23a5af179199d2a6136cdb9f2031b6c2 100644 (file)
@@ -3014,7 +3014,8 @@ add_implicitly_declared_members (tree t, tree* access_decls,
       if (DECL_SELF_REFERENCE_P (decl))
        {
          /* declare, then remove the decl */
-         tree ctor_list = CLASSTYPE_CONSTRUCTORS (TREE_TYPE (decl));
+         tree ctor_list = lookup_fnfields_slot (TREE_TYPE (decl),
+                                                ctor_identifier);
          location_t loc = input_location;
          input_location = DECL_SOURCE_LOCATION (using_decl);
          if (ctor_list)
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor14.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor14.C
new file mode 100644 (file)
index 0000000..2032ad3
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/55261
+// { dg-options -std=c++11 }
+
+struct A
+{
+};
+struct B : A
+{
+  using A::A;
+};