diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-17 18:15:21 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-17 18:15:21 +0000 |
commit | 8a4bf740971d3cd89aa57543690b8f16861bc682 (patch) | |
tree | 4f7e54aac05b389e40a2882e9147b55d0e1d2ea3 /gcc/cp | |
parent | 66b9e127848fc9d470847d1d879474d980a33f43 (diff) | |
download | gcc-8a4bf740971d3cd89aa57543690b8f16861bc682.tar.gz |
* decl.c (warn_extern_redeclared_static): Don't get confused by
static member functions.
(duplicate_decls): Merge DECL_THIS_STATIC.
* decl.c (expand_static_init): Make sure assignments to local
statics actually occur.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29477 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/decl.c | 16 |
2 files changed, 22 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 88b123c0417..ae81e8a4e47 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +1999-09-17 Mark Mitchell <mark@codesourcery.com> + + * decl.c (warn_extern_redeclared_static): Don't get confused by + static member functions. + (duplicate_decls): Merge DECL_THIS_STATIC. + + * decl.c (expand_static_init): Make sure assignments to local + statics actually occur. + 1999-09-17 Nathan Sidwell <nathan@acm.org> * call.c (perform_implicit_conversion): Deal with error_mark_node. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 7047f342211..d2e41d596ef 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2939,6 +2939,12 @@ warn_extern_redeclared_static (newdecl, olddecl) if (TREE_CODE (newdecl) == TYPE_DECL) return; + + /* Don't get confused by static member functions; that's a different + use of `static'. */ + if (TREE_CODE (newdecl) == FUNCTION_DECL + && DECL_STATIC_FUNCTION_P (newdecl)) + return; /* If the old declaration was `static', or the new one isn't, then then everything is OK. */ @@ -3284,6 +3290,7 @@ duplicate_decls (newdecl, olddecl) DECL_ABSTRACT_VIRTUAL_P (newdecl) |= DECL_ABSTRACT_VIRTUAL_P (olddecl); DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl); DECL_NEEDS_FINAL_OVERRIDER_P (newdecl) |= DECL_NEEDS_FINAL_OVERRIDER_P (olddecl); + DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl); new_defines_function = DECL_INITIAL (newdecl) != NULL_TREE; /* Optionally warn about more than one declaration for the same @@ -7987,9 +7994,12 @@ expand_static_init (decl, init) || (init && TREE_CODE (init) == TREE_LIST)) assignment = build_aggr_init (decl, init, 0); else if (init) - /* The initialization we're doing here is just a bitwise - copy. */ - assignment = build (INIT_EXPR, TREE_TYPE (decl), decl, init); + { + /* The initialization we're doing here is just a bitwise + copy. */ + assignment = build (INIT_EXPR, TREE_TYPE (decl), decl, init); + TREE_SIDE_EFFECTS (assignment) = 1; + } else assignment = NULL_TREE; |