diff options
author | Charles Li <charles_li@playstation.sony.com> | 2016-04-13 20:00:45 +0000 |
---|---|---|
committer | Charles Li <charles_li@playstation.sony.com> | 2016-04-13 20:00:45 +0000 |
commit | 64a1a81e76b48ade6773887323476b2a6fb72c38 (patch) | |
tree | 4a74019258a4996b2df26cdc201e6a8eb9d27e1a /clang/test/SemaTemplate/instantiate-member-class.cpp | |
parent | c0bef99bb03cbcef5e0700bfdbed6e82970c8416 (diff) | |
download | bcm5719-llvm-64a1a81e76b48ade6773887323476b2a6fb72c38.tar.gz bcm5719-llvm-64a1a81e76b48ade6773887323476b2a6fb72c38.zip |
Lit C++11 Compatibility Patch #7
13 tests have been updated for C++11 compatibility.
Differential Revision: http://reviews.llvm.org/D19068
llvm-svn: 266239
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-member-class.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-member-class.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/clang/test/SemaTemplate/instantiate-member-class.cpp b/clang/test/SemaTemplate/instantiate-member-class.cpp index 3f49606b86e..159bccb2c99 100644 --- a/clang/test/SemaTemplate/instantiate-member-class.cpp +++ b/clang/test/SemaTemplate/instantiate-member-class.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s namespace PR8965 { template<typename T> @@ -106,7 +108,10 @@ namespace test2 { namespace AliasTagDef { template<typename T> struct F { - using S = struct U { // expected-warning {{C++11}} + using S = struct U { +#if __cplusplus <= 199711L + // expected-warning@-2 {{alias declarations are a C++11 extension}} +#endif T g() { return T(); } @@ -122,8 +127,13 @@ namespace rdar10397846 { { struct B { - struct C { C() { int *ptr = I; } }; // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}} \ - expected-warning{{expression which evaluates to zero treated as a null pointer constant of type 'int *'}} + struct C { C() { int *ptr = I; } }; +#if __cplusplus >= 201103L + // expected-error@-2 {{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}} +#else + // expected-warning@-4 {{expression which evaluates to zero treated as a null pointer constant of type 'int *'}} +#endif + // expected-error@-6 {{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}} }; }; |