This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60573] [c++1y] ICE with defining generic function of nested class in class scope
- From: "abutcher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Mar 2014 20:42:16 +0000
- Subject: [Bug c++/60573] [c++1y] ICE with defining generic function of nested class in class scope
- Auto-submitted: auto-generated
- References: <bug-60573-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60573
--- Comment #1 from Adam Butcher <abutcher at gcc dot gnu.org> ---
Author: abutcher
Date: Fri Mar 28 20:41:45 2014
New Revision: 208921
URL: http://gcc.gnu.org/viewcvs?rev=208921&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/cpp1y/pr60573.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/name-lookup.c
trunk/gcc/cp/name-lookup.h
trunk/gcc/cp/parser.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog