]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/name-lookup.c
re PR c++/60573 ([c++1y] ICE with defining generic function of nested class in class...
authorAdam Butcher <abutcher@gcc.gnu.org>
Fri, 28 Mar 2014 20:41:45 +0000 (20:41 +0000)
committerAdam Butcher <abutcher@gcc.gnu.org>
Fri, 28 Mar 2014 20:41:45 +0000 (20:41 +0000)
commit5294e4c32d617f2a52e47fb08d9b83b83885f469
tree4b3b534d549cd7d1a2b7dadf8525239410356854
parenteee32b5ea3226842340d5779d5f02af7951d3842
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
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]