[PATCH] D34417: Switch TestVisitor to Lang_C via -x c

Stephan Bergmann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 20 13:55:41 PDT 2017

sberg created this revision.

...instead of -std=c99, as the latter lead to

  error: invalid argument '-std=c99' not allowed with 'C++'

complaints in test logs



Index: unittests/Tooling/TestVisitor.h
--- unittests/Tooling/TestVisitor.h
+++ unittests/Tooling/TestVisitor.h
@@ -53,7 +53,10 @@
   bool runOver(StringRef Code, Language L = Lang_CXX) {
     std::vector<std::string> Args;
     switch (L) {
-      case Lang_C: Args.push_back("-std=c99"); break;
+      case Lang_C:
+        Args.push_back("-x");
+        Args.push_back("c");
+        break;
       case Lang_CXX98: Args.push_back("-std=c++98"); break;
       case Lang_CXX11: Args.push_back("-std=c++11"); break;
       case Lang_CXX14: Args.push_back("-std=c++14"); break;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34417.103263.patch
Type: text/x-patch
Size: 644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170620/44b16e3c/attachment.bin>

More information about the cfe-commits mailing list