The following example code compiled fine with 4.1.2 20060901 (Debian 4.1.1-13) but fails with 4.1.2 20061007 (Debian 4.1.1-16). I'm wondering whether this change was intentional and whether there's a good reason for this change (in a stable branch). $ g++-4.1 -c pair.c x.c:32: error: non-template 'pair' used as template x.c:32: note: use 'avm_map<Key, Value, Compare, equal>::template pair' to indicate that it is a template
Created attachment 12429 [details] testcase
The real question is avm_map dependent inside the nested class? I know there are C++ defect reports asking that question so ...
(In reply to comment #2) > The real question is avm_map dependent inside the nested class? > I know there are C++ defect reports asking that question so ... And that is DR 224 which is in WP.
I think this is more complicated than just DR 224. See PR 9634.
DR 224 says this is invalid code but GDR has mentioned that DR 224 is broken in really bad way: template <class T> struct B : T { void g(void) { B x; x.f(); } } struct A { void f(void) {} } int main(void) { B<A> t; t.g(); } The above code would be invalid code with the resulution of DR 224.
Subject: Re: [DR 224] error: non-template 'pair' used as template On Sat, 2006-10-14 at 18:25 +0000, pinskia at gcc dot gnu dot org wrote: > > ------- Comment #5 from pinskia at gcc dot gnu dot org 2006-10-14 18:25 ------- > DR 224 says this is invalid code Sorry valid code. -- Pinski
Waiting for ISO Committee to decide what to do about DR 224.
Waiting for DR -> SUSPENDED.
Bugs waiting for the committee should not be release-critical; we can restore this to P3 and reconsider the priority when unsuspending.
Closing 4.1 branch.
I don't see any open issues about DR 224 since it went into the WP. Unsuspending, P3.
Subject: Bug 29469 Author: jason Date: Wed Mar 4 18:42:17 2009 New Revision: 144618 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144618 Log: PR c++/9634 PR c++/29469 PR c++/29607 * decl.c (make_typename_type): Do look inside currently open classes. * parser.c (cp_parser_lookup_name): Likewise. (cp_parser_template_name): Likewise. * pt.c (dependent_scope_p): New function. * cp-tree.h: Declare it. * class.c (currently_open_class): Return fast if T isn't a class. Added: trunk/gcc/testsuite/g++.dg/template/dependent-name5.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 29469 Author: jason Date: Wed Mar 4 19:37:43 2009 New Revision: 144621 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144621 Log: PR c++/9634 PR c++/29469 PR c++/29607 Implement DR 224. * decl.c (make_typename_type): Do look inside currently open classes. * parser.c (cp_parser_lookup_name): Likewise. (cp_parser_template_name): Likewise. * pt.c (dependent_scope_p): New function. * cp-tree.h: Declare it. * class.c (currently_open_class): Return fast if T isn't a class. Added: branches/gcc-4_3-branch/gcc/testsuite/g++.dg/template/dependent-name5.C - copied unchanged from r144618, trunk/gcc/testsuite/g++.dg/template/dependent-name5.C Modified: branches/gcc-4_3-branch/gcc/cp/ChangeLog branches/gcc-4_3-branch/gcc/cp/class.c branches/gcc-4_3-branch/gcc/cp/cp-tree.h branches/gcc-4_3-branch/gcc/cp/decl.c branches/gcc-4_3-branch/gcc/cp/parser.c branches/gcc-4_3-branch/gcc/cp/pt.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed for 4.3 and 4.4, not applying to 4.2.
Subject: Bug 29469 Author: jason Date: Fri Apr 3 17:31:38 2009 New Revision: 145510 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145510 Log: Revert: PR c++/9634 PR c++/29469 PR c++/29607 Implement DR 224. * decl.c (make_typename_type): Do look inside currently open classes. * parser.c (cp_parser_lookup_name): Likewise. (cp_parser_template_name): Likewise. * pt.c (dependent_scope_p): New function. * cp-tree.h: Declare it. * class.c (currently_open_class): Return fast if T isn't a class. Removed: branches/gcc-4_3-branch/gcc/testsuite/g++.dg/template/dependent-name5.C Modified: branches/gcc-4_3-branch/gcc/cp/ChangeLog branches/gcc-4_3-branch/gcc/cp/class.c branches/gcc-4_3-branch/gcc/cp/cp-tree.h branches/gcc-4_3-branch/gcc/cp/decl.c branches/gcc-4_3-branch/gcc/cp/parser.c branches/gcc-4_3-branch/gcc/cp/pt.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog