Fix gdb.cp/anon-struct.cc with -std=c++11.
authorJason Merrill <jason@redhat.com>
Wed, 6 May 2015 02:24:38 +0000 (22:24 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 6 May 2015 02:24:38 +0000 (22:24 -0400)
gcc/
* dwarf2out.c (gen_member_die): Don't emit anything for an
anonymous class constructor.
gcc/cp/
* decl2.c (reset_type_linkage_2): Update the DECL_NAME of a
maybe-in-charge constructor.

From-SVN: r222839

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/dwarf2out.c

index 3e67699fb338b281819f789ba08d137f8cbcafa3..fc88220cc838a7a2e9bbf6af38f6d5f6467fbe3e 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-05  Jason Merrill  <jason@redhat.com>
+
+       * dwarf2out.c (gen_member_die): Don't emit anything for an
+       anonymous class constructor.
+
 2015-05-05  David Malcolm  <dmalcolm@redhat.com>
 
        * auto-profile.c (afdo_find_equiv_class): Fix indentation so
index 04e6a50b1904f394cd36acfacee3d728d041be44..029c64937a274c10436bcb1787532a9237a473b5 100644 (file)
@@ -1,5 +1,8 @@
 2015-05-05  Jason Merrill  <jason@redhat.com>
 
+       * decl2.c (reset_type_linkage_2): Update the DECL_NAME of a
+       maybe-in-charge constructor.
+
        * decl.c (start_decl): Don't push the plain VAR_DECL for a
        variable template.
 
index b2251d80555cf96e64cdbdf5e988e3d8fdeda5eb..0d478471925a0f4ec085376dc93234ca42eee88d 100644 (file)
@@ -2648,7 +2648,12 @@ reset_type_linkage_2 (tree type)
        if (TREE_CODE (m) == VAR_DECL)
          reset_decl_linkage (m);
       for (tree m = TYPE_METHODS (type); m; m = DECL_CHAIN (m))
-       reset_decl_linkage (m);
+       {
+         reset_decl_linkage (m);
+         if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (m))
+           /* Also update its name, for cxx_dwarf_name.  */
+           DECL_NAME (m) = TYPE_IDENTIFIER (type);
+       }
       binding_table_foreach (CLASSTYPE_NESTED_UTDS (type),
                             bt_reset_linkage_2, NULL);
     }
index ddca2a83df4cfa995962836fb503dc0cce9bdbd6..cb2656c4285787e231d5adb8c253a3cc01073c4c 100644 (file)
@@ -19951,6 +19951,10 @@ gen_member_die (tree type, dw_die_ref context_die)
       /* Don't include clones in the member list.  */
       if (DECL_ABSTRACT_ORIGIN (member))
        continue;
+      /* Nor constructors for anonymous classes.  */
+      if (DECL_ARTIFICIAL (member)
+         && dwarf2_name (member, 0) == NULL)
+       continue;
 
       child = lookup_decl_die (member);
       if (child)