aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1997-11-19 23:07:26 -0500
committerJason Merrill <jason@gcc.gnu.org>1997-11-19 23:07:26 -0500
commit5951f637bc7086189b9702766068fb5f319039ad (patch)
treef846a25b504a862832295d71b6c8c651654f78f7 /gcc
parent77643ab81452d6d7c52b5e28e201bb93ce88d155 (diff)
downloadgcc-5951f637bc7086189b9702766068fb5f319039ad.zip
gcc-5951f637bc7086189b9702766068fb5f319039ad.tar.gz
gcc-5951f637bc7086189b9702766068fb5f319039ad.tar.bz2
decl.c (make_implicit_typename): Handle case where t is not actually from context.
* decl.c (make_implicit_typename): Handle case where t is not actually from context. * tree.c (get_type_decl): Lose identifier case. * spew.c (yylex): Lose useless call to identifer_typedecl_value. * parse.y (nonnested_type): Just use lookup_name. (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE. Wed Nov 19 11:45:07 1997 Michael Tiemann <tiemann@axon.cygnus.com> * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case T was built in C language context (for example, by output_func_start_profiler). From-SVN: r16589
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog15
-rw-r--r--gcc/cp/decl.c8
-rw-r--r--gcc/cp/error.c3
-rw-r--r--gcc/cp/parse.y9
-rw-r--r--gcc/cp/spew.c4
-rw-r--r--gcc/cp/tree.c2
6 files changed, 27 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index efdf9a7..f10aea4a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,18 @@
+Wed Nov 19 18:24:14 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (make_implicit_typename): Handle case where t is not
+ actually from context.
+ * tree.c (get_type_decl): Lose identifier case.
+ * spew.c (yylex): Lose useless call to identifer_typedecl_value.
+ * parse.y (nonnested_type): Just use lookup_name.
+ (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
+
+Wed Nov 19 11:45:07 1997 Michael Tiemann <tiemann@axon.cygnus.com>
+
+ * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
+ T was built in C language context (for example, by
+ output_func_start_profiler).
+
Wed Nov 19 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (make_implicit_typename): New fn.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e015816..3aa8201 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4389,7 +4389,7 @@ make_implicit_typename (context, t)
&& DECL_CONTEXT (t) != context)
{
tree binfo = get_binfo (DECL_CONTEXT (t), context, 0);
- for (;;)
+ while (binfo)
{
tree next = BINFO_INHERITANCE_CHAIN (binfo);
if (! uses_template_parms (BINFO_TYPE (next))
@@ -4397,7 +4397,11 @@ make_implicit_typename (context, t)
break;
binfo = next;
}
- retval = make_typename_type (BINFO_TYPE (binfo), DECL_NAME (t));
+ if (binfo)
+ retval = make_typename_type (BINFO_TYPE (binfo), DECL_NAME (t));
+ else
+ /* FIXME: find the enclosing class whose base t comes from. */
+ retval = make_typename_type (DECL_CONTEXT (t), DECL_NAME (t));
}
else
retval = make_typename_type (context, DECL_NAME (t));
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index d6c6586..5042126 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -925,7 +925,8 @@ dump_function_name (t)
else
dump_decl (name, 0);
- if ((DECL_TEMPLATE_SPECIALIZATION (t) || DECL_IMPLICIT_INSTANTIATION (t))
+ if (DECL_LANG_SPECIFIC (t)
+ && (DECL_TEMPLATE_SPECIALIZATION (t) || DECL_IMPLICIT_INSTANTIATION (t))
&& (DECL_CLASS_CONTEXT (t) == NULL_TREE || is_member_template (t)))
{
tree args = DECL_TEMPLATE_INFO (t)
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 0906947..18d4aa7 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -3017,18 +3017,15 @@ nonnested_type:
{
if (TREE_CODE ($1) == IDENTIFIER_NODE)
{
+ $$ = lookup_name ($1, 1);
if (current_class_type
&& TYPE_BEING_DEFINED (current_class_type)
&& ! IDENTIFIER_CLASS_VALUE ($1))
{
- /* Be sure to get an inherited typedef. */
- $$ = lookup_name ($1, 1);
/* Remember that this name has been used in the class
definition, as per [class.scope0] */
pushdecl_class_level ($$);
}
- else
- $$ = identifier_typedecl_value ($1);
}
else
$$ = $1;
@@ -3036,7 +3033,7 @@ nonnested_type:
| global_scope type_name
{
if (TREE_CODE ($2) == IDENTIFIER_NODE)
- $$ = identifier_typedecl_value ($2);
+ $$ = IDENTIFIER_GLOBAL_VALUE ($2);
else
$$ = $2;
got_scope = NULL_TREE;
@@ -3285,7 +3282,7 @@ complex_type_name:
global_scope type_name
{
if (TREE_CODE ($2) == IDENTIFIER_NODE)
- $$ = identifier_typedecl_value ($2);
+ $$ = IDENTIFIER_GLOBAL_VALUE ($2);
else
$$ = $2;
got_scope = NULL_TREE;
diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c
index ce884de..a6fe404 100644
--- a/gcc/cp/spew.c
+++ b/gcc/cp/spew.c
@@ -312,9 +312,7 @@ yylex ()
{
case TYPENAME:
case SELFNAME:
- lastiddecl = identifier_typedecl_value (tmp_token.yylval.ttype);
- if (lastiddecl != trrr)
- lastiddecl = trrr;
+ lastiddecl = trrr;
if (got_scope)
tmp_token.yylval.ttype = trrr;
break;
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index e94fd55..98b1a6d 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1866,8 +1866,6 @@ tree
get_type_decl (t)
tree t;
{
- if (TREE_CODE (t) == IDENTIFIER_NODE)
- return identifier_typedecl_value (t);
if (TREE_CODE (t) == TYPE_DECL)
return t;
if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')