|
|
|
|
error: conflicting declaration 'StaticVarT<SomeType<T> > SomeType<T>::StaticVar' |
|
|
|
|
|
|
VC hasn't implemented three C++98/03 features: two-phase name lookup, dynamic exception specifications, and export. Two-phase name lookup remains unimplemented in 2015, but it's on the compiler team's list of things to do, pending codebase modernization. Dynamic exception specifications also remain unimplemented (VC gives non-Standard semantics to throw() and ignores other forms), but they were deprecated in C++11 and nobody cares about them now that we have noexcept. It's unlikely that we'll ever implement them, and there's even been talk of removing them from C++17. Finally, export was removed in C++11. - STL in 'C++11/14/17 Features In VS 2015 RTM' |
I don't think the analysis is quite right A<T> refers to the current instantiation (by 14.6.2.1[temp.dep.type]/1.2) when used Within the definition of the template and the definitions of its members svar1..svar5 A<T>::svar_type names a member of the current instantiation (by 14.6.2.1[temp.dep.type]/5.2) when used within those definitions but std::decay<T>::type names a member of std::decay, which is a different class template (and if you follow through, it is an alias to T, which is neither A<T> nor its member) stype<A<T>>::type names a member of stype<A<T>>, which is again a different class template (and again if you follow through, it is an alias to T) What I think you're encountering here are the type equivalence rules for svar5: 14.4[temp.type]/2 If an expression e involves a template parameter, decltype(e) denotes a unique dependent type. For svar4: 14.4[temp.type]/1 Two template-ids refer to the same class, function, or variable if their template-names refer to the same template and... So stype< A<T> >::type in the definition of svar3 refers to the same type as (the alias of) stype<A<T>>::type in the declaration of svar3 but stype< A<T> >::type in the definition on svar4 refers to a different type as (the alias of) std::decay<T>::type: the template-ids are different and decltype(A<T>::svar5) is a totally unique type, not the same as the type in the declaration of svar5 |