diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/FixIt/fixit.cpp | 19 | ||||
-rw-r--r-- | clang/test/Parser/MicrosoftExtensions.cpp | 24 |
2 files changed, 43 insertions, 0 deletions
diff --git a/clang/test/FixIt/fixit.cpp b/clang/test/FixIt/fixit.cpp index 41b187b0718..ac749859ea0 100644 --- a/clang/test/FixIt/fixit.cpp +++ b/clang/test/FixIt/fixit.cpp @@ -78,3 +78,22 @@ void f() { } } +template <class A> +class F1 { +public: + template <int B> + class Iterator { + }; +}; + +template<class T> +class F2 { + typename F1<T>:: /*template*/ Iterator<0> Mypos; // expected-error {{use 'template' keyword to treat 'Iterator' as a dependent template name}} +}; + +template <class T> +void f(){ + typename F1<T>:: /*template*/ Iterator<0> Mypos; // expected-error {{use 'template' keyword to treat 'Iterator' as a dependent template name}} +} + + diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index fd0d7d50d0e..ec297f27013 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -111,3 +111,27 @@ CtorCall& CtorCall::operator=(const CtorCall& that) } return *this; } + +template <class A> +class C1 { +public: + template <int B> + class Iterator { + }; +}; + +template<class T> +class C2 { + typename C1<T>:: /*template*/ Iterator<0> Mypos; // expected-warning {{use 'template' keyword to treat 'Iterator' as a dependent template name}} +}; + +template <class T> +void f(){ + typename C1<T>:: /*template*/ Iterator<0> Mypos; // expected-warning {{use 'template' keyword to treat 'Iterator' as a dependent template name}} +} + +int main() { + f<int>(); +} + + |