summaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.h
diff options
context:
space:
mode:
authorAdam Butcher <abutcher@gcc.gnu.org>2014-03-28 20:41:45 +0000
committerAdam Butcher <abutcher@gcc.gnu.org>2014-03-28 20:41:45 +0000
commit5294e4c32d617f2a52e47fb08d9b83b83885f469 (patch)
tree4b3b534d549cd7d1a2b7dadf8525239410356854 /gcc/cp/name-lookup.h
parenteee32b5ea3226842340d5779d5f02af7951d3842 (diff)
downloadgcc-5294e4c32d617f2a52e47fb08d9b83b83885f469.tar.gz
re PR c++/60573 ([c++1y] ICE with defining generic function of nested class in class scope)
Fix PR c++/60573 PR c++/60573 * name-lookup.h (cp_binding_level): New transient field defining_class_p to indicate whether a scope is in the process of defining a class. * semantics.c (begin_class_definition): Set defining_class_p. * name-lookup.c (leave_scope): Reset defining_class_p. * parser.c (synthesize_implicit_template_parm): Use cp_binding_level:: defining_class_p rather than TYPE_BEING_DEFINED as the predicate for unwinding to class-defining scope to handle the erroneous definition of a generic function of an arbitrarily nested class within an enclosing class. PR c++/60573 * g++.dg/cpp1y/pr60573.C: New testcase. From-SVN: r208921
Diffstat (limited to 'gcc/cp/name-lookup.h')
-rw-r--r--gcc/cp/name-lookup.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index a63442f85c2..40e0338ca73 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -255,7 +255,14 @@ struct GTY(()) cp_binding_level {
unsigned more_cleanups_ok : 1;
unsigned have_cleanups : 1;
- /* 24 bits left to fill a 32-bit word. */
+ /* Transient state set if this scope is of sk_class kind
+ and is in the process of defining 'this_entity'. Reset
+ on leaving the class definition to allow for the scope
+ to be subsequently re-used as a non-defining scope for
+ 'this_entity'. */
+ unsigned defining_class_p : 1;
+
+ /* 23 bits left to fill a 32-bit word. */
};
/* The binding level currently in effect. */