From d92e4d8cba0e14bed08bbbc35d7229e4b5b4c369 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Sun, 19 Jul 1998 18:00:47 +0000 Subject: [PATCH] decl.c (pushtag): Don't put out debugging information for compiler-generated typedefs. * decl.c (pushtag): Don't put out debugging information for compiler-generated typedefs. From-SVN: r21285 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/decl.c | 8 ++++++++ gcc/testsuite/g++.old-deja/g++.pt/crash12.C | 13 +++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/crash12.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 51cac5f1511..0e8a75ab13b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-07-19 Mark Mitchell + * 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. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 913b9abd00a..a55b28cd445 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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 index 00000000000..ade8139c45d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash12.C @@ -0,0 +1,13 @@ +// Build don't link: +// Special g++ Options: -g + +template +class CenteringTag { +}; + +struct S { + template + static void f() { + CenteringTag ctag; + } +};