MaskRay updated this revision to Diff 451377.
MaskRay added a comment.

fix some tests in a better way


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131464/new/

https://reviews.llvm.org/D131464

Files:
  clang/lib/Basic/LangStandards.cpp
  clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
  clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
  clang/test/AST/ast-dump-undeduced-expr.cpp
  clang/test/AST/sourceranges.cpp
  clang/test/Analysis/blocks.m
  clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
  clang/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp
  clang/test/CXX/class.access/class.friend/p1.cpp
  clang/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p2.cpp
  clang/test/CXX/except/except.spec/p2-dynamic-types.cpp
  clang/test/CXX/except/except.spec/p9-dynamic.cpp
  clang/test/CXX/stmt.stmt/stmt.select/p3.cpp
  clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
  clang/test/CXX/temp/temp.res/temp.local/p3.cpp
  clang/test/CodeGen/typedef_alignment_mismatch_warning.cpp
  clang/test/CodeGenCXX/align-avx-complete-objects.cpp
  clang/test/CodeGenCXX/copy-constructor-elim-2.cpp
  clang/test/CodeGenCXX/debug-info-template-parameter.cpp
  clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp
  clang/test/CodeGenCXX/exception-spec-decay.cpp
  clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
  clang/test/CodeGenCXX/exceptions-no-rtti.cpp
  clang/test/CodeGenCXX/global-init.cpp
  clang/test/CodeGenCXX/no-exceptions.cpp
  clang/test/CodeGenCXX/override-bit-field-layout.cpp
  clang/test/CodeGenCXX/override-layout.cpp
  clang/test/CodeGenCXX/reference-temporary-ms.cpp
  clang/test/CodeGenCXX/rtti-linkage.cpp
  clang/test/Layout/ms-x86-vtordisp.cpp
  clang/test/Modules/update-exception-spec.cpp
  clang/test/OpenMP/declare_mapper_messages.cpp
  clang/test/PCH/cxx-functions.cpp
  clang/test/Parser/cxx-casting.cpp
  clang/test/Parser/cxx-class.cpp
  clang/test/Parser/cxx-template-argument.cpp
  clang/test/Parser/cxx-template-decl.cpp
  clang/test/Parser/cxx1z-nested-namespace-definition.cpp
  clang/test/Sema/ms_class_layout.cpp
  clang/test/SemaCXX/MicrosoftExtensions.cpp
  clang/test/SemaCXX/PR12778.cpp
  clang/test/SemaCXX/altivec.cpp
  clang/test/SemaCXX/bool.cpp
  clang/test/SemaCXX/default2.cpp
  clang/test/SemaCXX/exception-spec-no-exceptions.cpp
  clang/test/SemaCXX/exceptions.cpp
  clang/test/SemaCXX/expressions.cpp
  clang/test/SemaCXX/inline.cpp
  clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
  clang/test/SemaCXX/linkage2.cpp
  clang/test/SemaCXX/member-pointer.cpp
  clang/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
  clang/test/SemaCXX/static-data-member.cpp
  clang/test/SemaCXX/type-definition-in-specifier.cpp
  clang/test/SemaCXX/user-defined-conversions.cpp
  clang/test/SemaCXX/warn-new-overaligned-3.cpp
  clang/test/SemaCXX/warn-new-overaligned.cpp
  clang/test/SemaCXX/writable-strings-deprecated.cpp
  clang/test/SemaSYCL/zero-length-arrays.cpp
  clang/test/SemaTemplate/class-template-id.cpp
  clang/test/SemaTemplate/constructor-template.cpp
  clang/test/SemaTemplate/explicit-instantiation.cpp
  clang/test/SemaTemplate/instantiate-exception-spec.cpp
  clang/test/SemaTemplate/instantiate-non-dependent-types.cpp
  clang/test/SemaTemplate/instantiation-default-2.cpp
  clang/test/SemaTemplate/temp_arg.cpp
  clang/test/SemaTemplate/temp_arg_template.cpp
  clang/test/SemaTemplate/typename-specifier-3.cpp
  clang/unittests/AST/ASTTraverserTest.cpp

