summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2019-02-05 12:05:53 +0000
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2019-02-05 12:05:53 +0000
commitd9551967f776ea7f69377909e1936db89baea0e3 (patch)
tree91a728abf74e1b3148773ea1771897df813da2da
parent40d23d1cdda4637cd6f44832762cf22d2619eb36 (diff)
[NFC] Explicitly add -std=c++14 option to tests that rely on the C++14 default
When Clang/LLVM is built with the CLANG_DEFAULT_STD_CXX CMake macro that sets the default standard to something other than C++14, there are a number of lit tests that fail as they rely on the C++14 default. This patch just adds the language standard option explicitly to such test cases. Differential revision: https://reviews.llvm.org/D57581 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353163 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeCompletion/crash-skipped-bodies-template-inst.cpp2
-rw-r--r--test/CodeCompletion/skip-auto-funcs.cpp2
-rw-r--r--test/CodeGenCXX/auto-var-init.cpp6
-rw-r--r--test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp4
-rw-r--r--test/CodeGenCXX/new-overflow.cpp2
-rw-r--r--test/CodeGenCXX/new.cpp2
-rw-r--r--test/Lexer/cxx-features.cpp6
-rw-r--r--test/Lexer/half-literal.cpp2
-rw-r--r--test/Modules/friend-definition-2.cpp4
-rw-r--r--test/Modules/merge-lambdas.cpp2
-rw-r--r--test/SemaCXX/int-ptr-cast-SFINAE.cpp2
-rw-r--r--test/SemaTemplate/argument-dependent-lookup.cpp4
-rw-r--r--test/SemaTemplate/class-template-decl.cpp2
-rw-r--r--test/SemaTemplate/typo-dependent-name.cpp2
14 files changed, 21 insertions, 21 deletions
diff --git a/test/CodeCompletion/crash-skipped-bodies-template-inst.cpp b/test/CodeCompletion/crash-skipped-bodies-template-inst.cpp
index 6161f100cb..7fec995ba0 100644
--- a/test/CodeCompletion/crash-skipped-bodies-template-inst.cpp
+++ b/test/CodeCompletion/crash-skipped-bodies-template-inst.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:24:5 %s -o - 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++14 -code-completion-at=%s:24:5 %s -o - 2>&1 | FileCheck %s
template <class T>
auto make_func() {
struct impl {
diff --git a/test/CodeCompletion/skip-auto-funcs.cpp b/test/CodeCompletion/skip-auto-funcs.cpp
index ab2465d7fb..c0fa0f556d 100644
--- a/test/CodeCompletion/skip-auto-funcs.cpp
+++ b/test/CodeCompletion/skip-auto-funcs.cpp
@@ -1,7 +1,7 @@
// We run clang in completion mode to force skipping of function bodies and
// check if the function bodies were skipped by observing the warnings that
// clang produces.
-// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:60:1 %s -o - 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -std=c++14 -fsyntax-only -code-completion-at=%s:60:1 %s -o - 2>&1 | FileCheck %s
template <class T>
auto not_skipped() {
int x;
diff --git a/test/CodeGenCXX/auto-var-init.cpp b/test/CodeGenCXX/auto-var-init.cpp
index 0d13c0af4e..44255b7d45 100644
--- a/test/CodeGenCXX/auto-var-init.cpp
+++ b/test/CodeGenCXX/auto-var-init.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefix=PATTERN
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -emit-llvm -o - | FileCheck %s -check-prefix=ZERO
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefix=PATTERN
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -emit-llvm -o - | FileCheck %s -check-prefix=ZERO
template<typename T> void used(T &) noexcept;
diff --git a/test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp b/test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp
index 3866731a3c..02cab5e2b4 100644
--- a/test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp
+++ b/test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp
@@ -1,10 +1,10 @@
// RUN: %clang_cc1 %s -fms-extensions -triple x86_64-windows-msvc \
-// RUN: -disable-llvm-passes \
+// RUN: -disable-llvm-passes -std=c++14 \
// RUN: -fno-dllexport-inlines -emit-llvm -O1 -o - | \
// RUN: FileCheck --check-prefix=CHECK --check-prefix=NOEXPORTINLINE %s
// RUN: %clang_cc1 %s -fms-extensions -triple x86_64-windows-msvc \
-// RUN: -disable-llvm-passes \
+// RUN: -disable-llvm-passes -std=c++14 \
// RUN: -emit-llvm -O1 -o - | \
// RUN: FileCheck --check-prefix=CHECK --check-prefix=EXPORTINLINE %s
diff --git a/test/CodeGenCXX/new-overflow.cpp b/test/CodeGenCXX/new-overflow.cpp
index b27984f66a..a2269bfc59 100644
--- a/test/CodeGenCXX/new-overflow.cpp
+++ b/test/CodeGenCXX/new-overflow.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
// rdar://problem/9246208
diff --git a/test/CodeGenCXX/new.cpp b/test/CodeGenCXX/new.cpp
index 3bebc2ab8a..1f5288d1d1 100644
--- a/test/CodeGenCXX/new.cpp
+++ b/test/CodeGenCXX/new.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s
typedef __typeof__(sizeof(0)) size_t;
diff --git a/test/Lexer/cxx-features.cpp b/test/Lexer/cxx-features.cpp
index 09b82b7c47..706a02fc8a 100644
--- a/test/Lexer/cxx-features.cpp
+++ b/test/Lexer/cxx-features.cpp
@@ -6,9 +6,9 @@
//
// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -frelaxed-template-template-args -DRELAXED_TEMPLATE_TEMPLATE_ARGS=1 -verify %s
// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s
-// RUN: %clang_cc1 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation
-// RUN: %clang_cc1 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s
-// RUN: %clang_cc1 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s
+// RUN: %clang_cc1 -std=c++14 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation
+// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s
+// RUN: %clang_cc1 -std=c++14 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s
// RUN: %clang_cc1 -std=c++2a -fno-char8_t -DNO_EXCEPTIONS -DNO_CHAR8_T -verify -fsized-deallocation %s
// expected-no-diagnostics
diff --git a/test/Lexer/half-literal.cpp b/test/Lexer/half-literal.cpp
index 2f1cf9589f..43d0b92872 100644
--- a/test/Lexer/half-literal.cpp
+++ b/test/Lexer/half-literal.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -triple aarch64-linux-gnu %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -pedantic -triple aarch64-linux-gnu %s
float a = 1.0h; // expected-error{{no matching literal operator for call to 'operator""h' with argument of type 'long double' or 'const char *', and no matching literal operator template}}
float b = 1.0H; // expected-error{{invalid suffix 'H' on floating constant}}
diff --git a/test/Modules/friend-definition-2.cpp b/test/Modules/friend-definition-2.cpp
index b226b5c0d1..41c2141f40 100644
--- a/test/Modules/friend-definition-2.cpp
+++ b/test/Modules/friend-definition-2.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fmodules %s -verify
-// RUN: %clang_cc1 -fmodules %s -verify -triple i686-windows
+// RUN: %clang_cc1 -std=c++14 -fmodules %s -verify
+// RUN: %clang_cc1 -std=c++14 -fmodules %s -verify -triple i686-windows
// expected-no-diagnostics
#pragma clang module build A
module A {}
diff --git a/test/Modules/merge-lambdas.cpp b/test/Modules/merge-lambdas.cpp
index 463a4c9b2f..da10ec1199 100644
--- a/test/Modules/merge-lambdas.cpp
+++ b/test/Modules/merge-lambdas.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fmodules -verify %s -emit-llvm-only
+// RUN: %clang_cc1 -std=c++14 -fmodules -verify %s -emit-llvm-only
// expected-no-diagnostics
#pragma clang module build A
diff --git a/test/SemaCXX/int-ptr-cast-SFINAE.cpp b/test/SemaCXX/int-ptr-cast-SFINAE.cpp
index 0d2bb6083a..5782a6dbae 100644
--- a/test/SemaCXX/int-ptr-cast-SFINAE.cpp
+++ b/test/SemaCXX/int-ptr-cast-SFINAE.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++14
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17
void foo(int* a, int *b) {
diff --git a/test/SemaTemplate/argument-dependent-lookup.cpp b/test/SemaTemplate/argument-dependent-lookup.cpp
index d1603d56b9..77df49277f 100644
--- a/test/SemaTemplate/argument-dependent-lookup.cpp
+++ b/test/SemaTemplate/argument-dependent-lookup.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -verify %s
-// RUN: %clang_cc1 -verify %s -DHAVE_UNQUALIFIED_LOOKUP_RESULTS
+// RUN: %clang_cc1 -std=c++14 -verify %s
+// RUN: %clang_cc1 -std=c++14 -verify %s -DHAVE_UNQUALIFIED_LOOKUP_RESULTS
// expected-no-diagnostics
namespace address_of {
diff --git a/test/SemaTemplate/class-template-decl.cpp b/test/SemaTemplate/class-template-decl.cpp
index c49154c652..dd9dcd2de9 100644
--- a/test/SemaTemplate/class-template-decl.cpp
+++ b/test/SemaTemplate/class-template-decl.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
template<typename T> class A;
diff --git a/test/SemaTemplate/typo-dependent-name.cpp b/test/SemaTemplate/typo-dependent-name.cpp
index 0231740f6c..88b2fc373b 100644
--- a/test/SemaTemplate/typo-dependent-name.cpp
+++ b/test/SemaTemplate/typo-dependent-name.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
using nullptr_t = decltype(nullptr);