decl.c (pushtag): Don't put out debugging information for compiler-generated typedefs.
authorMark Mitchell <mark@markmitchell.com>
Sun, 19 Jul 1998 18:00:47 +0000 (18:00 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 19 Jul 1998 18:00:47 +0000 (18:00 +0000)
* decl.c (pushtag): Don't put out debugging information for
compiler-generated typedefs.

From-SVN: r21285

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.old-deja/g++.pt/crash12.C [new file with mode: 0644]

index 51cac5f15115b2f3a8e999c6fa6d21c9e322232c..0e8a75ab13b6025cec30664679a823c5c0cff8f5 100644 (file)
@@ -1,5 +1,8 @@
 1998-07-19  Mark Mitchell  <mark@markmitchell.com>
 
+       * decl.c (pushtag): Don't put out debugging information for
+       compiler-generated typedefs.
+       
        * error.c (dump_type_real): Don't crash when presented with
        intQI_type_node or the like.
 
index 913b9abd00aed3aa97d9351ebbb74d0e8a23df92..a55b28cd4451b39e17e40c99c1363683bb350411 100644 (file)
@@ -2287,6 +2287,14 @@ pushtag (name, type, globalize)
              if (current_lang_name == lang_name_java)
                TYPE_FOR_JAVA (type) = 1;
              SET_DECL_ARTIFICIAL (d);
+             /* There's no reason to put out debugging information
+                for these declarations since they are
+                compiler-generated.  Furthermore, if the type makes
+                use of template parameters, the code that generates
+                debugging information will get confused.  It is safe
+                to put these out in the non-template case, just
+                useless.  */
+             DECL_IGNORED_P (d) = 1;
              if (! in_class)
                set_identifier_type_value_with_scope (name, type, b);
            }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash12.C b/gcc/testsuite/g++.old-deja/g++.pt/crash12.C
new file mode 100644 (file)
index 0000000..ade8139
--- /dev/null
@@ -0,0 +1,13 @@
+// Build don't link:
+// Special g++ Options: -g
+
+template <class C>
+class CenteringTag {
+};
+
+struct S {
+  template <class B, class C>
+  static void f() {
+    CenteringTag<C> ctag;
+  }
+};