Index: clang/unittests/AST/ASTTraverserTest.cpp
===================================================================
--- clang/unittests/AST/ASTTraverserTest.cpp
+++ clang/unittests/AST/ASTTraverserTest.cpp
@@ -280,7 +280,7 @@
 
 TEST(Traverse, IgnoreUnlessSpelledInSourceVars) {
 
-  auto AST = buildASTFromCode(R"cpp(
+  auto AST = buildASTFromCodeWithArgs(R"cpp(
 
 struct String
 {
@@ -346,7 +346,7 @@
   }
 }
 
-)cpp");
+)cpp", {"-std=c++14"});
 
   {
     auto FN =
@@ -715,7 +715,7 @@
 
 TEST(Traverse, IgnoreUnlessSpelledInSourceReturns) {
 
-  auto AST = buildASTFromCode(R"cpp(
+  auto AST = buildASTFromCodeWithArgs(R"cpp(
 
 struct A
 {
@@ -784,7 +784,7 @@
   return c;
 }
 
-)cpp");
+)cpp", {"-std=c++14"});
 
   auto getFunctionNode = [&AST](const std::string &name) {
     auto BN = ast_matchers::match(functionDecl(hasName(name)).bind("fn"),
Index: clang/test/SemaTemplate/typename-specifier-3.cpp
===================================================================
--- clang/test/SemaTemplate/typename-specifier-3.cpp
+++ clang/test/SemaTemplate/typename-specifier-3.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 
 // PR4364
 template<class T> struct a { // expected-note {{here}}
Index: clang/test/SemaTemplate/temp_arg_template.cpp
===================================================================
--- clang/test/SemaTemplate/temp_arg_template.cpp
+++ clang/test/SemaTemplate/temp_arg_template.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
 
Index: clang/test/SemaTemplate/temp_arg.cpp
===================================================================
--- clang/test/SemaTemplate/temp_arg.cpp
+++ clang/test/SemaTemplate/temp_arg.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 template<typename T, 
          int I, 
          template<typename> class TT>
Index: clang/test/SemaTemplate/instantiation-default-2.cpp
===================================================================
--- clang/test/SemaTemplate/instantiation-default-2.cpp
+++ clang/test/SemaTemplate/instantiation-default-2.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 
 template<typename T, T Value> struct Constant; // expected-note{{template parameter is declared here}} \
 // FIXME: bad location expected-error{{a non-type template parameter cannot have type 'float'}}
Index: clang/test/SemaTemplate/instantiate-non-dependent-types.cpp
===================================================================
--- clang/test/SemaTemplate/instantiate-non-dependent-types.cpp
+++ clang/test/SemaTemplate/instantiate-non-dependent-types.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
 template<typename T>
 struct X1 {
Index: clang/test/SemaTemplate/instantiate-exception-spec.cpp
===================================================================
--- clang/test/SemaTemplate/instantiate-exception-spec.cpp
+++ clang/test/SemaTemplate/instantiate-exception-spec.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -verify %s -DERRORS
-// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -emit-llvm-only %s
+// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -verify -std=c++14 %s -DERRORS
+// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -emit-llvm-only -std=c++14 %s
 
 #ifdef ERRORS
 template<typename T> void f1(T*) throw(T); // expected-error{{incomplete type 'Incomplete' is not allowed in exception specification}}
Index: clang/test/SemaTemplate/explicit-instantiation.cpp
===================================================================
--- clang/test/SemaTemplate/explicit-instantiation.cpp
+++ clang/test/SemaTemplate/explicit-instantiation.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fcxx-exceptions %s
 // RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fcxx-exceptions -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fcxx-exceptions -std=c++14 %s
 
 template void *; // expected-error{{expected unqualified-id}}
 
Index: clang/test/SemaTemplate/constructor-template.cpp
===================================================================
--- clang/test/SemaTemplate/constructor-template.cpp
+++ clang/test/SemaTemplate/constructor-template.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
 
Index: clang/test/SemaTemplate/class-template-id.cpp
===================================================================
--- clang/test/SemaTemplate/class-template-id.cpp
+++ clang/test/SemaTemplate/class-template-id.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 template<typename T, typename U = float> struct A { };
 
 typedef A<int> A_int;
Index: clang/test/SemaSYCL/zero-length-arrays.cpp
===================================================================
--- clang/test/SemaSYCL/zero-length-arrays.cpp
+++ clang/test/SemaSYCL/zero-length-arrays.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsycl-is-device -triple spir64 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsycl-is-device -triple spir64 -fsyntax-only -verify -std=c++14 %s
 //
 // This test checks if compiler reports compilation error on an attempt to use
 // a zero-length array inside device code.
Index: clang/test/SemaCXX/writable-strings-deprecated.cpp
===================================================================
--- clang/test/SemaCXX/writable-strings-deprecated.cpp
+++ clang/test/SemaCXX/writable-strings-deprecated.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -DWARNING
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s -DWARNING
 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify %s -DWARNING
 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wno-deprecated-writable-strings -verify %s
 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wno-deprecated -Wdeprecated-increment-bool -verify %s
Index: clang/test/SemaCXX/warn-new-overaligned.cpp
===================================================================
--- clang/test/SemaCXX/warn-new-overaligned.cpp
+++ clang/test/SemaCXX/warn-new-overaligned.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned -verify %s
+// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned -verify=precxx17 -std=c++14 %s
+// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned -verify=cxx17 -std=c++17 %s
 
 namespace test1 {
 struct Test {
@@ -12,8 +13,8 @@
 
 void helper() {
   Test t;
-  new Test;  // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
-  new Test[10];  // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+  new Test;  // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+  new Test[10];  // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
 }
 }
 
@@ -25,8 +26,8 @@
 
 void helper() {
   Test t;
-  new Test;  // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
-  new Test[10];  // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+  new Test;  // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+  new Test[10];  // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
 }
 }
 
@@ -38,7 +39,8 @@
   } __attribute__((aligned(256)));
 
   void* operator new(unsigned long) {
-    return 0; // expected-warning {{'operator new' should not return a null pointer unless it is declared 'throw()'}}
+    return 0; // precxx17-warning {{'operator new' should not return a null pointer unless it is declared 'throw()'}} \
+                 cxx17-warning {{'operator new' should not return a null pointer unless it is declared 'throw()' or 'noexcept'}} 
   }
 
   SeparateCacheLines<int> high_contention_data[10];
@@ -47,7 +49,7 @@
 void helper() {
   Test t;
   new Test;
-  new Test[10];  // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+  new Test[10];  // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
 }
 }
 
@@ -59,7 +61,8 @@
   } __attribute__((aligned(256)));
 
   void* operator new[](unsigned long) {
-    return 0; // expected-warning {{'operator new[]' should not return a null pointer unless it is declared 'throw()'}}
+    return 0; // precxx17-warning {{'operator new[]' should not return a null pointer unless it is declared 'throw()'}} \
+                 cxx17-warning {{'operator new[]' should not return a null pointer unless it is declared 'throw()' or 'noexcept'}} 
   }
 
   SeparateCacheLines<int> high_contention_data[10];
@@ -67,7 +70,7 @@
 
 void helper() {
   Test t;
-  new Test;  // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+  new Test;  // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
   new Test[10];
 }
 }
Index: clang/test/SemaCXX/warn-new-overaligned-3.cpp
===================================================================
--- clang/test/SemaCXX/warn-new-overaligned-3.cpp
+++ clang/test/SemaCXX/warn-new-overaligned-3.cpp
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned %s -isystem %S/Inputs -verify
+// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned %s -isystem %S/Inputs -verify=precxx17 -std=c++14
+// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned %s -isystem %S/Inputs -verify -std=c++17
+
+// expected-no-diagnostics
 
 // This test ensures that we still get the warning even if we #include <new>
 // where the header here simulates <new>.
@@ -16,8 +19,8 @@
 
 void helper() {
   Test t;
-  new Test;  // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
-  new Test[10];  // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+  new Test;  // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+  new Test[10];  // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
 }
 }
 
Index: clang/test/SemaCXX/user-defined-conversions.cpp
===================================================================
--- clang/test/SemaCXX/user-defined-conversions.cpp
+++ clang/test/SemaCXX/user-defined-conversions.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s 
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,precxx17 -std=c++14 %s
+// RUN: %clang_cc1 -fsyntax-only -verify=expected -std=c++17 %s
 struct X {
   operator bool();
 };
@@ -69,7 +70,7 @@
 }
 
 struct X1 {
-  X1(X1&); // expected-note{{candidate constructor not viable: expects an lvalue for 1st argument}}
+  X1(X1&); // precxx17-note{{candidate constructor not viable: expects an lvalue for 1st argument}}
 };
 
 struct X2 {
@@ -80,7 +81,7 @@
 float &f(...);
 
 void g(X2 b) {
-  int &ir = f(b); // expected-error{{no viable constructor copying parameter of type 'X1'}}
+  int &ir = f(b); // precxx17-error{{no viable constructor copying parameter of type 'X1'}}
 }
 
 namespace rdar10202900 {
Index: clang/test/SemaCXX/type-definition-in-specifier.cpp
===================================================================
--- clang/test/SemaCXX/type-definition-in-specifier.cpp
+++ clang/test/SemaCXX/type-definition-in-specifier.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -verify -std=c++14 %s
 
 struct S0;
 struct S1;
Index: clang/test/SemaCXX/static-data-member.cpp
===================================================================
--- clang/test/SemaCXX/static-data-member.cpp
+++ clang/test/SemaCXX/static-data-member.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -w %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -w %s
 
 struct ABC {
   static double a;
Index: clang/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
===================================================================
--- clang/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
+++ clang/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
@@ -62,6 +62,7 @@
   nylinkedlist w; // expected-error{{unknown type name 'nylinkedlist'; did you mean 'realstd::mylinkedlist'?}}
 }
 
+#if __cplusplus < 201703L
 // Test case from http://llvm.org/bugs/show_bug.cgi?id=10318
 namespace llvm {
  template <typename T> class GraphWriter {}; // expected-note 3{{declared here}}
@@ -73,6 +74,7 @@
  (void)new llvm::GraphWriter; // expected-error {{use of class template 'llvm::GraphWriter' requires template arguments}}
  (void)new llvm::Graphwriter<S>; // expected-error {{no template named 'Graphwriter' in namespace 'llvm'; did you mean 'GraphWriter'?}}
 }
+#endif
 
 // If namespace prefixes and character edits have the same weight, correcting
 // "fimish" to "N::famish" would have the same edit distance as correcting
Index: clang/test/SemaCXX/member-pointer.cpp
===================================================================
--- clang/test/SemaCXX/member-pointer.cpp
+++ clang/test/SemaCXX/member-pointer.cpp
@@ -1,6 +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
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 
 struct A {};
 enum B { Dummy };
@@ -14,7 +14,10 @@
 int A::*pdi1;
 int (::A::*pdi2);
 int (A::*pfi)(int);
-void (*A::*ppfie)() throw(); // expected-error {{exception specifications are not allowed beyond a single level of indirection}}
+void (*A::*ppfie)() throw();
+#if __cplusplus < 201703L
+// expected-error@-2 {{exception specifications are not allowed beyond a single level of indirection}}
+#endif
 
 int B::*pbi;
 #if __cplusplus <= 199711L // C++03 or earlier modes
Index: clang/test/SemaCXX/linkage2.cpp
===================================================================
--- clang/test/SemaCXX/linkage2.cpp
+++ clang/test/SemaCXX/linkage2.cpp
@@ -173,7 +173,10 @@
     };
   }
   template <typename T1, typename T2> void foo() {}
