You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With T::template Base, lookup for Base in the scope of T aka Base<int> finds the injected-class-name, and this lookup does not ignore function names, so per CWG 1310 it should be considered to name the constructor of Base, making the code ill-formed.
If this analysis is correct, perhaps the example can be changed to
template<classT, template<class> classU = T::template Base> structThird { };
Third<Derived<int> > t; // OK: default argument uses injected-class-name as a template
Third<Base<int> > t; // Error: injected-class-name in default argument names the constructor of Base ([class.qual])
The text was updated successfully, but these errors were encountered:
MSVC rejects. ICC with different error messages. clang accepts with a warning.
Problem is T::template Base is a constructor name, even with intervening "template".
Editorial meeting consensus: Replace "Base" with "Derived", don't add a second line.
With
T::template Base
, lookup forBase
in the scope ofT
akaBase<int>
finds the injected-class-name, and this lookup does not ignore function names, so per CWG 1310 it should be considered to name the constructor ofBase
, making the code ill-formed.If this analysis is correct, perhaps the example can be changed to
The text was updated successfully, but these errors were encountered: