summaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.h
diff options
context:
space:
mode:
authorabutcher <abutcher@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-28 20:41:45 +0000
committerabutcher <abutcher@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-28 20:41:45 +0000
commit265a34f4a21ad8f2285f5e849ef700f560795d22 (patch)
tree4b3b534d549cd7d1a2b7dadf8525239410356854 /gcc/cp/name-lookup.h
parenteecfcba490616b310de58bd38a9716762fa1f716 (diff)
downloadgcc-265a34f4a21ad8f2285f5e849ef700f560795d22.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208921 138bc75d-0d04-0410-961f-82ee72b054a4
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. */