From 952eddef9aff85b1e92626e89baaf7a360e2ac85 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 22 Dec 2013 00:07:40 +0000 Subject: Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3): https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841 --- .../ms-class-specialization-class-scope.cpp | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test/SemaTemplate/ms-class-specialization-class-scope.cpp (limited to 'test/SemaTemplate/ms-class-specialization-class-scope.cpp') diff --git a/test/SemaTemplate/ms-class-specialization-class-scope.cpp b/test/SemaTemplate/ms-class-specialization-class-scope.cpp new file mode 100644 index 0000000..3ebb1c9 --- /dev/null +++ b/test/SemaTemplate/ms-class-specialization-class-scope.cpp @@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify %s -Wno-microsoft +// RUN: %clang_cc1 -fms-extensions -fdelayed-template-parsing -fsyntax-only -verify %s -Wno-microsoft + +class A { +public: + template struct X { typedef int x; }; + + X::x a; // expected-note {{implicit instantiation first required here}} + + template<> struct X; // expected-error {{explicit specialization of 'A::X' after instantiation}} + template<> struct X; // expected-note {{forward declaration}} + + X::x b; // expected-error {{incomplete type 'A::X' named in nested name specifier}} + + template<> struct X { + typedef int y; + }; + + X::y c; + + template<> struct X {}; // expected-note {{previous definition is here}} + template<> struct X {}; // expected-error {{redefinition of 'A::X'}} +}; + +A::X::x axv; +A::X::x axf; // expected-error {{no type named 'x'}} + +template class B { +public: + template struct X { typedef int x; }; + + typename X::x a; // expected-note {{implicit instantiation first required here}} + + template<> struct X; // expected-error {{explicit specialization of 'X' after instantiation}} + template<> struct X; // expected-note {{forward declaration}} + + typename X::x b; // expected-error {{incomplete type 'B::X' named in nested name specifier}} + + template<> struct X { + typedef int y; + }; + + typename X::y c; + + template<> struct X {}; // expected-note {{previous definition is here}} + template<> struct X {}; // expected-error {{redefinition of 'X'}} +}; + +B b; // expected-note {{in instantiation of}} -- cgit v1.1