https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91262
Bug ID: 91262
Summary: using template type parameter after typename
Product: gcc
Version: 9.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: barry.revzin at gmail dot com
Target Milestone: ---
Reduced from StackOverflow (https://stackoverflow.com/q/57206006/2069064), this
short example:
struct Wrapper {
template <class T>
using type = T;
};
template <class T>
void foobar(typename Wrapper::template type<T>);
fails to compile with:
foo.cxx:7:40: error: using template type parameter ‘Wrapper::type<T>’ after
‘typename’
7 | void foobar(typename Wrapper::template type<T>);
|
But this is fine - just because Wrapper::type isn't dependent doesn't disallow
us from using these keywords. clang accepts the example.