aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zack@codesourcery.com>2004-03-29 17:01:59 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-03-29 17:01:59 +0000
commit93604b1a023480f2e1547ef1955fdee284771048 (patch)
treed426083b666a2622a9a7955f2b5ea911e8b76536
parent97955d55bbe5aab1da0427e11e740851c83e18ff (diff)
downloadgcc-93604b1a023480f2e1547ef1955fdee284771048.zip
gcc-93604b1a023480f2e1547ef1955fdee284771048.tar.gz
gcc-93604b1a023480f2e1547ef1955fdee284771048.tar.bz2
error.c (dump_function_name): If T's DECL_LANG_SPECIFIC is null, just print the literal name and return.
* error.c (dump_function_name): If T's DECL_LANG_SPECIFIC is null, just print the literal name and return. From-SVN: r80058
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/error.c13
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e3d3a26..28ac751 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-29 Zack Weinberg <zack@codesourcery.com>
+
+ * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
+ is null, just print the literal name and return.
+
2004-03-25 Jason Merrill <jason@redhat.com>
PR c++/13294
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 324975c..e313c16 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1134,6 +1134,17 @@ dump_function_name (tree t, int flags)
{
tree name = DECL_NAME (t);
+ /* We can get here with a decl that was synthesized by language-
+ independent machinery (e.g. coverage.c) in which case it won't
+ have a lang_specific structure attached and DECL_CONSTRUCTOR_P
+ will crash. In this case it is safe just to print out the
+ literal name. */
+ if (!DECL_LANG_SPECIFIC (t))
+ {
+ pp_tree_identifier (cxx_pp, name);
+ return;
+ }
+
if (TREE_CODE (t) == TEMPLATE_DECL)
t = DECL_TEMPLATE_RESULT (t);
@@ -1163,7 +1174,7 @@ dump_function_name (tree t, int flags)
else
dump_decl (name, flags);
- if (DECL_LANG_SPECIFIC (t) && DECL_TEMPLATE_INFO (t)
+ if (DECL_TEMPLATE_INFO (t)
&& !DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t)
&& (DECL_TEMPLATE_SPECIALIZATION (t)
|| TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL