[Bug c++/66596] Type that is not dependent on the variable template template parameters

ed at catmur dot co.uk gcc-bugzilla@gcc.gnu.org
Fri Jun 19 09:24:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66596

--- Comment #1 from Ed Catmur <ed at catmur dot co.uk> ---
Note: error produced is:

prog.cc: In instantiation of 'void g() [with T = int]':
prog.cc:6:21:   required from here
prog.cc:5:30: error: 'U::f()' is not a member of 'V'
 template<class T> void g() { t<T>.f(); }
                              ^

If the type of the non-specialized variable template t is made formally
dependent on its template parameters, then the program compiles fine:

template<class T> decltype((T*)0, *(U*)0) t;
template<> V t<int>;



More information about the Gcc-bugs mailing list