[PATCH] D60539: Add -std=c++14 language standard option to tests that require C++14 default

Amy Kwan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 14:19:58 PDT 2019


amyk created this revision.
amyk added reviewers: ilya-biryukov, sammccall, ioeric, hokein, akyrtzi, yvvan.
amyk added projects: clang, LLVM.
Herald added subscribers: kadircet, arphaman, dexonsmith, jkorous.

On one of the platforms that we build on, we build with the CMake macro, `CLANG_DEFAULT_STD_CXX` to set the default language level when building Clang and LLVM.

In our case, we set the default to be `gnucxx11`. However, doing so will cause the test cases in this patch to fail as they rely on the C++14 default.

This patch explicitly adds the `-std=c++14` to the affected test cases so they will work when the default language level is set.

I have added individuals who have worked with these test cases in the past as reviewers. I would greatly appreciate it if any of you can inform me on whether or not this change is acceptable.


https://reviews.llvm.org/D60539

Files:
  clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp
  clang/test/Index/print-type-size.cpp


Index: clang/test/Index/print-type-size.cpp
===================================================================
--- clang/test/Index/print-type-size.cpp
+++ clang/test/Index/print-type-size.cpp
@@ -1,6 +1,6 @@
 // from SemaCXX/class-layout.cpp
-// RUN: c-index-test -test-print-type-size %s -target x86_64-pc-linux-gnu | FileCheck -check-prefix=CHECK64 %s
-// RUN: c-index-test -test-print-type-size %s -target i386-apple-darwin9 | FileCheck -check-prefix=CHECK32 %s
+// RUN: c-index-test -test-print-type-size %s -target x86_64-pc-linux-gnu -std=c++14 | FileCheck -check-prefix=CHECK64 %s
+// RUN: c-index-test -test-print-type-size %s -target i386-apple-darwin9 -std=c++14 | FileCheck -check-prefix=CHECK32 %s
 
 namespace basic {
 
Index: clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp
===================================================================
--- clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp
+++ clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp
@@ -109,6 +109,7 @@
     File.Filename = FileName;
     File.HeaderCode = HeaderCode;
     File.Code = Code;
+    File.ExtraArgs.push_back("-std=c++14");
     AST = File.build();
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60539.194586.patch
Type: text/x-patch
Size: 1184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190410/afafbc83/attachment.bin>


More information about the cfe-commits mailing list