From 6de8aca1d00257607b039ef41dc54b0ecfb25ef4 Mon Sep 17 00:00:00 2001 From: Charles Li Date: Fri, 24 Feb 2017 23:23:53 +0000 Subject: [Test] Make Lit tests C++11 compatible #10 Differential Revision: https://reviews.llvm.org/D21626 llvm-svn: 296193 --- clang/test/Modules/merge-using-decls.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'clang/test/Modules/merge-using-decls.cpp') diff --git a/clang/test/Modules/merge-using-decls.cpp b/clang/test/Modules/merge-using-decls.cpp index 98989d12f98..019a69fe25f 100644 --- a/clang/test/Modules/merge-using-decls.cpp +++ b/clang/test/Modules/merge-using-decls.cpp @@ -1,6 +1,10 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify %s -DORDER=1 +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify -std=c++98 %s -DORDER=1 +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify -std=c++11 %s -DORDER=1 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify %s -DORDER=2 +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify -std=c++98 %s -DORDER=2 +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify -std=c++11 %s -DORDER=2 #if ORDER == 1 #include "a.h" @@ -24,7 +28,11 @@ template int Use() { } template int UseAll() { +#if __cplusplus <= 199711L // C++11 does not allow access declerations return Use >() + Use >() + Use >() + Use >(); // expected-note 0-2{{instantiation of}} +#else + return Use >() + Use >() + Use >(); // expected-note 0-2{{instantiation of}} +#endif } template int UseAll(); @@ -37,8 +45,10 @@ template int UseAll(); // Here, we're instantiating the definition from 'A' and merging the definition // from 'B' into it. +#if __cplusplus <= 199711L // C++11 does not allow access declerations // expected-error@b.h:* {{'E::value' from module 'B' is not present in definition of 'E' in module 'A'}} // expected-error@b.h:* {{'E::v' from module 'B' is not present in definition of 'E' in module 'A'}} +#endif // expected-error@b.h:* {{'F::type' from module 'B' is not present in definition of 'F' in module 'A'}} // expected-error@b.h:* {{'F::t' from module 'B' is not present in definition of 'F' in module 'A'}} @@ -55,11 +65,14 @@ template int UseAll(); // expected-error@b.h:* 2{{'typename' keyword used on a non-type}} // expected-error@b.h:* 2{{dependent using declaration resolved to type without 'typename'}} +#if __cplusplus <= 199711L // C++11 does not allow access declerations // expected-error@a.h:* {{'E::type' from module 'A' is not present in definition of 'E' in module 'B'}} // expected-error@a.h:* {{'E::t' from module 'A' is not present in definition of 'E' in module 'B'}} // expected-error@a.h:* {{'E::value' from module 'A' is not present in definition of 'E' in module 'B'}} // expected-error@a.h:* {{'E::v' from module 'A' is not present in definition of 'E' in module 'B'}} // expected-note@b.h:* 2{{definition has no member}} +#endif + // expected-error@a.h:* {{'F::type' from module 'A' is not present in definition of 'F' in module 'B'}} // expected-error@a.h:* {{'F::t' from module 'A' is not present in definition of 'F' in module 'B'}} -- cgit v1.2.3