decl.c (start_cleanup_fn): Mark the function as `inline'.
* decl.c (start_cleanup_fn): Mark the function as `inline'. * decl2.c (get_guard): Call cp_finish_decl, not rest_of_decl_compilation, for local guards. * lex.c (do_identifier): Remove unused variable. From-SVN: r35285
This commit is contained in:
parent
1b68067d75
commit
5a728aca65
5 changed files with 32 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2000-07-26 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* decl.c (start_cleanup_fn): Mark the function as `inline'.
|
||||
* decl2.c (get_guard): Call cp_finish_decl, not
|
||||
rest_of_decl_compilation, for local guards.
|
||||
* lex.c (do_identifier): Remove unused variable.
|
||||
|
||||
Wed Jul 26 15:05:51 CEST 2000 Marc Espie <espie@cvs.openbsd.org>
|
||||
|
||||
* parse.y: Add missing ';'.
|
||||
|
|
|
@ -8362,6 +8362,11 @@ start_cleanup_fn ()
|
|||
compiler. */
|
||||
TREE_PUBLIC (fndecl) = 0;
|
||||
DECL_ARTIFICIAL (fndecl) = 1;
|
||||
/* Make the function `inline' so that it is only emitted if it is
|
||||
actually needed. It is unlikely that it will be inlined, since
|
||||
it is only called via a function pointer, but we avoid unncessary
|
||||
emissions this way. */
|
||||
DECL_INLINE (fndecl) = 1;
|
||||
/* Build the parameter. */
|
||||
if (flag_use_cxa_atexit)
|
||||
{
|
||||
|
|
|
@ -2866,7 +2866,7 @@ get_guard (decl)
|
|||
if (!flag_new_abi && !DECL_NAMESPACE_SCOPE_P (decl))
|
||||
{
|
||||
guard = get_temp_name (integer_type_node);
|
||||
rest_of_decl_compilation (guard, NULL_PTR, 0, 0);
|
||||
cp_finish_decl (guard, NULL_TREE, NULL_TREE, 0);
|
||||
return guard;
|
||||
}
|
||||
|
||||
|
|
|
@ -3071,7 +3071,6 @@ do_identifier (token, parsing, args)
|
|||
{
|
||||
register tree id;
|
||||
int lexing = (parsing == 1);
|
||||
int in_call = (parsing == 2);
|
||||
|
||||
if (! lexing || IDENTIFIER_OPNAME_P (token))
|
||||
id = lookup_name (token, 0);
|
||||
|
|
19
gcc/testsuite/g++.old-deja/g++.other/static13.C
Normal file
19
gcc/testsuite/g++.old-deja/g++.other/static13.C
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Build don't run:
|
||||
// Origin: scott snyder <snyder@fnal.gov>
|
||||
|
||||
struct Cleaner
|
||||
{
|
||||
~Cleaner() {}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
void bar ()
|
||||
{
|
||||
static Cleaner cleanup;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void foo() { bar<int>(); }
|
||||
|
||||
int main () {}
|
Loading…
Add table
Reference in a new issue