summaryrefslogtreecommitdiffstats
path: root/test/Parser/MicrosoftExtensions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/MicrosoftExtensions.cpp')
-rw-r--r--test/Parser/MicrosoftExtensions.cpp60
1 files changed, 37 insertions, 23 deletions
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 <typename T>
+class SimpleTemplate {};
+
template <class T>
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<int> 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<int>();
}
+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;
+}
OpenPOWER on IntegriCloud