[PATCH] D64477: [ASTImporter] Using Lang_CXX11 in ASTImporterVisibilityTest.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 10 05:50:06 PDT 2019


balazske created this revision.
Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp.
Herald added a reviewer: martong.
Herald added a reviewer: a.sidorin.
Herald added a project: clang.

These tests may work with language constructs in C++11 in the future.
To avoid warnings about language version C++ version constants in the tests
are updated.


Repository:
  rC Clang

https://reviews.llvm.org/D64477

Files:
  unittests/AST/ASTImporterVisibilityTest.cpp


Index: unittests/AST/ASTImporterVisibilityTest.cpp
===================================================================
--- unittests/AST/ASTImporterVisibilityTest.cpp
+++ unittests/AST/ASTImporterVisibilityTest.cpp
@@ -80,13 +80,13 @@
     std::string Code = getCode() + getCode();
     auto Pattern = getPattern();
 
-    TranslationUnitDecl *FromTu = getTuDecl(Code, Lang_CXX, "input0.cc");
+    TranslationUnitDecl *FromTu = getTuDecl(Code, Lang_CXX11, "input0.cc");
 
     auto *FromD0 = FirstDeclMatcher<DeclTy>().match(FromTu, Pattern);
     auto *FromD1 = LastDeclMatcher<DeclTy>().match(FromTu, Pattern);
 
-    auto *ToD0 = Import(FromD0, Lang_CXX);
-    auto *ToD1 = Import(FromD1, Lang_CXX);
+    auto *ToD0 = Import(FromD0, Lang_CXX11);
+    auto *ToD1 = Import(FromD1, Lang_CXX11);
 
     EXPECT_TRUE(ToD0);
     ASSERT_TRUE(ToD1);
@@ -157,13 +157,14 @@
   BindableMatcher<Decl> getPattern() const { return PatternFactory()(); }
 
   void TypedTest_ImportAfter() {
-    TranslationUnitDecl *ToTu = getToTuDecl(getCode0(), Lang_CXX);
-    TranslationUnitDecl *FromTu = getTuDecl(getCode1(), Lang_CXX, "input1.cc");
+    TranslationUnitDecl *ToTu = getToTuDecl(getCode0(), Lang_CXX11);
+    TranslationUnitDecl *FromTu =
+        getTuDecl(getCode1(), Lang_CXX11, "input1.cc");
 
     auto *ToD0 = FirstDeclMatcher<DeclTy>().match(ToTu, getPattern());
     auto *FromD1 = FirstDeclMatcher<DeclTy>().match(FromTu, getPattern());
 
-    auto *ToD1 = Import(FromD1, Lang_CXX);
+    auto *ToD1 = Import(FromD1, Lang_CXX11);
 
     ASSERT_TRUE(ToD0);
     ASSERT_TRUE(ToD1);
@@ -176,12 +177,14 @@
   }
 
   void TypedTest_ImportAfterImport() {
-    TranslationUnitDecl *FromTu0 = getTuDecl(getCode0(), Lang_CXX, "input0.cc");
-    TranslationUnitDecl *FromTu1 = getTuDecl(getCode1(), Lang_CXX, "input1.cc");
+    TranslationUnitDecl *FromTu0 =
+        getTuDecl(getCode0(), Lang_CXX11, "input0.cc");
+    TranslationUnitDecl *FromTu1 =
+        getTuDecl(getCode1(), Lang_CXX11, "input1.cc");
     auto *FromD0 = FirstDeclMatcher<DeclTy>().match(FromTu0, getPattern());
     auto *FromD1 = FirstDeclMatcher<DeclTy>().match(FromTu1, getPattern());
-    auto *ToD0 = Import(FromD0, Lang_CXX);
-    auto *ToD1 = Import(FromD1, Lang_CXX);
+    auto *ToD0 = Import(FromD0, Lang_CXX11);
+    auto *ToD1 = Import(FromD1, Lang_CXX11);
     ASSERT_TRUE(ToD0);
     ASSERT_TRUE(ToD1);
     EXPECT_NE(ToD0, ToD1);
@@ -192,13 +195,14 @@
   }
 
   void TypedTest_ImportAfterWithMerge() {
-    TranslationUnitDecl *ToTu = getToTuDecl(getCode0(), Lang_CXX);
-    TranslationUnitDecl *FromTu = getTuDecl(getCode1(), Lang_CXX, "input1.cc");
+    TranslationUnitDecl *ToTu = getToTuDecl(getCode0(), Lang_CXX11);
+    TranslationUnitDecl *FromTu =
+        getTuDecl(getCode1(), Lang_CXX11, "input1.cc");
 
     auto *ToF0 = FirstDeclMatcher<DeclTy>().match(ToTu, getPattern());
     auto *FromF1 = FirstDeclMatcher<DeclTy>().match(FromTu, getPattern());
 
-    auto *ToF1 = Import(FromF1, Lang_CXX);
+    auto *ToF1 = Import(FromF1, Lang_CXX11);
 
     ASSERT_TRUE(ToF0);
     ASSERT_TRUE(ToF1);
@@ -213,12 +217,14 @@
   }
 
   void TypedTest_ImportAfterImportWithMerge() {
-    TranslationUnitDecl *FromTu0 = getTuDecl(getCode0(), Lang_CXX, "input0.cc");
-    TranslationUnitDecl *FromTu1 = getTuDecl(getCode1(), Lang_CXX, "input1.cc");
+    TranslationUnitDecl *FromTu0 =
+        getTuDecl(getCode0(), Lang_CXX11, "input0.cc");
+    TranslationUnitDecl *FromTu1 =
+        getTuDecl(getCode1(), Lang_CXX11, "input1.cc");
     auto *FromF0 = FirstDeclMatcher<DeclTy>().match(FromTu0, getPattern());
     auto *FromF1 = FirstDeclMatcher<DeclTy>().match(FromTu1, getPattern());
-    auto *ToF0 = Import(FromF0, Lang_CXX);
-    auto *ToF1 = Import(FromF1, Lang_CXX);
+    auto *ToF0 = Import(FromF0, Lang_CXX11);
+    auto *ToF1 = Import(FromF1, Lang_CXX11);
     ASSERT_TRUE(ToF0);
     ASSERT_TRUE(ToF1);
     if (shouldBeLinked())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64477.208926.patch
Type: text/x-patch
Size: 3922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190710/5de89273/attachment.bin>


More information about the cfe-commits mailing list