65 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3template<typename T>4struct A0 {5 struct B0;6 7 template<typename U>8 struct C0 {9 struct D0;10 11 template<typename V>12 struct E0;13 };14};15 16template<typename T>17int A0<T>::B0::* f0();18 19template<typename T>20int A0<T>::B1::* f1();21 22template<typename T>23int A0<T>::C0<int>::* f2(); // expected-error {{expected unqualified-id}}24 25template<typename T>26int A0<T>::C1<int>::* f3(); // expected-error {{no member named 'C1' in 'A0<T>'}}27 // expected-error@-1 {{expected ';' after top level declarator}}28 29template<typename T>30int A0<T>::template C2<int>::* f4();31 32template<typename T>33int A0<T>::template C0<int>::D0::* f5();34 35template<typename T>36int A0<T>::template C2<int>::D1::* f6();37 38template<typename T>39int A0<T>::template C0<int>::E0<int>::* f7(); // expected-error {{use 'template' keyword to treat 'E0' as a dependent template name}}40 // expected-error@-1 {{expected unqualified-id}}41 42template<typename T>43int A0<T>::template C2<int>::E1<int>::* f8(); // expected-error {{no member named 'C2' in 'A0<T>'}}44 45template<typename T>46int A0<T>::template C0<int>::template E0<int>::* f9();47 48template<typename T>49int A0<T>::template C2<int>::template E1<int>::* f10();50 51namespace TypoCorrection {52 template<typename T>53 struct A {54 template<typename U>55 struct Typo; // expected-note {{'Typo' declared here}}56 };57 58 template<typename T>59 int A<T>::template typo<int>::* f();60 61 template<typename T>62 int A<T>::typo<int>::* g(); // expected-error {{no template named 'typo' in 'TypoCorrection::A<T>'; did you mean 'Typo'?}}63 // expected-error@-1 {{expected unqualified-id}}64}65