template<typename T> struct foo { typedef int itype; typedef int jtype; struct bar { typedef typename foo::itype itype; using foo::jtype; itype i; jtype j; }; }; gets you: ~/ootbc/members/src$ g++ foo.cc foo.cc:9: error: `jtype' does not name a type Adding "typename" here and there changes the error you get but doesn't compile. The above code compiles OK on Comeau.
I think this is a dup of bug 14258. GCC still implements the old using rules.
Confirmed. This is a regression against 3.3 which compiled the code just fine. W.
As I said, I think this is a dup of bug 14258, we never really got using correct.
I'm not sure it is a duplicate, since the error messages are very different. But be that as it may, this is a regression and should be fixed. If it is, someone may want to take a look at that other PR as well. W.
: Search converges between 2003-07-29-trunk (#308) and 2003-07-30-trunk (#309).
Leavinga s P2. We should at least look at this, and understand what's wrong.
This issue will not be resolved in GCC 4.1.0; retargeted at GCC 4.1.1.
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Janis, Could you do a regression hunt on this bug?
A regression hunt on powerpc-linux using the submitter's testcase identified the following patch: http://gcc.gnu.org/viewcvs?view=rev&rev=69921 r69921 | nathan | 2003-07-29 11:16:50 +0000 (Tue, 29 Jul 2003)
The using-declaration is invalid because foo is not a base of bar. icc also rejects the testcase if you try to instantiate bar.
If the "using" is invalid then there should be a diagnostic on line 7 that says so.
So this is just a diagnostic issue and not a regression.
Not, it's an error: invalid text is accepted without diagnostic (if the identifier introduced with the "using" is not itself used, then the using statement is invalid but gets no diagnostic).
Author: fabien Date: Wed Dec 28 19:53:14 2011 New Revision: 182711 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182711 Log: gcc/testsuite/ChangeLog 2011-12-28 Fabien Chene <fabien@gcc.gnu.org> PR c++/23211 * g++.dg/template/using18.C: New. * g++.dg/template/using19.C: New. * g++.dg/template/nested3.C: Remove dg-message at instantiation. * g++.dg/template/crash13.C: Likewise. gcc/cp/ChangeLog 2011-12-28 Fabien Chene <fabien@gcc.gnu.org> PR c++/23211 * name-lookup.c (do_class_using_decl): Use dependent_scope_p instead of dependent_type_p, to check that a non-dependent nested-name-specifier of a class-scope using declaration refers to a base, even if the current scope is dependent. * parser.c (cp_parser_using_declaration): Set USING_DECL_TYPENAME_P to 1 if the DECL is not null. Re-indent a 'else' close to the prior modification. Added: trunk/gcc/testsuite/g++.dg/template/using18.C trunk/gcc/testsuite/g++.dg/template/using19.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/name-lookup.c trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/template/crash13.C trunk/gcc/testsuite/g++.dg/template/nested3.C
Fixed.