pt.c (lookup_template_class): Set current access for enum.
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 6 Oct 2000 09:12:44 +0000 (09:12 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 6 Oct 2000 09:12:44 +0000 (09:12 +0000)
* pt.c (lookup_template_class): Set current access for enum.
(tsubst_enum): Set file & line for enum decl.

* spew.c (yylex): Remove unused variable.

From-SVN: r36755

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/cp/spew.c

index cea08bdb58c6cc01710ad1a898961e185c0dfbaa..ef328907259f794e4e81e27bf40876334cf865c2 100644 (file)
@@ -1,3 +1,10 @@
+2000-10-06  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * pt.c (lookup_template_class): Set current access for enum.
+       (tsubst_enum): Set file & line for enum decl.
+       
+       * spew.c (yylex): Remove unused variable.
+
 2000-10-05  Richard Henderson  <rth@cygnus.com>
 
        * semantics.c (genrtl_finish_function): Don't init or check
index 171250e5757c46f7ba5a90b8f39f0a49ec6e4e36..7c12f9c597a64487215426aa5005019e72e5b247 100644 (file)
@@ -3965,7 +3965,10 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
       if (TREE_CODE (template_type) == ENUMERAL_TYPE)
        {
          if (!is_partial_instantiation)
-           t = start_enum (TYPE_IDENTIFIER (template_type));
+           {
+             set_current_access_from_decl (TYPE_NAME (template_type));
+             t = start_enum (TYPE_IDENTIFIER (template_type));
+           }
          else
            /* We don't want to call start_enum for this type, since
               the values for the enumeration constants may involve
@@ -9941,6 +9944,8 @@ tsubst_enum (tag, newtag, args)
     }
 
   finish_enum (newtag);
+  DECL_SOURCE_LINE (TYPE_NAME (newtag)) = DECL_SOURCE_LINE (TYPE_NAME (tag));
+  DECL_SOURCE_FILE (TYPE_NAME (newtag)) = DECL_SOURCE_FILE (TYPE_NAME (tag));
 }
 
 /* DECL is a FUNCTION_DECL that is a template specialization.  Return
index 56a3deed86bde6d4e25a10b856cfb16e7d2e92dd..110fdcaeb23ff6b34b9209ec87283d259b01c13d 100644 (file)
@@ -723,7 +723,6 @@ int
 yylex ()
 {
   int yychr;
-  tree trrr = NULL_TREE;
   int old_looking_for_typename = 0;
 
   timevar_push (TV_LEX);