]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/name-lookup.c
Fix PR c++/60573
authorabutcher <abutcher@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Mar 2014 20:41:45 +0000 (20:41 +0000)
committerabutcher <abutcher@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Mar 2014 20:41:45 +0000 (20:41 +0000)
commit265a34f4a21ad8f2285f5e849ef700f560795d22
tree4b3b534d549cd7d1a2b7dadf8525239410356854
parenteecfcba490616b310de58bd38a9716762fa1f716
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
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/pr60573.C [new file with mode: 0644]