From 554bcb69c2d785a011a30e7db87a36a87fe7db10 Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 15 Aug 2012 20:02:54 +0000 Subject: Vendor import of clang trunk r161861: http://llvm.org/svn/llvm-project/cfe/trunk@161861 --- test/Parser/MicrosoftExtensions.cpp | 60 +++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 23 deletions(-) (limited to 'test/Parser/MicrosoftExtensions.cpp') diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp index 3a1ffea..6219e29 100644 --- a/test/Parser/MicrosoftExtensions.cpp +++ b/test/Parser/MicrosoftExtensions.cpp @@ -151,11 +151,24 @@ void missing_template_keyword(){ class AAAA { }; +template +class SimpleTemplate {}; + template void redundant_typename() { typename T t;// expected-warning {{expected a qualified name after 'typename'}} typename AAAA a;// expected-warning {{expected a qualified name after 'typename'}} + t = 3; + + typedef typename T* pointerT;// expected-warning {{expected a qualified name after 'typename'}} + typedef typename SimpleTemplate templateT;// expected-warning {{expected a qualified name after 'typename'}} + + pointerT pT = &t; + *pT = 4; + + int var; + int k = typename var;// expected-error {{expected a qualified name after 'typename'}} } @@ -284,28 +297,29 @@ int main () { missing_template_keyword(); } +namespace access_protected_PTM { + class A { + protected: + void f(); // expected-note {{must name member using the type of the current context 'access_protected_PTM::B'}} + }; + class B : public A{ + public: + void test_access(); + static void test_access_static(); + }; - -namespace access_protected_PTM { - -class A { -protected: - void f(); // expected-note {{must name member using the type of the current context 'access_protected_PTM::B'}} -}; - -class B : public A{ -public: - void test_access(); - static void test_access_static(); -}; - -void B::test_access() { - &A::f; // expected-error {{'f' is a protected member of 'access_protected_PTM::A'}} -} - -void B::test_access_static() { - &A::f; -} - -} \ No newline at end of file + void B::test_access() { + &A::f; // expected-error {{'f' is a protected member of 'access_protected_PTM::A'}} + } + + void B::test_access_static() { + &A::f; + } +} + +namespace Inheritance { + class __single_inheritance A; + class __multiple_inheritance B; + class __virtual_inheritance C; +} -- cgit v1.1