aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@cygnus.com>1998-06-16 12:36:14 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>1998-06-16 12:36:14 +0000
commit741f28399312449ab64e61c0cc3564de2a98dd63 (patch)
treee0e3f9d3a47e23326ab99cbd617d3095ac001e55 /gcc
parent6f6074ea6f56b6b887939a2f9925a0b456ebcbba (diff)
downloadgcc-741f28399312449ab64e61c0cc3564de2a98dd63.zip
gcc-741f28399312449ab64e61c0cc3564de2a98dd63.tar.gz
gcc-741f28399312449ab64e61c0cc3564de2a98dd63.tar.bz2
decl.c (grokvardecl): Don't build external assembler names for TYPENAMEs in other namespaces as there...
1998-06-16 Andrew MacLeod <amacleod@cygnus.com> * decl.c (grokvardecl): Don't build external assembler names for TYPENAMEs in other namespaces as there is no declarator. * error.c (cp_file_of, cp_line_of): Don't extract file or line number info from DECL_CONTEXT if it is NULL. From-SVN: r20524
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/error.c4
3 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 72943d1..3372b19 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+1998-06-16 Andrew MacLeod <amacleod@cygnus.com>
+
+ * decl.c (grokvardecl): Don't build external assembler names for
+ TYPENAMEs in other namespaces as there is no declarator.
+ * error.c (cp_file_of, cp_line_of): Don't extract file or line number
+ info from DECL_CONTEXT if it is NULL.
+
1998-06-16 Jason Merrill <jason@yorick.cygnus.com>
* call.c (check_dtor_name): Split out.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 20dfdf7..674d668 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7848,7 +7848,7 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
{
tree context = in_namespace ? in_namespace : current_namespace;
decl = build_decl (VAR_DECL, declarator, complete_type (type));
- if (context != global_namespace)
+ if (context != global_namespace && declarator)
DECL_ASSEMBLER_NAME (decl) = build_static_name (context,
declarator);
}
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 4862d64..d4dc054 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1811,7 +1811,7 @@ char *
cp_file_of (t)
tree t;
{
- if (TREE_CODE (t) == PARM_DECL)
+ if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
return DECL_SOURCE_FILE (DECL_CONTEXT (t));
else if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
return DECL_SOURCE_FILE (TYPE_MAIN_DECL (t));
@@ -1824,7 +1824,7 @@ cp_line_of (t)
tree t;
{
int line = 0;
- if (TREE_CODE (t) == PARM_DECL)
+ if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
line = DECL_SOURCE_LINE (DECL_CONTEXT (t));
if (TREE_CODE (t) == TYPE_DECL && DECL_ARTIFICIAL (t))
t = TREE_TYPE (t);