================ @@ -186,3 +186,74 @@ class E { #endif template<typename T> using D = int; // expected-note {{declared here}} E<D> ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template <typename T> struct O { + static const T v = 0; +}; + +struct P { + template <typename T> using I = typename O<T>::v; // #TypeAlias +}; + +struct Q { + template <typename T> int foo() { + return T::template I<int>; // expected-error {{'P::I' is expected to be a non-type template, but instantiated to a type alias template}} + // expected-note@#TypeAlias {{type alias template declared here}} + } +}; + +int bar() { + return Q().foo<P>(); // expected-note-re {{function template specialization {{.*}} requested here}} +} + +} // namespace PR88832 +#endif + +namespace PR63243 { + +namespace std { +template <class T> struct add_pointer { // #add_pointer +}; +} // namespace std + +class A {}; + +int main() { + std::__add_pointer<A>::type ptr; // #ill-formed-decl + // expected-error@#ill-formed-decl {{no template named '__add_pointer'}} + // expected-note@#add_pointer {{'add_pointer' declared here}} + // expected-error@#ill-formed-decl {{expected ';' after expression}} + // expected-error@#ill-formed-decl {{no type named 'type' in the global namespace}} + // expected-error@#ill-formed-decl {{'std::add_pointer' is expected to be a non-type template, but instantiated to a class template}} ---------------- zyn0217 wrote:
@cor3ntin do you have any thoughts here? thanks! https://github.com/llvm/llvm-project/pull/89019 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits