http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56358



             Bug #: 56358

           Summary: [C++11] Erroneous interaction of typedef and inherited

                    constructor declarations

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: daniel.krueg...@googlemail.com





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.

Reply via email to