This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54769] New: C++ parser - dependent class method template not found if structure template with the same name is visible


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: unassigned@gcc.gnu.org
        ReportedBy: awulkiew@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]