-  template <typename T, T x> void bar() {} // expected-note {{candidate function}}
+  template <typename T, T x> void bar() {}
+#if __cplusplus < 201703L
+  // expected-note@-2 {{candidate function}}
+#endif
   inline void *g() {
     struct L {
     };
@@ -181,7 +184,10 @@
     // InternalLinkage in c++11) and VisibleNoLinkage. The correct answer is
     // NoLinkage in both cases. This means that using foo<L, I> as a template
     // argument should fail.
-    return reinterpret_cast<void*>(bar<typeof(foo<L, I>), foo<L, I> >); // expected-error {{reinterpret_cast cannot resolve overloaded function 'bar' to type 'void *}}
+    return reinterpret_cast<void*>(bar<typeof(foo<L, I>), foo<L, I> >);
+#if __cplusplus < 201703L
+    // expected-error@-2 {{reinterpret_cast cannot resolve overloaded function 'bar' to type 'void *}}
+#endif
   }
   void h() {
     g();
Index: clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
===================================================================
--- clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
+++ clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 
 // This is a test for an egregious hack in Clang that works around
 // issues with GCC's evolution. libstdc++ 4.2.x uses __is_pod as an
Index: clang/test/SemaCXX/inline.cpp
===================================================================
--- clang/test/SemaCXX/inline.cpp
+++ clang/test/SemaCXX/inline.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s -Wpre-c++17-compat
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx17-compat -std=c++17 %s -Wpre-c++17-compat
 
 // Check that we don't allow illegal uses of inline
 // (checking C++-only constructs here)
@@ -14,5 +14,5 @@
 #if __cplusplus <= 201402L
 inline int a; // expected-warning{{inline variables are a C++17 extension}}
 #else
-inline int a; // expected-warning{{inline variables are incompatible with C++ standards before C++17}}
+inline int a; // cxx17-compat-warning{{inline variables are incompatible with C++ standards before C++17}}
 #endif
Index: clang/test/SemaCXX/expressions.cpp
===================================================================
--- clang/test/SemaCXX/expressions.cpp
+++ clang/test/SemaCXX/expressions.cpp
@@ -10,6 +10,7 @@
   int i = choice(!1);
 }
 
