diff options
Diffstat (limited to 'gcc/cp/decl.c')
| -rw-r--r-- | gcc/cp/decl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0b802ff..ce530fa 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3788,8 +3788,6 @@ start_decl_1 (tree decl) if (type == error_mark_node) return; - maybe_push_cleanup_level (type); - if (initialized) /* Is it valid for this decl to have an initializer at all? If not, set INITIALIZED to zero, which will indirectly @@ -3845,6 +3843,14 @@ start_decl_1 (tree decl) if (! initialized) DECL_INITIAL (decl) = NULL_TREE; + + /* Create a new scope to hold this declaration if necessary. + Whether or not a new scope is necessary cannot be determined + until after the type has been completed; if the type is a + specialization of a class template it is not until after + instantiation has occurred that TYPE_HAS_NONTRIVIAL_DESTRUCTOR + will be set correctly. */ + maybe_push_cleanup_level (type); } /* Handle initialization of references. DECL, TYPE, and INIT have the |
