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



             Bug #: 54769

           Summary: C++ parser - dependent class method template not found

                    if structure template with the same name is visible

    Classification: Unclassified

           Product: gcc

           Version: 4.7.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

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

        ReportedBy: awulk...@gmail.com





Created attachment 28316

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28316

src, temps, error



If the object is of dependent type, the parser finds incorrect name. E.g. the

following code won't compile:



template <typename T1, typename T2>

struct boom {};



struct aaa

{

    template <typename T>

    void boom() {}

};



template <typename T>

struct bbb

{

    void test()

    {

        T t;

        t.template boom<int>();

    }

};



int main()

{

    bbb<aaa> b;

    b.test();



    return 0;

}



Error:

main.cpp: In member function 'void bbb<T>::test()':

main.cpp:16:28: error: wrong number of template arguments (1, should be 2)

main.cpp:2:8: error: provided for 'template<class T1, class T2> struct boom'



Environment: windows 7 x64 + GCC 4.7.0

Cmd: gcc main.cpp

Reply via email to