From: Nemanja Ivanovic Date: Tue, 5 Feb 2019 12:05:53 +0000 (+0000) Subject: [NFC] Explicitly add -std=c++14 option to tests that rely on the C++14 default X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db64e7e9fac1005485aa2010566c24eb49140061;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/clang/test/CodeCompletion/crash-skipped-bodies-template-inst.cpp b/clang/test/CodeCompletion/crash-skipped-bodies-template-inst.cpp index 6161f10..7fec995 100644 --- a/clang/test/CodeCompletion/crash-skipped-bodies-template-inst.cpp +++ b/clang/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 auto make_func() { struct impl { diff --git a/clang/test/CodeCompletion/skip-auto-funcs.cpp b/clang/test/CodeCompletion/skip-auto-funcs.cpp index ab2465d..c0fa0f5 100644 --- a/clang/test/CodeCompletion/skip-auto-funcs.cpp +++ b/clang/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 auto not_skipped() { int x; diff --git a/clang/test/CodeGenCXX/auto-var-init.cpp b/clang/test/CodeGenCXX/auto-var-init.cpp index 0d13c0a..44255b7 100644 --- a/clang/test/CodeGenCXX/auto-var-init.cpp +++ b/clang/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 void used(T &) noexcept; diff --git a/clang/test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp b/clang/test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp index 3866731..02cab5e 100644 --- a/clang/test/CodeGenCXX/dllexport-no-dllexport-inlines.cpp +++ b/clang/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/clang/test/CodeGenCXX/new-overflow.cpp b/clang/test/CodeGenCXX/new-overflow.cpp index b27984f..a2269bf 100644 --- a/clang/test/CodeGenCXX/new-overflow.cpp +++ b/clang/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/clang/test/CodeGenCXX/new.cpp b/clang/test/CodeGenCXX/new.cpp index 3bebc2a..1f5288d 100644 --- a/clang/test/CodeGenCXX/new.cpp +++ b/clang/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/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp index 09b82b7..706a02f 100644 --- a/clang/test/Lexer/cxx-features.cpp +++ b/clang/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/clang/test/Lexer/half-literal.cpp b/clang/test/Lexer/half-literal.cpp index 2f1cf95..43d0b92 100644 --- a/clang/test/Lexer/half-literal.cpp +++ b/clang/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/clang/test/Modules/friend-definition-2.cpp b/clang/test/Modules/friend-definition-2.cpp index b226b5c..41c2141f 100644 --- a/clang/test/Modules/friend-definition-2.cpp +++ b/clang/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/clang/test/Modules/merge-lambdas.cpp b/clang/test/Modules/merge-lambdas.cpp index 463a4c9..da10ec1 100644 --- a/clang/test/Modules/merge-lambdas.cpp +++ b/clang/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/clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp b/clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp index 0d2bb60..5782a6d 100644 --- a/clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp +++ b/clang/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/clang/test/SemaTemplate/argument-dependent-lookup.cpp b/clang/test/SemaTemplate/argument-dependent-lookup.cpp index d1603d5..77df492 100644 --- a/clang/test/SemaTemplate/argument-dependent-lookup.cpp +++ b/clang/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/clang/test/SemaTemplate/class-template-decl.cpp b/clang/test/SemaTemplate/class-template-decl.cpp index c49154c..dd9dcd2 100644 --- a/clang/test/SemaTemplate/class-template-decl.cpp +++ b/clang/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 class A; diff --git a/clang/test/SemaTemplate/typo-dependent-name.cpp b/clang/test/SemaTemplate/typo-dependent-name.cpp index 0231740..88b2fc3 100644 --- a/clang/test/SemaTemplate/typo-dependent-name.cpp +++ b/clang/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);