diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/decl.c | 5 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
-rw-r--r-- | gcc/cp/lex.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/static13.C | 19 |
5 files changed, 32 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 47f3f7f..1ebe193 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 ';'. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index bfcc47e..2f2d17b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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) { diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 3608051..1211957 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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; } diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index b29f6d2..fd9276b 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -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); diff --git a/gcc/testsuite/g++.old-deja/g++.other/static13.C b/gcc/testsuite/g++.old-deja/g++.other/static13.C new file mode 100644 index 0000000..4ebffa6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/static13.C @@ -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 () {} |