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++/36813] New: screwy diagnostic on ill-formed call from template with a local typedef


The second error message issued by gcc 4.3.0 for the ill-formed program below
looks wrong. I would expect it to read the same as the first one.

$ cat t.cpp && g++ t.cpp
template <class T> struct A { };
template <class T, class U> struct B { typedef A<T> Y; };

template <class T> void foo (T*) { }

template <class T, class U>
void bar () {
    foo (typename B<T, U>::Y ());

    typedef typename B<T, U>::Y Y;
    foo (Y ());   // line 11
}

int main () {
    bar<int, A<int> >();
}
t.cpp: In function ?void bar() [with T = int, U = A<int>]?:
t.cpp:15:   instantiated from here
t.cpp:8: error: no matching function for call to ?foo(A<int>)?
t.cpp:11: error: no matching function for call to ?foo(bar() [with T = int, U =
A<int>]::Y)?


-- 
           Summary: screwy diagnostic on ill-formed call from template with
                    a local typedef
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com


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


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