diff options
Diffstat (limited to 'gcc/cp/pt.c')
| -rw-r--r-- | gcc/cp/pt.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1e9bbb1..14b0c83 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11162,20 +11162,13 @@ instantiate_decl (tree d, int defer_ok, int undefined_ok) we have a chance to determine linkage. */ DECL_EXTERNAL (d) = 0; - /* This is done in analogous to `start_decl'. It is required - for correct access checking. */ + /* Enter the scope of D so that access-checking works correctly. */ push_nested_class (DECL_CONTEXT (d)); cp_finish_decl (d, (!DECL_INITIALIZED_IN_CLASS_P (d) ? DECL_INITIAL (d) : NULL_TREE), NULL_TREE, 0); - /* Normally, pop_nested_class is called by cp_finish_decl above. - But when instantiate_decl is triggered during - instantiate_class_template processing, its DECL_CONTEXT is - still not completed yet, and pop_nested_class isn't - called. */ - if (!COMPLETE_TYPE_P (DECL_CONTEXT (d))) - pop_nested_class (); + pop_nested_class (); } else if (TREE_CODE (d) == FUNCTION_DECL) { |
