diff options
Diffstat (limited to 'gcc-4.9/gcc/cp/name-lookup.c')
-rw-r--r-- | gcc-4.9/gcc/cp/name-lookup.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc-4.9/gcc/cp/name-lookup.c b/gcc-4.9/gcc/cp/name-lookup.c index 53f14f3ee..0137c3f4a 100644 --- a/gcc-4.9/gcc/cp/name-lookup.c +++ b/gcc-4.9/gcc/cp/name-lookup.c @@ -1630,10 +1630,14 @@ leave_scope (void) free_binding_level = scope; } - /* Find the innermost enclosing class scope, and reset - CLASS_BINDING_LEVEL appropriately. */ if (scope->kind == sk_class) { + /* Reset DEFINING_CLASS_P to allow for reuse of a + class-defining scope in a non-defining context. */ + scope->defining_class_p = 0; + + /* Find the innermost enclosing class scope, and reset + CLASS_BINDING_LEVEL appropriately. */ class_binding_level = NULL; for (scope = current_binding_level; scope; scope = scope->level_chain) if (scope->kind == sk_class) |