decl.c (cp_make_fname_decl): When creating a top-level __FUNCTION__-like symbol,...
authorMark Mitchell <mark@codesourcery.com>
Wed, 12 Nov 2003 22:20:34 +0000 (22:20 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 12 Nov 2003 22:20:34 +0000 (22:20 +0000)
* decl.c (cp_make_fname_decl): When creating a top-level
__FUNCTION__-like symbol, do register it with pushdecl.

From-SVN: r73515

gcc/cp/ChangeLog
gcc/cp/decl.c

index d8c54b02220a2c6c0c69fe8295a3a6a134c45797..f74ac5e149135db0470816827f79b4590a90d8bb 100644 (file)
@@ -1,5 +1,8 @@
 2003-11-12  Mark Mitchell  <mark@codesourcery.com>
 
+       * decl.c (cp_make_fname_decl): When creating a top-level
+       __FUNCTION__-like symbol, do register it with pushdecl.
+
        * decl.c (finish_case_label): Do not check that we are within a
        switch statement here.
        * parser.c (struct cp_parser): Add in_iteration_statement_p and
index b1fd4f793d5013144808750c3b3eb47f4f884af7..61bea50b3539eebf26aa32cd5e91070dfbb4131f 100644 (file)
@@ -3157,9 +3157,10 @@ cp_make_fname_decl (tree id, int type_dep)
       while (b->level_chain->kind != sk_function_parms)
        b = b->level_chain;
       pushdecl_with_scope (decl, b);
+      cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
     }
-
-  cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
+  else
+    pushdecl_top_level_and_finish (decl, init);
       
   return decl;
 }