+#if __cplusplus < 201703L
 // rdar://8018252
 void f0() {
   extern void f0_1(int*);
@@ -19,6 +20,7 @@
 #endif
   f0_1(&x);
 }
+#endif
 
 namespace test1 {
   template <class T> void bar(T &x) { T::fail(); }
Index: clang/test/SemaCXX/exceptions.cpp
===================================================================
--- clang/test/SemaCXX/exceptions.cpp
+++ clang/test/SemaCXX/exceptions.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++98 %s
-// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify=expected,precxx17 -std=c++98 %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify=expected,precxx17 -std=c++14 %s
 
 struct A; // expected-note 4 {{forward declaration of 'A'}}
 
@@ -128,6 +128,7 @@
   }
 }
 
+#if __cplusplus < 201703L
 namespace Decay {
   struct A {
     void f() throw (A[10]);
@@ -165,6 +166,7 @@
 #if __cplusplus <= 199711L
 // expected-warning@-2 {{rvalue references are a C++11 extension}}
 #endif
+#endif
 
 namespace HandlerInversion {
 struct B {};
@@ -244,14 +246,14 @@
 
 namespace ConstVolatileThrow {
 struct S {
-  S() {}         // expected-note{{candidate constructor not viable}}
-  S(const S &s); // expected-note{{candidate constructor not viable}}
+  S() {}         // precxx17-note{{candidate constructor not viable}}
+  S(const S &s); // precxx17-note{{candidate constructor not viable}}
 };
 
 typedef const volatile S CVS;
 
 void f() {
-  throw CVS(); // expected-error{{no matching constructor for initialization}}
+  throw CVS(); // precxx17-error{{no matching constructor for initialization}}
 }
 }
 
Index: clang/test/SemaCXX/exception-spec-no-exceptions.cpp
===================================================================
--- clang/test/SemaCXX/exception-spec-no-exceptions.cpp
+++ clang/test/SemaCXX/exception-spec-no-exceptions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fobjc-exceptions %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -fexceptions -fobjc-exceptions %s
 // expected-no-diagnostics
 
 // Note that we're specifically excluding -fcxx-exceptions in the command line above.
Index: clang/test/SemaCXX/default2.cpp
===================================================================
--- clang/test/SemaCXX/default2.cpp
+++ clang/test/SemaCXX/default2.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 
 void f(int i, int j, int k = 3);
 void f(int i, int j, int k);
Index: clang/test/SemaCXX/bool.cpp
===================================================================
--- clang/test/SemaCXX/bool.cpp
+++ clang/test/SemaCXX/bool.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion %s
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion \
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -Wno-constant-conversion %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -Wno-constant-conversion \
 // RUN:     -Wno-deprecated -Wdeprecated-increment-bool %s
 
 // Bool literals can be enum values.
Index: clang/test/SemaCXX/altivec.cpp
===================================================================
--- clang/test/SemaCXX/altivec.cpp
+++ clang/test/SemaCXX/altivec.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -target-feature +altivec -flax-vector-conversions=none -triple powerpc-unknown-unknown -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -target-feature +altivec -flax-vector-conversions=none -triple powerpc-unknown-unknown -fcxx-exceptions -verify -std=c++14 %s
 
 typedef int V4i __attribute__((vector_size(16)));
 
Index: clang/test/SemaCXX/PR12778.cpp
===================================================================
--- clang/test/SemaCXX/PR12778.cpp
+++ clang/test/SemaCXX/PR12778.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 
 void operator delete() throw(void*); // expected-error{{'operator delete' must have at least one parameter}}
 void* allocate(int __n) {
Index: clang/test/SemaCXX/MicrosoftExtensions.cpp
===================================================================
--- clang/test/SemaCXX/MicrosoftExtensions.cpp
+++ clang/test/SemaCXX/MicrosoftExtensions.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify -fms-extensions -fexceptions -fcxx-exceptions -DTEST1
+// RUN: %clang_cc1 -std=c++14 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify -fms-extensions -fexceptions -fcxx-exceptions -DTEST1
 // RUN: %clang_cc1 -std=c++98 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify -fms-extensions -fexceptions -fcxx-exceptions -DTEST1
 // RUN: %clang_cc1 -std=c++11 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify -fms-extensions -fexceptions -fcxx-exceptions -DTEST1
-// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify -fexceptions -fcxx-exceptions -DTEST2
+// RUN: %clang_cc1 -std=c++14 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify -fexceptions -fcxx-exceptions -DTEST2
 // RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++11 -fms-compatibility -verify -DTEST3
 
 #if TEST1
Index: clang/test/Sema/ms_class_layout.cpp
===================================================================
--- clang/test/Sema/ms_class_layout.cpp
+++ clang/test/Sema/ms_class_layout.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts %s 2>/dev/null \
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts %s 2>/dev/null \
 // RUN:            | FileCheck %s --strict-whitespace
 
 #pragma pack(push, 8)
Index: clang/test/Parser/cxx1z-nested-namespace-definition.cpp
===================================================================
--- clang/test/Parser/cxx1z-nested-namespace-definition.cpp
+++ clang/test/Parser/cxx1z-nested-namespace-definition.cpp
@@ -1,7 +1,7 @@
 // RUN: cp %s %t
 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98
-// RUN: not %clang_cc1 -x c++ -fixit %t -Werror -DFIXIT
-// RUN: %clang_cc1 -x c++ %t -DFIXIT
+// RUN: not %clang_cc1 -x c++ -std=c++14 -fixit %t -Werror -DFIXIT
+// RUN: %clang_cc1 -x c++ -std=c++14 %t -DFIXIT
 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17 -Wc++14-compat
 
 namespace foo1::foo2::foo3 {
Index: clang/test/Parser/cxx-template-decl.cpp
===================================================================
--- clang/test/Parser/cxx-template-decl.cpp
+++ clang/test/Parser/cxx-template-decl.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp14 %s
-// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp14 %s -fdelayed-template-parsing -DDELAYED_TEMPLATE_PARSING
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp14 -std=gnu++14 %s
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp14 -std=gnu++14 %s -fdelayed-template-parsing -DDELAYED_TEMPLATE_PARSING
 // RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp17 -std=gnu++1z %s
 
 
Index: clang/test/Parser/cxx-template-argument.cpp
===================================================================
--- clang/test/Parser/cxx-template-argument.cpp
+++ clang/test/Parser/cxx-template-argument.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -fsyntax-only -verify %s -fdelayed-template-parsing
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s -fdelayed-template-parsing
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s -fdelayed-template-parsing
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -fdelayed-template-parsing
 
Index: clang/test/Parser/cxx-class.cpp
===================================================================
--- clang/test/Parser/cxx-class.cpp
+++ clang/test/Parser/cxx-class.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -fcxx-exceptions %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -pedantic -fcxx-exceptions %s
 // RUN: %clang_cc1 -fsyntax-only -verify -pedantic -fcxx-exceptions -std=c++98 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -pedantic -fcxx-exceptions -std=c++11 %s
 
Index: clang/test/Parser/cxx-casting.cpp
===================================================================
--- clang/test/Parser/cxx-casting.cpp
+++ clang/test/Parser/cxx-casting.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
 
Index: clang/test/PCH/cxx-functions.cpp
===================================================================
--- clang/test/PCH/cxx-functions.cpp
+++ clang/test/PCH/cxx-functions.cpp
@@ -1,8 +1,8 @@
 // Test this without pch.
-// RUN: %clang_cc1 -include %S/cxx-functions.h -fsyntax-only -verify %s
+// RUN: %clang_cc1 -include %S/cxx-functions.h -fsyntax-only -verify -std=c++14 %s
 
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-functions.h
-// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c++-header -std=c++14 -emit-pch -o %t %S/cxx-functions.h
+// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify -std=c++14 %s
 
 // expected-no-diagnostics
 
Index: clang/test/OpenMP/declare_mapper_messages.cpp
===================================================================
--- clang/test/OpenMP/declare_mapper_messages.cpp
+++ clang/test/OpenMP/declare_mapper_messages.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -std=c++14 -verify -fopenmp -ferror-limit 100 %s
 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 %s
 
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -std=c++14 -verify -fopenmp-simd -ferror-limit 100 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 %s
 
Index: clang/test/Modules/update-exception-spec.cpp
===================================================================
--- clang/test/Modules/update-exception-spec.cpp
+++ clang/test/Modules/update-exception-spec.cpp
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/update-exception-spec -emit-llvm-only %s
+// RUN: %clang_cc1 -std=c++14 -fexceptions -fcxx-exceptions -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/update-exception-spec -emit-llvm-only %s
 #include "a.h"
 void use(B *p);
 #include "c.h"
Index: clang/test/Layout/ms-x86-vtordisp.cpp
===================================================================
--- clang/test/Layout/ms-x86-vtordisp.cpp
+++ clang/test/Layout/ms-x86-vtordisp.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -fms-extensions -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
+// RUN: %clang_cc1 -std=c++14 -fno-rtti -fms-extensions -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -fms-extensions -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
+// RUN: %clang_cc1 -std=c++14 -fno-rtti -fms-extensions -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
Index: clang/test/CodeGenCXX/rtti-linkage.cpp
===================================================================
--- clang/test/CodeGenCXX/rtti-linkage.cpp
+++ clang/test/CodeGenCXX/rtti-linkage.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -no-opaque-pointers %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-BOTH
-// RUN: %clang_cc1 -no-opaque-pointers %s -I%S -triple=x86_64-apple-darwin10 -fvisibility hidden -emit-llvm -o - | FileCheck -check-prefix=CHECK-WITH-HIDDEN -check-prefix=CHECK-BOTH %s
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-BOTH
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers %s -I%S -triple=x86_64-apple-darwin10 -fvisibility hidden -emit-llvm -o - | FileCheck -check-prefix=CHECK-WITH-HIDDEN -check-prefix=CHECK-BOTH %s
 
 #include <typeinfo>
 
Index: clang/test/CodeGenCXX/reference-temporary-ms.cpp
===================================================================
--- clang/test/CodeGenCXX/reference-temporary-ms.cpp
+++ clang/test/CodeGenCXX/reference-temporary-ms.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm %s -o - -triple=i386-pc-win32 -fms-extensions | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers -emit-llvm %s -o - -triple=i386-pc-win32 -fms-extensions | FileCheck %s
 
 const int __declspec(dllexport) &Exported = 42;
 
Index: clang/test/CodeGenCXX/override-layout.cpp
===================================================================
--- clang/test/CodeGenCXX/override-layout.cpp
+++ clang/test/CodeGenCXX/override-layout.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -w -fdump-record-layouts-simple %s > %t.layouts
-// RUN: %clang_cc1 -w -fdump-record-layouts-simple %s > %t.before
-// RUN: %clang_cc1 -w -DPACKED= -DALIGNED16= -fdump-record-layouts-simple -foverride-record-layout=%t.layouts %s > %t.after
+// RUN: %clang_cc1 -std=c++14 -w -fdump-record-layouts-simple %s > %t.layouts
+// RUN: %clang_cc1 -std=c++14 -w -fdump-record-layouts-simple %s > %t.before
+// RUN: %clang_cc1 -std=c++14 -w -DPACKED= -DALIGNED16= -fdump-record-layouts-simple -foverride-record-layout=%t.layouts %s > %t.after
 // RUN: diff -u %t.before %t.after
 // RUN: FileCheck %s < %t.after
 
Index: clang/test/CodeGenCXX/override-bit-field-layout.cpp
===================================================================
--- clang/test/CodeGenCXX/override-bit-field-layout.cpp
+++ clang/test/CodeGenCXX/override-bit-field-layout.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -w -triple=x86_64-pc-win32 -fms-compatibility -fdump-record-layouts-simple -foverride-record-layout=%S/Inputs/override-bit-field-layout.layout %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -w -triple=x86_64-pc-win32 -fms-compatibility -fdump-record-layouts-simple -foverride-record-layout=%S/Inputs/override-bit-field-layout.layout %s | FileCheck %s
 
 // CHECK: Type: struct S1
 // CHECK:   FieldOffsets: [0, 11]
Index: clang/test/CodeGenCXX/no-exceptions.cpp
===================================================================
--- clang/test/CodeGenCXX/no-exceptions.cpp
+++ clang/test/CodeGenCXX/no-exceptions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
 
 void g();
 
Index: clang/test/CodeGenCXX/global-init.cpp
===================================================================
--- clang/test/CodeGenCXX/global-init.cpp
+++ clang/test/CodeGenCXX/global-init.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -no-opaque-pointers -triple=x86_64-apple-darwin10 -emit-llvm -fexceptions %s -o - |FileCheck %s
-// RUN: %clang_cc1 -no-opaque-pointers -triple=x86_64-apple-darwin10 -emit-llvm %s -o - |FileCheck -check-prefix CHECK-NOEXC %s
-// RUN: %clang_cc1 -no-opaque-pointers -triple=x86_64-apple-darwin10 -emit-llvm -mframe-pointer=non-leaf %s -o - \
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers -triple=x86_64-apple-darwin10 -emit-llvm -fexceptions %s -o - |FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers -triple=x86_64-apple-darwin10 -emit-llvm %s -o - |FileCheck -check-prefix CHECK-NOEXC %s
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers -triple=x86_64-apple-darwin10 -emit-llvm -mframe-pointer=non-leaf %s -o - \
 // RUN:   | FileCheck -check-prefix CHECK-FP %s
-// RUN: %clang_cc1 -no-opaque-pointers -triple=x86_64-apple-darwin10 -emit-llvm %s -o - -fno-builtin \
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers -triple=x86_64-apple-darwin10 -emit-llvm %s -o - -fno-builtin \
 // RUN:   | FileCheck -check-prefix CHECK-NOBUILTIN %s
 
 struct A {
Index: clang/test/CodeGenCXX/exceptions-no-rtti.cpp
===================================================================
--- clang/test/CodeGenCXX/exceptions-no-rtti.cpp
+++ clang/test/CodeGenCXX/exceptions-no-rtti.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fno-rtti -fcxx-exceptions -fexceptions %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -fno-rtti -fcxx-exceptions -fexceptions %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
 
 // CHECK: @_ZTIN5test11AE = linkonce_odr constant
 // CHECK: @_ZTIN5test11BE = linkonce_odr constant
Index: clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
===================================================================
--- clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
+++ clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -fexceptions -fcxx-exceptions -fexternc-nounwind | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -emit-llvm %s -o - -triple=i386-pc-win32 -fexceptions -fcxx-exceptions -fexternc-nounwind | FileCheck %s
 
 namespace test1 {
 struct Cleanup { ~Cleanup(); };
Index: clang/test/CodeGenCXX/exception-spec-decay.cpp
===================================================================
--- clang/test/CodeGenCXX/exception-spec-decay.cpp
+++ clang/test/CodeGenCXX/exception-spec-decay.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fcxx-exceptions -fexceptions %s -triple=i686-unknown-linux -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -fcxx-exceptions -fexceptions %s -triple=i686-unknown-linux -emit-llvm -o - | FileCheck %s
 typedef int Array[10];
 
 void foo() throw (Array) {
Index: clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp
===================================================================
--- clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp
+++ clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - -debug-info-kind=standalone | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -emit-llvm -triple %itanium_abi_triple %s -o - -debug-info-kind=standalone | FileCheck %s
 namespace __pointer_type_imp
 {
   template <class _Tp, class _Dp, bool > struct __pointer_type1 {};
Index: clang/test/CodeGenCXX/debug-info-template-parameter.cpp
===================================================================
--- clang/test/CodeGenCXX/debug-info-template-parameter.cpp
+++ clang/test/CodeGenCXX/debug-info-template-parameter.cpp
@@ -1,7 +1,7 @@
 // Test for DebugInfo for Defaulted parameters for C++ templates
 // Supported: -O0, standalone DI
 
-// RUN: %clang_cc1 -dwarf-version=5  -emit-llvm -triple x86_64-linux-gnu %s -o - \
+// RUN: %clang_cc1 -std=c++14 -dwarf-version=5  -emit-llvm -triple x86_64-linux-gnu %s -o - \
 // RUN:   -O0 -disable-llvm-passes \
 // RUN:   -debug-info-kind=standalone \
 // RUN: | FileCheck %s
Index: clang/test/CodeGenCXX/copy-constructor-elim-2.cpp
===================================================================
--- clang/test/CodeGenCXX/copy-constructor-elim-2.cpp
+++ clang/test/CodeGenCXX/copy-constructor-elim-2.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple armv7-none-eabi -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers -no-enable-noundef-analysis -triple armv7-none-eabi -emit-llvm -o - %s | FileCheck %s
 
 struct A { int x; A(int); ~A(); };
 A f() { return A(0); }
Index: clang/test/CodeGenCXX/align-avx-complete-objects.cpp
===================================================================
--- clang/test/CodeGenCXX/align-avx-complete-objects.cpp
+++ clang/test/CodeGenCXX/align-avx-complete-objects.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-opaque-pointers -x c++ %s -O0 -triple=x86_64-apple-darwin -target-feature +avx2 -fmax-type-align=16 -emit-llvm -o - -Werror | FileCheck %s
+// RUN: %clang_cc1 -no-opaque-pointers -std=c++14 %s -O0 -triple=x86_64-apple-darwin -target-feature +avx2 -fmax-type-align=16 -emit-llvm -o - -Werror | FileCheck %s
 // rdar://16254558
 
 typedef float AVX2Float __attribute__((__vector_size__(32)));
Index: clang/test/CodeGen/typedef_alignment_mismatch_warning.cpp
===================================================================
--- clang/test/CodeGen/typedef_alignment_mismatch_warning.cpp
+++ clang/test/CodeGen/typedef_alignment_mismatch_warning.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -fdata-sections -fcolor-diagnostics
+// RUN: %clang_cc1 %s -fsyntax-only -verify=expected,precxx17 -std=c++14 -fdata-sections -fcolor-diagnostics
+// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++17 -fdata-sections -fcolor-diagnostics
 
 // Warn for any function that
 //   * takes a pointer or a reference to an object (including "this" pointer),
@@ -214,10 +215,10 @@
   TypedefAligned4 TA8b(11);            // expected-warning {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'StructAligned8' may result in an unaligned pointer access}}
   TypedefAligned4 TA8c = TA8a + TA8b;  // expected-warning {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'operator+' may result in an unaligned pointer access}}
                                        // expected-warning@-1 {{passing 4-byte aligned argument to 8-byte aligned parameter 1 of 'operator+' may result in an unaligned pointer access}}
-                                       // expected-warning@-2 {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'StructAligned8' may result in an unaligned pointer access}}
+                                       // precxx17-warning@-2 {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'StructAligned8' may result in an unaligned pointer access}}
   TypedefAligned4 TA8d = TA8a - &TA8b; // expected-warning {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'operator-' may result in an unaligned pointer access}}
                                        // expected-warning@-1 {{passing 4-byte aligned argument to 8-byte aligned parameter 1 of 'operator-' may result in an unaligned pointer access}}
-                                       // expected-warning@-2 {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'StructAligned8' may result in an unaligned pointer access}}
+                                       // precxx17-warning@-2 {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'StructAligned8' may result in an unaligned pointer access}}
   ++TA8d;                              // expected-warning {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'operator++' may result in an unaligned pointer access}}
   --TA8c;                              // expected-warning {{passing 4-byte aligned argument to 8-byte aligned parameter 'this' of 'operator--' may result in an unaligned pointer access}}
   UsingAligned4 UA8a(11);
Index: clang/test/CXX/temp/temp.res/temp.local/p3.cpp
===================================================================
--- clang/test/CXX/temp/temp.res/temp.local/p3.cpp
+++ clang/test/CXX/temp/temp.res/temp.local/p3.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -verify %s
+// RUN: %clang_cc1 -verify=expected,precxx17 -std=c++14 %s
+// RUN: %clang_cc1 -verify=expected,cxx17 -std=c++17 %s
 
 template <class T> struct Base {
   // expected-note@-1 2{{member type 'Base<int>' found by ambiguous name lookup}}
@@ -26,7 +27,9 @@
   } // expected-error {{expected ';' after class}}
 
     WebVector(const WebVector<T>& other) { } // expected-error{{undeclared identifier 'T'}} \
-                                                expected-error{{a type specifier is required}}
+                                                precxx17-error{{a type specifier is required}} \
+                                                cxx17-error{{deduction guide declaration without trailing return type}} \
+                                                cxx17-error{{deduction guide cannot have a function definition}}
 
   template <typename C>
   WebVector<T>& operator=(const C& other) { } // expected-error{{undeclared identifier 'T'}}
Index: clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
===================================================================
--- clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
+++ clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -triple=x86_64-linux-gnu %s
 // RUN: %clang_cc1 -fsyntax-only -verify -triple=x86_64-linux-gnu -std=c++98 %s
 // RUN: %clang_cc1 -fsyntax-only -verify -triple=x86_64-linux-gnu -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -triple=x86_64-linux-gnu -std=c++14 %s
 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -triple=x86_64-linux-gnu %s -DCPP11ONLY
 
 // C++11 [temp.arg.nontype]p1:
Index: clang/test/CXX/stmt.stmt/stmt.select/p3.cpp
===================================================================
--- clang/test/CXX/stmt.stmt/stmt.select/p3.cpp
+++ clang/test/CXX/stmt.stmt/stmt.select/p3.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++14 %s
 // RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -std=c++1z -Wc++14-compat -verify %s -DCPP17
 
 int f();
Index: clang/test/CXX/except/except.spec/p9-dynamic.cpp
===================================================================
--- clang/test/CXX/except/except.spec/p9-dynamic.cpp
+++ clang/test/CXX/except/except.spec/p9-dynamic.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-opaque-pointers %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s --check-prefixes=CHECK,CHECK-PRE17
+// RUN: %clang_cc1 -std=c++14 -no-opaque-pointers %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s --check-prefixes=CHECK,CHECK-PRE17
 // RUN: %clang_cc1 -no-opaque-pointers %s -triple=x86_64-apple-darwin10 -std=c++17 -Wno-dynamic-exception-spec -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s --check-prefixes=CHECK,CHECK-17
 
 void external();
Index: clang/test/CXX/except/except.spec/p2-dynamic-types.cpp
===================================================================
--- clang/test/CXX/except/except.spec/p2-dynamic-types.cpp
+++ clang/test/CXX/except/except.spec/p2-dynamic-types.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fsyntax-only -verify -std=c++14 %s
 
 // Dynamic specifications: valid types.
 
Index: clang/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p2.cpp
===================================================================
--- clang/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p2.cpp
+++ clang/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p2.cpp
@@ -16,8 +16,10 @@
 #endif
 
 register int ro; // expected-error {{illegal storage class on file-scoped variable}}
-#if __cplusplus >= 201103L // C++11 or later
-// expected-warning@-2 {{'register' storage class specifier is deprecated}}
+#if __cplusplus >= 201703L
+// expected-error@-2 {{ISO C++17 does not allow 'register' storage class specifier}}
+#elif __cplusplus >= 201103L
+// expected-warning@-4 {{'register' storage class specifier is deprecated}}
 #endif
 
 register void rf(); // expected-error {{illegal storage class on function}}
@@ -37,9 +39,12 @@
 };
 
 void foo(auto int ap, register int rp) {
-#if __cplusplus >= 201103L // C++11 or later
+#if __cplusplus >= 201703L
 // expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
-// expected-warning@-3 {{'register' storage class specifier is deprecated}}
+// expected-error@-3 {{ISO C++17 does not allow 'register' storage class specifier}}
+#elif __cplusplus >= 201103L
+// expected-warning@-5 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
+// expected-warning@-6 {{'register' storage class specifier is deprecated}}
 #endif
   auto int abo;
 #if __cplusplus >= 201103L // C++11 or later
@@ -51,8 +56,10 @@
 #endif
 
   register int rbo;
-#if __cplusplus >= 201103L // C++11 or later
-// expected-warning@-2 {{'register' storage class specifier is deprecated}}
+#if __cplusplus >= 201703L
+// expected-error@-2 {{ISO C++17 does not allow 'register' storage class specifier}}
+#elif __cplusplus >= 201103L
+// expected-warning@-4 {{'register' storage class specifier is deprecated}}
 #endif
 
   register void rbf(); // expected-error {{illegal storage class on function}}
Index: clang/test/CXX/class.access/class.friend/p1.cpp
===================================================================
--- clang/test/CXX/class.access/class.friend/p1.cpp
+++ clang/test/CXX/class.access/class.friend/p1.cpp
@@ -221,13 +221,21 @@
 #if __cplusplus >= 201103L
       constexpr
 #endif
-      A::A();
+      A::A()
+#if __cplusplus >= 201703L
+      noexcept
+#endif
+      ;
     friend A::~A();
     friend
 #if __cplusplus >= 201402L
       constexpr
 #endif
-      A &A::operator=(const A&);
+      A &A::operator=(const A&)
+#if __cplusplus >= 201703L
+      noexcept
+#endif
+      ;
   };
 }
 
@@ -246,7 +254,11 @@
 #if __cplusplus >= 201103L
       constexpr
 #endif
-      X<int>::X(const X&);
+      X<int>::X(const X&)
+#if __cplusplus >= 201703L
+      noexcept
+#endif
+      ;
 
   private:
     A(); // expected-note 2 {{declared private here}}
Index: clang/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp
===================================================================
--- clang/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp
+++ clang/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp
@@ -21,11 +21,16 @@
   typedef __SIZE_TYPE__ size_t;
 }
 
+#if __cplusplus < 201703L
 void* operator new(std::size_t) throw(std::bad_alloc);
 #if __cplusplus < 201103L
 // expected-note@-2 {{previous declaration}}
 #endif
+#endif
+
+#if __cplusplus < 201703L
 void* operator new[](std::size_t) throw(std::bad_alloc); 
+#endif
 void operator delete(void*) throw(); // expected-note{{previous declaration}}
 void operator delete[](void*) throw();
 
Index: clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
===================================================================
--- clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
+++ clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
@@ -1,5 +1,5 @@
 // FIXME: Figure out how to use %clang_analyze_cc1 with our lit.local.cfg.
-// RUN: %clang_cc1 -analyze -triple x86_64-unknown-linux-gnu \
+// RUN: %clang_cc1 -std=c++14 -analyze -triple x86_64-unknown-linux-gnu \
 // RUN:                     -analyze-function "test()" \
 // RUN:                     -analyzer-checker=core \
 // RUN:                     -analyzer-dump-egraph=%t.dot %s
Index: clang/test/Analysis/blocks.m
===================================================================
--- clang/test/Analysis/blocks.m
+++ clang/test/Analysis/blocks.m
@@ -1,5 +1,5 @@
 // RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -fblocks -verify -Wno-strict-prototypes %s
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -fblocks -verify -x objective-c++ %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -fblocks -verify -x objective-c++ -std=c++14 %s
 
 //===----------------------------------------------------------------------===//
 // The following code is reduced using delta-debugging from Mac OS X headers:
Index: clang/test/AST/sourceranges.cpp
===================================================================
--- clang/test/AST/sourceranges.cpp
+++ clang/test/AST/sourceranges.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-mingw32 -ast-dump %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -triple i686-mingw32 -ast-dump %s | FileCheck %s
 // RUN: %clang_cc1 -triple i686-mingw32 -std=c++1z -ast-dump %s | FileCheck %s -check-prefix=CHECK-1Z
 
 template<class T>
Index: clang/test/AST/ast-dump-undeduced-expr.cpp
===================================================================
--- clang/test/AST/ast-dump-undeduced-expr.cpp
+++ clang/test/AST/ast-dump-undeduced-expr.cpp
@@ -1,4 +1,4 @@
-// RUN: not %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s | FileCheck %s
+// RUN: not %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -ast-dump %s | FileCheck %s
 
 struct Foo {
   static constexpr auto Bar = ;
Index: clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
===================================================================
--- clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
+++ clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -x c++| FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -std=c++14| FileCheck %s
 // expected-no-diagnostics
 // PR47655
 
Index: clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
===================================================================
--- clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
+++ clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify=c_mode   -ast-dump %s       | FileCheck %s --check-prefix=C
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify=cxx_mode -ast-dump %s -x c++| FileCheck %s --check-prefix=CXX
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify=cxx_mode -ast-dump %s -x c++ -std=c++14 | FileCheck %s --check-prefix=CXX
 
 // c_mode-no-diagnostics
 
Index: clang/lib/Basic/LangStandards.cpp
===================================================================
--- clang/lib/Basic/LangStandards.cpp
+++ clang/lib/Basic/LangStandards.cpp
@@ -78,7 +78,7 @@
     if (T.isDriverKit())
       return LangStandard::lang_gnucxx17;
     else
-      return LangStandard::lang_gnucxx14;
+      return LangStandard::lang_gnucxx17;
   case Language::RenderScript:
     return LangStandard::lang_c99;
   case Language::HIP:
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to