Skip to content

Commit db64e7e

Browse files
committed
[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 llvm-svn: 353163
1 parent 998a925 commit db64e7e

14 files changed

+21
-21
lines changed

clang/test/CodeCompletion/crash-skipped-bodies-template-inst.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:24:5 %s -o - 2>&1 | FileCheck %s
1+
// RUN: %clang_cc1 -fsyntax-only -std=c++14 -code-completion-at=%s:24:5 %s -o - 2>&1 | FileCheck %s
22
template <class T>
33
auto make_func() {
44
struct impl {

clang/test/CodeCompletion/skip-auto-funcs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// We run clang in completion mode to force skipping of function bodies and
22
// check if the function bodies were skipped by observing the warnings that
33
// clang produces.
4-
// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:60:1 %s -o - 2>&1 | FileCheck %s
4+
// RUN: not %clang_cc1 -std=c++14 -fsyntax-only -code-completion-at=%s:60:1 %s -o - 2>&1 | FileCheck %s
55
template <class T>
66
auto not_skipped() {
77
int x;

clang/test/CodeGenCXX/auto-var-init.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s
2-
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefix=PATTERN
3-
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -emit-llvm -o - | FileCheck %s -check-prefix=ZERO
1+
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s
2+
// 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
3+
// 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
44

55
template<typename T> void used(T &) noexcept;
66

clang/test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: %clang_cc1 %s -fms-extensions -triple x86_64-windows-msvc \
2-
// RUN: -disable-llvm-passes \
2+
// RUN: -disable-llvm-passes -std=c++14 \
33
// RUN: -fno-dllexport-inlines -emit-llvm -O1 -o - | \
44
// RUN: FileCheck --check-prefix=CHECK --check-prefix=NOEXPORTINLINE %s
55

66
// RUN: %clang_cc1 %s -fms-extensions -triple x86_64-windows-msvc \
7-
// RUN: -disable-llvm-passes \
7+
// RUN: -disable-llvm-passes -std=c++14 \
88
// RUN: -emit-llvm -O1 -o - | \
99
// RUN: FileCheck --check-prefix=CHECK --check-prefix=EXPORTINLINE %s
1010

clang/test/CodeGenCXX/new-overflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
1+
// RUN: %clang_cc1 -std=c++14 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
22

33
// rdar://problem/9246208
44

clang/test/CodeGenCXX/new.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s
1+
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s
22

33
typedef __typeof__(sizeof(0)) size_t;
44

clang/test/Lexer/cxx-features.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
//
77
// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -frelaxed-template-template-args -DRELAXED_TEMPLATE_TEMPLATE_ARGS=1 -verify %s
88
// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s
9-
// RUN: %clang_cc1 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation
10-
// RUN: %clang_cc1 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s
11-
// RUN: %clang_cc1 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s
9+
// RUN: %clang_cc1 -std=c++14 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation
10+
// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s
11+
// RUN: %clang_cc1 -std=c++14 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s
1212
// RUN: %clang_cc1 -std=c++2a -fno-char8_t -DNO_EXCEPTIONS -DNO_CHAR8_T -verify -fsized-deallocation %s
1313

1414
// expected-no-diagnostics

clang/test/Lexer/half-literal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -triple aarch64-linux-gnu %s
1+
// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -pedantic -triple aarch64-linux-gnu %s
22
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}}
33
float b = 1.0H; // expected-error{{invalid suffix 'H' on floating constant}}
44

clang/test/Modules/friend-definition-2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_cc1 -fmodules %s -verify
2-
// RUN: %clang_cc1 -fmodules %s -verify -triple i686-windows
1+
// RUN: %clang_cc1 -std=c++14 -fmodules %s -verify
2+
// RUN: %clang_cc1 -std=c++14 -fmodules %s -verify -triple i686-windows
33
// expected-no-diagnostics
44
#pragma clang module build A
55
module A {}

clang/test/Modules/merge-lambdas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fmodules -verify %s -emit-llvm-only
1+
// RUN: %clang_cc1 -std=c++14 -fmodules -verify %s -emit-llvm-only
22
// expected-no-diagnostics
33

44
#pragma clang module build A

clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsyntax-only -verify %s
1+
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++14
22
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17
33

44
void foo(int* a, int *b) {

clang/test/SemaTemplate/argument-dependent-lookup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_cc1 -verify %s
2-
// RUN: %clang_cc1 -verify %s -DHAVE_UNQUALIFIED_LOOKUP_RESULTS
1+
// RUN: %clang_cc1 -std=c++14 -verify %s
2+
// RUN: %clang_cc1 -std=c++14 -verify %s -DHAVE_UNQUALIFIED_LOOKUP_RESULTS
33
// expected-no-diagnostics
44

55
namespace address_of {

clang/test/SemaTemplate/class-template-decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsyntax-only -verify %s
1+
// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
22

33
template<typename T> class A;
44

clang/test/SemaTemplate/typo-dependent-name.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsyntax-only -verify %s
1+
// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
22

33
using nullptr_t = decltype(nullptr);
44

0 commit comments

Comments
 (0)