The following code - compiled with the flags -pedantic-errors -std=c++11 -Wall is rejected by gcc 4.8.0 20130210 (experimental): //---------------------------------- template<class T> struct A {}; template<class T> struct B1 : A<T> { typedef A<T> super_t; using A<T>::A; // #7 }; template<class T> struct B2 : A<T> { using A<T>::A; typedef A<T> super_t; // #13 }; //---------------------------------- "7|error: declaration of 'using A<T>::A' [-fpermissive]| 2|error: changes meaning of 'A' from 'struct A<T>' [-fpermissive]| 13|error: 'A' does not name a type| 13|note: (perhaps 'typename A<T>::A' was intended)" It could be related to bug 56323, but I have currently no way to verify this hypotheses. My understanding is that both definitions of B1 and B2 should be valid. Note that even though the typedefs referring to A<T> are needed to produce the error, even though at least in B1 its effects are completely unexpected.
As of the more recent trunk gcc 4.8.0 20130217 (experimental) these problems have been partially reolved. Template B1 is now accepted, but template B2 still causes problems. The reduced test case is: //---------------------------------- template<class T> struct A {}; template<class T> struct B : A<T> { using A<T>::A; typedef A<T> super_t; // #7 }; //---------------------------------- "7|error: 'A' does not name a type| 7|note: (perhaps 'typename A<T>::A' was intended)"
*** Bug 56452 has been marked as a duplicate of this bug. ***
Author: jason Date: Wed Feb 27 18:13:24 2013 New Revision: 196316 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196316 Log: PR c++/56358 PR c++/56323 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead of the base name for inheriting ctors. (push_class_level_binding_1): Remove inheriting ctor handling. * pt.c (tsubst_decl) [USING_DECL]: Likewise. * class.c (add_implicitly_declared_members): Adjust. Added: trunk/gcc/testsuite/g++.dg/cpp0x/inh-ctor18.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c trunk/gcc/cp/name-lookup.c trunk/gcc/cp/pt.c trunk/gcc/testsuite/g++.dg/inherit/using5.C trunk/gcc/testsuite/g++.old-deja/g++.other/using3.C
Fixed.