diff --git a/clang-tools-extra/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp b/clang-tools-extra/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp --- a/clang-tools-extra/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp +++ b/clang-tools-extra/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s abseil-duration-unnecessary-conversion %t -- -- -I%S/Inputs +// RUN: %check_clang_tidy -std=c++11,c++14 %s abseil-duration-unnecessary-conversion %t -- -- -I %S/Inputs +// FIXME: Fix the checker to work in C++17 mode. #include "absl/time/time.h" diff --git a/clang-tools-extra/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp b/clang-tools-extra/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp --- a/clang-tools-extra/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp +++ b/clang-tools-extra/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s abseil-faster-strsplit-delimiter %t +// RUN: %check_clang_tidy -std=c++11,c++14 %s abseil-faster-strsplit-delimiter %t +// FIXME: Fix the checker to work in C++17 mode. namespace absl { diff --git a/clang-tools-extra/test/clang-tidy/abseil-str-cat-append.cpp b/clang-tools-extra/test/clang-tidy/abseil-str-cat-append.cpp --- a/clang-tools-extra/test/clang-tidy/abseil-str-cat-append.cpp +++ b/clang-tools-extra/test/clang-tidy/abseil-str-cat-append.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s abseil-str-cat-append %t -- -- -I%S -std=c++11 +// RUN: %check_clang_tidy %s abseil-str-cat-append %t typedef unsigned __INT16_TYPE__ char16; typedef unsigned __INT32_TYPE__ char32; diff --git a/clang-tools-extra/test/clang-tidy/abseil-string-find-startswith.cpp b/clang-tools-extra/test/clang-tidy/abseil-string-find-startswith.cpp --- a/clang-tools-extra/test/clang-tidy/abseil-string-find-startswith.cpp +++ b/clang-tools-extra/test/clang-tidy/abseil-string-find-startswith.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s abseil-string-find-startswith %t -- \ -// RUN: -config="{CheckOptions: [{key: 'abseil-string-find-startswith.StringLikeClasses', value: '::std::basic_string;::basic_string'}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: 'abseil-string-find-startswith.StringLikeClasses', value: '::std::basic_string;::basic_string'}]}" namespace std { template class allocator {}; diff --git a/clang-tools-extra/test/clang-tidy/abseil-time-subtraction.cpp b/clang-tools-extra/test/clang-tidy/abseil-time-subtraction.cpp --- a/clang-tools-extra/test/clang-tidy/abseil-time-subtraction.cpp +++ b/clang-tools-extra/test/clang-tidy/abseil-time-subtraction.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s abseil-time-subtraction %t -- -- -I%S/Inputs +// RUN: %check_clang_tidy -std=c++11,c++14 %s abseil-time-subtraction %t -- -- -I %S/Inputs +// FIXME: Fix the checker to work in C++17 mode. #include "absl/time/time.h" diff --git a/clang-tools-extra/test/clang-tidy/abseil-upgrade-duration-conversions.cpp b/clang-tools-extra/test/clang-tidy/abseil-upgrade-duration-conversions.cpp --- a/clang-tools-extra/test/clang-tidy/abseil-upgrade-duration-conversions.cpp +++ b/clang-tools-extra/test/clang-tidy/abseil-upgrade-duration-conversions.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s abseil-upgrade-duration-conversions %t -- -- -I%S/Inputs +// RUN: %check_clang_tidy -std=c++11,c++14 %s abseil-upgrade-duration-conversions %t -- -- -I%S/Inputs +// FIXME: Fix the checker to work in C++17 mode. using int64_t = long long; diff --git a/clang-tools-extra/test/clang-tidy/bugprone-dangling-handle.cpp b/clang-tools-extra/test/clang-tidy/bugprone-dangling-handle.cpp --- a/clang-tools-extra/test/clang-tidy/bugprone-dangling-handle.cpp +++ b/clang-tools-extra/test/clang-tidy/bugprone-dangling-handle.cpp @@ -1,8 +1,8 @@ -// RUN: %check_clang_tidy %s bugprone-dangling-handle %t -- \ +// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-dangling-handle %t -- \ // RUN: -config="{CheckOptions: \ // RUN: [{key: bugprone-dangling-handle.HandleClasses, \ -// RUN: value: 'std::basic_string_view; ::llvm::StringRef;'}]}" \ -// RUN: -- -std=c++11 +// RUN: value: 'std::basic_string_view; ::llvm::StringRef;'}]}" +// FIXME: Fix the checker to work in C++17 mode. namespace std { diff --git a/clang-tools-extra/test/clang-tidy/bugprone-exception-escape.cpp b/clang-tools-extra/test/clang-tidy/bugprone-exception-escape.cpp --- a/clang-tools-extra/test/clang-tidy/bugprone-exception-escape.cpp +++ b/clang-tools-extra/test/clang-tidy/bugprone-exception-escape.cpp @@ -1,4 +1,9 @@ -// RUN: %check_clang_tidy %s bugprone-exception-escape %t -- -extra-arg=-std=c++11 -extra-arg=-fexceptions -config="{CheckOptions: [{key: bugprone-exception-escape.IgnoredExceptions, value: 'ignored1,ignored2'}, {key: bugprone-exception-escape.FunctionsThatShouldNotThrow, value: 'enabled1,enabled2,enabled3'}]}" -- +// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-exception-escape %t -- \ +// RUN: -config="{CheckOptions: [ \ +// RUN: {key: bugprone-exception-escape.IgnoredExceptions, value: 'ignored1,ignored2'}, \ +// RUN: {key: bugprone-exception-escape.FunctionsThatShouldNotThrow, value: 'enabled1,enabled2,enabled3'} \ +// RUN: ]}" \ +// RUN: -- -fexceptions struct throwing_destructor { ~throwing_destructor() { diff --git a/clang-tools-extra/test/clang-tidy/bugprone-forwarding-reference-overload.cpp b/clang-tools-extra/test/clang-tidy/bugprone-forwarding-reference-overload.cpp --- a/clang-tools-extra/test/clang-tidy/bugprone-forwarding-reference-overload.cpp +++ b/clang-tools-extra/test/clang-tidy/bugprone-forwarding-reference-overload.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s bugprone-forwarding-reference-overload %t -- -- -std=c++14 +// RUN: %check_clang_tidy %s bugprone-forwarding-reference-overload %t namespace std { template struct enable_if { typedef T type; }; diff --git a/clang-tools-extra/test/clang-tidy/bugprone-inaccurate-erase.cpp b/clang-tools-extra/test/clang-tidy/bugprone-inaccurate-erase.cpp --- a/clang-tools-extra/test/clang-tidy/bugprone-inaccurate-erase.cpp +++ b/clang-tools-extra/test/clang-tidy/bugprone-inaccurate-erase.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s bugprone-inaccurate-erase %t +// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-inaccurate-erase %t +// FIXME: Fix the checker to work in C++17 mode. namespace std { template struct vec_iterator { diff --git a/clang-tools-extra/test/clang-tidy/bugprone-move-forwarding-reference.cpp b/clang-tools-extra/test/clang-tidy/bugprone-move-forwarding-reference.cpp --- a/clang-tools-extra/test/clang-tidy/bugprone-move-forwarding-reference.cpp +++ b/clang-tools-extra/test/clang-tidy/bugprone-move-forwarding-reference.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s bugprone-move-forwarding-reference %t -- -- -std=c++14 -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++14-or-later %s bugprone-move-forwarding-reference %t -- -- -fno-delayed-template-parsing namespace std { template struct remove_reference; diff --git a/clang-tools-extra/test/clang-tidy/bugprone-sizeof-container.cpp b/clang-tools-extra/test/clang-tidy/bugprone-sizeof-container.cpp --- a/clang-tools-extra/test/clang-tidy/bugprone-sizeof-container.cpp +++ b/clang-tools-extra/test/clang-tidy/bugprone-sizeof-container.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s bugprone-sizeof-container %t -- -- -std=c++11 -target x86_64-unknown-unknown +// RUN: %check_clang_tidy %s bugprone-sizeof-container %t -- -- -target x86_64-unknown-unknown namespace std { diff --git a/clang-tools-extra/test/clang-tidy/cert-err34-c.cpp b/clang-tools-extra/test/clang-tidy/cert-err34-c.cpp --- a/clang-tools-extra/test/clang-tidy/cert-err34-c.cpp +++ b/clang-tools-extra/test/clang-tidy/cert-err34-c.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cert-err34-c %t -- -- -std=c++11 +// RUN: %check_clang_tidy %s cert-err34-c %t typedef void * FILE; diff --git a/clang-tools-extra/test/clang-tidy/cert-msc51-cpp.cpp b/clang-tools-extra/test/clang-tidy/cert-msc51-cpp.cpp --- a/clang-tools-extra/test/clang-tidy/cert-msc51-cpp.cpp +++ b/clang-tools-extra/test/clang-tidy/cert-msc51-cpp.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s cert-msc51-cpp %t -- -config="{CheckOptions: [{key: cert-msc51-cpp.DisallowedSeedTypes, value: 'some_type,time_t'}]}" -- -std=c++11 +// RUN: %check_clang_tidy %s cert-msc51-cpp %t -- \ +// RUN: -config="{CheckOptions: [{key: cert-msc51-cpp.DisallowedSeedTypes, value: 'some_type,time_t'}]}" namespace std { diff --git a/clang-tools-extra/test/clang-tidy/cert-oop11-cpp.cpp b/clang-tools-extra/test/clang-tidy/cert-oop11-cpp.cpp --- a/clang-tools-extra/test/clang-tidy/cert-oop11-cpp.cpp +++ b/clang-tools-extra/test/clang-tidy/cert-oop11-cpp.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cert-oop11-cpp %t -- -- -std=c++11 +// RUN: %check_clang_tidy %s cert-oop11-cpp %t struct B { B(B&&) noexcept = default; diff --git a/clang-tools-extra/test/clang-tidy/cert-setlongjmp.cpp b/clang-tools-extra/test/clang-tidy/cert-setlongjmp.cpp --- a/clang-tools-extra/test/clang-tidy/cert-setlongjmp.cpp +++ b/clang-tools-extra/test/clang-tidy/cert-setlongjmp.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cert-err52-cpp %t -- -- -std=c++11 +// RUN: %check_clang_tidy %s cert-err52-cpp %t typedef void *jmp_buf; extern int __setjmpimpl(jmp_buf); diff --git a/clang-tools-extra/test/clang-tidy/cert-throw-exception-type.cpp b/clang-tools-extra/test/clang-tidy/cert-throw-exception-type.cpp --- a/clang-tools-extra/test/clang-tidy/cert-throw-exception-type.cpp +++ b/clang-tools-extra/test/clang-tidy/cert-throw-exception-type.cpp @@ -1,4 +1,6 @@ -// RUN: %check_clang_tidy %s cert-err60-cpp %t -- -- -std=c++11 -fcxx-exceptions +// RUN: %check_clang_tidy -std=c++11,c++14 %s cert-err60-cpp %t -- -- -fcxx-exceptions +// FIXME: Split off parts of this test that rely on dynamic exeption +// specifications, and run this test in all language modes. struct S {}; struct T : S {}; diff --git a/clang-tools-extra/test/clang-tidy/check_clang_tidy.py b/clang-tools-extra/test/clang-tidy/check_clang_tidy.py --- a/clang-tools-extra/test/clang-tidy/check_clang_tidy.py +++ b/clang-tools-extra/test/clang-tidy/check_clang_tidy.py @@ -38,29 +38,15 @@ f.write(text) f.truncate() -def csv(string): - return string.split(',') - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('-expect-clang-tidy-error', action='store_true') - parser.add_argument('-resource-dir') - parser.add_argument('-assume-filename') - parser.add_argument('input_file_name') - parser.add_argument('check_name') - parser.add_argument('temp_file_name') - parser.add_argument('-check-suffix', '-check-suffixes', - default=[''], type=csv, - help="comma-separated list of FileCheck suffixes") - - args, extra_args = parser.parse_known_args() +def run_test_once(args, extra_args): resource_dir = args.resource_dir assume_file_name = args.assume_filename input_file_name = args.input_file_name check_name = args.check_name temp_file_name = args.temp_file_name expect_clang_tidy_error = args.expect_clang_tidy_error + std = args.std file_name_with_extension = assume_file_name or input_file_name _, extension = os.path.splitext(file_name_with_extension) @@ -82,12 +68,11 @@ [arg.startswith('-format-style=') for arg in clang_tidy_extra_args]): clang_tidy_extra_args.append('-format-style=none') - if len(clang_extra_args) == 0: - if extension in ['.cpp', '.hpp', '.mm']: - clang_extra_args.append('--std=c++11') - if extension in ['.m', '.mm']: - clang_extra_args.extend( - ['-fobjc-abi-version=2', '-fobjc-arc']) + if extension in ['.m', '.mm']: + clang_extra_args = ['-fobjc-abi-version=2', '-fobjc-arc'] + clang_extra_args + + if extension in ['.cpp', '.hpp', '.mm']: + clang_extra_args.append('-std=' + std) # Tests should not rely on STL being available, and instead provide mock # implementations of relevant APIs. @@ -215,5 +200,49 @@ print('FileCheck failed:\n' + e.output.decode()) raise + +def expand_std(std): + if std == 'c++98-or-later': + return ['c++98', 'c++11', 'c++14', 'c++17', 'c++2a'] + if std == 'c++11-or-later': + return ['c++11', 'c++14', 'c++17', 'c++2a'] + if std == 'c++14-or-later': + return ['c++14', 'c++17', 'c++2a'] + if std == 'c++17-or-later': + return ['c++17', 'c++2a'] + if std == 'c++2a-or-later': + return ['c++2a'] + return [std] + + +def csv(string): + return string.split(',') + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('-expect-clang-tidy-error', action='store_true') + parser.add_argument('-resource-dir') + parser.add_argument('-assume-filename') + parser.add_argument('input_file_name') + parser.add_argument('check_name') + parser.add_argument('temp_file_name') + parser.add_argument( + '-check-suffix', + '-check-suffixes', + default=[''], + type=csv, + help='comma-separated list of FileCheck suffixes') + parser.add_argument('-std', type=csv, default=['c++11-or-later']) + + args, extra_args = parser.parse_known_args() + + abbreviated_stds = args.std + for abbreviated_std in abbreviated_stds: + for std in expand_std(abbreviated_std): + args.std = std + run_test_once(args, extra_args) + + if __name__ == '__main__': main() diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-legacy-functions.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-legacy-functions.cpp --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-legacy-functions.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-legacy-functions.cpp @@ -2,7 +2,7 @@ // RUN: -config='{CheckOptions: \ // RUN: [{key: cppcoreguidelines-owning-memory.LegacyResourceProducers, value: "::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile"}, \ // RUN: {key: cppcoreguidelines-owning-memory.LegacyResourceConsumers, value: "::free;::realloc;::freopen;::fclose"}]}' \ -// RUN: -- -std=c++11 -nostdlib -nostdinc++ +// RUN: -- -nostdlib -nostdinc++ namespace gsl { template diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp @@ -1,4 +1,4 @@ -// RUN: clang-tidy %s -checks=-*,cppcoreguidelines-pro-bounds-constant-array-index -- -std=c++03 | count 0 +// RUN: %check_clang_tidy -std=c++98-or-later %s cppcoreguidelines-pro-bounds-constant-array-index %t // Note: this test expects no diagnostics, but FileCheck cannot handle that, // hence the use of | count 0. @@ -6,6 +6,7 @@ int get() { // The next line used to crash the check (in C++03 mode only). return x[index]; + // CHECK-FIXES: return x[index]; } int x[3]; }; diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-gslheader.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-gslheader.cpp --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-gslheader.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-gslheader.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-pro-bounds-constant-array-index %t -- -config='{CheckOptions: [{key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader, value: "dir1/gslheader.h"}]}' -- -std=c++11 +// RUN: %check_clang_tidy %s cppcoreguidelines-pro-bounds-constant-array-index %t -- \ +// RUN: -config='{CheckOptions: [{key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader, value: "dir1/gslheader.h"}]}' // CHECK-FIXES: #include "dir1/gslheader.h" typedef __SIZE_TYPE__ size_t; diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic-pr36489.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic-pr36489.cpp --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic-pr36489.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic-pr36489.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-pro-bounds-pointer-arithmetic %t -- -- -std=c++14 +// RUN: %check_clang_tidy -std=c++14-or-later %s cppcoreguidelines-pro-bounds-pointer-arithmetic %t // Fix PR36489 and detect auto-deduced value correctly. char *getPtr(); diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx2a.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx2a.cpp --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx2a.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx2a.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init %t -- -- -std=c++2a -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++2a %s cppcoreguidelines-pro-type-member-init %t -- -- -fno-delayed-template-parsing struct PositiveBitfieldMember { PositiveBitfieldMember() {} diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init %t -- -- -std=c++98 -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++98 %s cppcoreguidelines-pro-type-member-init %t -- -- -fno-delayed-template-parsing struct PositiveFieldBeforeConstructor { int F; diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init %t -- -- -std=c++11 -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s cppcoreguidelines-pro-type-member-init %t -- -- -fno-delayed-template-parsing +// FIXME: Fix the checker to work in C++2a mode. struct PositiveFieldBeforeConstructor { int F; diff --git a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-special-member-functions-cxx-03.cpp b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-special-member-functions-cxx-03.cpp --- a/clang-tools-extra/test/clang-tidy/cppcoreguidelines-special-member-functions-cxx-03.cpp +++ b/clang-tools-extra/test/clang-tidy/cppcoreguidelines-special-member-functions-cxx-03.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -- -std=c++03 +// RUN: %check_clang_tidy -std=c++98 %s cppcoreguidelines-special-member-functions %t class DefinesDestructor { ~DefinesDestructor(); diff --git a/clang-tools-extra/test/clang-tidy/expand-modular-headers-ppcallbacks.cpp b/clang-tools-extra/test/clang-tidy/expand-modular-headers-ppcallbacks.cpp --- a/clang-tools-extra/test/clang-tidy/expand-modular-headers-ppcallbacks.cpp +++ b/clang-tools-extra/test/clang-tidy/expand-modular-headers-ppcallbacks.cpp @@ -2,25 +2,47 @@ // RUN: rm -rf %t // RUN: mkdir %t // RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/ -// RUN: %check_clang_tidy %s readability-identifier-naming %t/without-modules -- \ +// RUN: %check_clang_tidy -std=c++11 %s readability-identifier-naming %t/without-modules -- \ // RUN: -config="CheckOptions: [{ \ // RUN: key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }]" \ // RUN: -header-filter=.* \ -// RUN: -- -x c++ -std=c++11 -I%t/ +// RUN: -- -I %t/ +// +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/ +// RUN: %check_clang_tidy -std=c++17 %s readability-identifier-naming %t/without-modules -- \ +// RUN: -config="CheckOptions: [{ \ +// RUN: key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }]" \ +// RUN: -header-filter=.* \ +// RUN: -- -I %t/ // // Run clang-tidy on a file with modular includes: // // RUN: rm -rf %t // RUN: mkdir %t // RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/ -// RUN: %check_clang_tidy %s readability-identifier-naming %t/with-modules -- \ +// RUN: %check_clang_tidy -std=c++11 %s readability-identifier-naming %t/with-modules -- \ +// RUN: -config="CheckOptions: [{ \ +// RUN: key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }]" \ +// RUN: -header-filter=.* \ +// RUN: -- -I %t/ \ +// RUN: -fmodules -fimplicit-modules -fno-implicit-module-maps \ +// RUN: -fmodule-map-file=%t/module.modulemap \ +// RUN: -fmodules-cache-path=%t/module-cache/ +// +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/ +// RUN: %check_clang_tidy -std=c++17 %s readability-identifier-naming %t/with-modules -- \ // RUN: -config="CheckOptions: [{ \ // RUN: key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }]" \ // RUN: -header-filter=.* \ -// RUN: -- -x c++ -std=c++11 -I%t/ \ +// RUN: -- -I %t/ \ // RUN: -fmodules -fimplicit-modules -fno-implicit-module-maps \ // RUN: -fmodule-map-file=%t/module.modulemap \ // RUN: -fmodules-cache-path=%t/module-cache/ +// FIXME: Make the test work in all language modes. #include "c.h" // CHECK-MESSAGES: a.h:1:9: warning: invalid case style for macro definition 'a' [readability-identifier-naming] diff --git a/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-all.cpp b/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-all.cpp --- a/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-all.cpp +++ b/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-all.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s fuchsia-restrict-system-includes %t \ -// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: ''}]}" \ -// RUN: -- -std=c++11 -I %S/Inputs/fuchsia-restrict-system-includes -isystem %S/Inputs/fuchsia-restrict-system-includes/system +// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: ''}]}" \ +// RUN: -- -I %S/Inputs/fuchsia-restrict-system-includes -isystem %S/Inputs/fuchsia-restrict-system-includes/system #include // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include cstdlib.h not allowed diff --git a/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-glob.cpp b/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-glob.cpp --- a/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-glob.cpp +++ b/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-glob.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s fuchsia-restrict-system-includes %t \ -// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: 'cstd*'}]}" \ -// RUN: -- -std=c++11 -I %S/Inputs/fuchsia-restrict-system-includes -isystem %S/Inputs/fuchsia-restrict-system-includes/system +// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: 'cstd*'}]}" \ +// RUN: -- -I %S/Inputs/fuchsia-restrict-system-includes -isystem %S/Inputs/fuchsia-restrict-system-includes/system #include #include diff --git a/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-headers.cpp b/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-headers.cpp --- a/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-headers.cpp +++ b/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-headers.cpp @@ -1,12 +1,13 @@ // RUN: rm -rf %T/Headers // RUN: mkdir %T/Headers // RUN: cp -r %S/Inputs/fuchsia-restrict-system-includes %T/Headers/fuchsia-restrict-system-includes -// RUN: %check_clang_tidy %s fuchsia-restrict-system-includes %t \ -// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: 'transitive.h,s.h'}]}" \ +// RUN: %check_clang_tidy -std=c++11 %s fuchsia-restrict-system-includes %t \ +// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: 'transitive.h,s.h'}]}" \ // RUN: -system-headers -header-filter=.* \ -// RUN: -- -std=c++11 -I %T/Headers/fuchsia-restrict-system-includes -isystem %T/Headers/fuchsia-restrict-system-includes/system +// RUN: -- -I %T/Headers/fuchsia-restrict-system-includes -isystem %T/Headers/fuchsia-restrict-system-includes/system // RUN: FileCheck -input-file=%T/Headers/fuchsia-restrict-system-includes/transitive2.h %s -check-prefix=CHECK-FIXES // RUN: rm -rf %T/Headers +// FIXME: Make the test work in all language modes. // transitive.h includes and #include diff --git a/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes.cpp b/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes.cpp --- a/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes.cpp +++ b/clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s fuchsia-restrict-system-includes %t \ -// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: 's.h'}]}" \ -// RUN: -- -std=c++11 -I %S/Inputs/fuchsia-restrict-system-includes -isystem %S/Inputs/fuchsia-restrict-system-includes/system +// RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: 's.h'}]}" \ +// RUN: -- -I %S/Inputs/fuchsia-restrict-system-includes -isystem %S/Inputs/fuchsia-restrict-system-includes/system #include "a.h" diff --git a/clang-tools-extra/test/clang-tidy/google-readability-casting.cpp b/clang-tools-extra/test/clang-tidy/google-readability-casting.cpp --- a/clang-tools-extra/test/clang-tidy/google-readability-casting.cpp +++ b/clang-tools-extra/test/clang-tidy/google-readability-casting.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s google-readability-casting %t +// RUN: %check_clang_tidy -std=c++11,c++14 %s google-readability-casting %t +// FIXME: Fix the checker to work in C++17 mode. bool g() { return false; } diff --git a/clang-tools-extra/test/clang-tidy/google-runtime-int-std.cpp b/clang-tools-extra/test/clang-tidy/google-runtime-int-std.cpp --- a/clang-tools-extra/test/clang-tidy/google-runtime-int-std.cpp +++ b/clang-tools-extra/test/clang-tidy/google-runtime-int-std.cpp @@ -3,7 +3,7 @@ // RUN: {key: google-runtime-int.UnsignedTypePrefix, value: "std::uint"}, \ // RUN: {key: google-runtime-int.SignedTypePrefix, value: "std::int"}, \ // RUN: {key: google-runtime-int.TypeSuffix, value: "_t"}, \ -// RUN: ]}' -- -std=c++11 +// RUN: ]}' long a(); // CHECK-MESSAGES: [[@LINE-1]]:1: warning: consider replacing 'long' with 'std::int{{..}}_t' diff --git a/clang-tools-extra/test/clang-tidy/google-runtime-references.cpp b/clang-tools-extra/test/clang-tidy/google-runtime-references.cpp --- a/clang-tools-extra/test/clang-tidy/google-runtime-references.cpp +++ b/clang-tools-extra/test/clang-tidy/google-runtime-references.cpp @@ -1,8 +1,7 @@ // RUN: %check_clang_tidy %s google-runtime-references %t -- \ -// RUN: -extra-arg="-std=c++11" \ // RUN: -config="{CheckOptions: \ // RUN: [{key: google-runtime-references.WhiteListTypes, \ -// RUN: value: 'whitelist::A; whitelist::B'}]}" -- +// RUN: value: 'whitelist::A; whitelist::B'}]}" int a; int &b = a; diff --git a/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp b/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp --- a/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp +++ b/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp @@ -1,4 +1,5 @@ // RUN: clang-tidy %s -checks='-*,hicpp-signed-bitwise' -- -std=c++11 +// FIXME: Make the test work in all language modes. #include "hicpp-signed-bitwise-standard-types.h" diff --git a/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise.cpp b/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise.cpp --- a/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise.cpp +++ b/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- -- -std=c++11 --target=x86_64-linux +// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- -- --target=x86_64-linux // These could cause false positives and should not be considered. struct StreamClass { diff --git a/clang-tools-extra/test/clang-tidy/misc-new-delete-overloads-sized-dealloc.cpp b/clang-tools-extra/test/clang-tidy/misc-new-delete-overloads-sized-dealloc.cpp --- a/clang-tools-extra/test/clang-tidy/misc-new-delete-overloads-sized-dealloc.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-new-delete-overloads-sized-dealloc.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-new-delete-overloads %t -- -- -std=c++14 -fsized-deallocation +// RUN: %check_clang_tidy %s misc-new-delete-overloads %t -- -- -fsized-deallocation typedef decltype(sizeof(int)) size_t; diff --git a/clang-tools-extra/test/clang-tidy/misc-new-delete-overloads.cpp b/clang-tools-extra/test/clang-tidy/misc-new-delete-overloads.cpp --- a/clang-tools-extra/test/clang-tidy/misc-new-delete-overloads.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-new-delete-overloads.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-new-delete-overloads %t -- -- -std=c++14 +// RUN: %check_clang_tidy %s misc-new-delete-overloads %t typedef decltype(sizeof(int)) size_t; diff --git a/clang-tools-extra/test/clang-tidy/misc-redundant-expression.cpp b/clang-tools-extra/test/clang-tidy/misc-redundant-expression.cpp --- a/clang-tools-extra/test/clang-tidy/misc-redundant-expression.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-redundant-expression.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-redundant-expression %t -- -- -std=c++11 +// RUN: %check_clang_tidy %s misc-redundant-expression %t typedef __INT64_TYPE__ I64; diff --git a/clang-tools-extra/test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp b/clang-tools-extra/test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp --- a/clang-tools-extra/test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-throw-by-value-catch-by-reference %t -- -- -std=c++11 -fcxx-exceptions +// RUN: %check_clang_tidy %s misc-throw-by-value-catch-by-reference %t -- -- -fcxx-exceptions class logic_error { diff --git a/clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator-cxx17.cpp b/clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator-cxx17.cpp --- a/clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator-cxx17.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator-cxx17.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-unconventional-assign-operator %t -- -- -std=c++17 -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++14-or-later %s misc-unconventional-assign-operator %t -- -- -fno-delayed-template-parsing struct BadModifier { BadModifier& operator=(const BadModifier&) const; diff --git a/clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator.cpp b/clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator.cpp --- a/clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-unconventional-assign-operator %t -- -- -std=c++11 -isystem %S/Inputs/Headers -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s misc-unconventional-assign-operator %t -- -- -isystem %S/Inputs/Headers -fno-delayed-template-parsing namespace std { template diff --git a/clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp b/clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp --- a/clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp @@ -1,7 +1,8 @@ // RUN: echo "static void staticFunctionHeader(int i) {;}" > %T/header.h // RUN: echo "static void staticFunctionHeader(int /*i*/) {;}" > %T/header-fixed.h -// RUN: %check_clang_tidy %s misc-unused-parameters %t -- -header-filter='.*' -- -std=c++11 -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++11 %s misc-unused-parameters %t -- -header-filter='.*' -- -fno-delayed-template-parsing // RUN: diff %T/header.h %T/header-fixed.h +// FIXME: Make the test work in all language modes. #include "header.h" // CHECK-MESSAGES: header.h:1:38: warning diff --git a/clang-tools-extra/test/clang-tidy/modernize-avoid-bind.cpp b/clang-tools-extra/test/clang-tidy/modernize-avoid-bind.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-avoid-bind.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-avoid-bind.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-avoid-bind %t -- -- -std=c++14 +// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-avoid-bind %t namespace std { inline namespace impl { diff --git a/clang-tools-extra/test/clang-tidy/modernize-concat-nested-namespaces.cpp b/clang-tools-extra/test/clang-tidy/modernize-concat-nested-namespaces.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-concat-nested-namespaces.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-concat-nested-namespaces.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-concat-nested-namespaces %t -- -- -std=c++17 +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-concat-nested-namespaces %t namespace n1 {} diff --git a/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp b/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/modernize-deprecated-headers -- -std=c++03 -v +// RUN: %check_clang_tidy -std=c++98 %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/modernize-deprecated-headers #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead [modernize-deprecated-headers] diff --git a/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp b/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/modernize-deprecated-headers -- -std=c++11 -v +// RUN: %check_clang_tidy -std=c++11-or-later %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/modernize-deprecated-headers #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead [modernize-deprecated-headers] diff --git a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-basic.cpp b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-basic.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-basic.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-basic.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -std=c++11 -I %S/Inputs/modernize-loop-convert +// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/modernize-loop-convert #include "structures.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-camelback.cpp b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-camelback.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-camelback.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-camelback.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-loop-convert %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'camelBack'}]}" \ -// RUN: -- -std=c++11 -I %S/Inputs/modernize-loop-convert +// RUN: -- -I %S/Inputs/modernize-loop-convert #include "structures.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-const.cpp b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-const.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-const.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-const.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -std=c++11 +// RUN: %check_clang_tidy %s modernize-loop-convert %t struct Str { Str() = default; diff --git a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -std=c++11 -I %S/Inputs/modernize-loop-convert +// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/modernize-loop-convert #include "structures.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-lowercase.cpp b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-lowercase.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-lowercase.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-lowercase.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-loop-convert %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'lower_case'}]}" \ -// RUN: -- -std=c++11 -I %S/Inputs/modernize-loop-convert +// RUN: -- -I %S/Inputs/modernize-loop-convert #include "structures.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-negative.cpp b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-negative.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-negative.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-negative.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -std=c++11 -I %S/Inputs/modernize-loop-convert +// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/modernize-loop-convert #include "structures.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-uppercase.cpp b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-uppercase.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-uppercase.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-uppercase.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-loop-convert %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'UPPER_CASE'}]}" \ -// RUN: -- -std=c++11 -I %S/Inputs/modernize-loop-convert +// RUN: -- -I %S/Inputs/modernize-loop-convert #include "structures.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-make-shared-header.cpp b/clang-tools-extra/test/clang-tidy/modernize-make-shared-header.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-make-shared-header.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-make-shared-header.cpp @@ -5,7 +5,7 @@ // RUN: {key: modernize-make-shared.MakeSmartPtrFunctionHeader, \ // RUN: value: 'make_shared_util.h'} \ // RUN: ]}" \ -// RUN: -- -std=c++11 -I%S/Inputs/modernize-smart-ptr +// RUN: -- -I %S/Inputs/modernize-smart-ptr #include "shared_ptr.h" // CHECK-FIXES: #include "make_shared_util.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp b/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp @@ -1,5 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-make-shared %t -- -- -std=c++11 \ -// RUN: -I%S/Inputs/modernize-smart-ptr +// RUN: %check_clang_tidy %s modernize-make-shared %t -- -- -I %S/Inputs/modernize-smart-ptr #include "shared_ptr.h" // CHECK-FIXES: #include diff --git a/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx11.cpp b/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx11.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx11.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx11.cpp @@ -1,5 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-make-unique %t -- -- -std=c++11 \ -// RUN: -I%S/Inputs/modernize-smart-ptr +// RUN: %check_clang_tidy -std=c++11 %s modernize-make-unique %t -- -- -I %S/Inputs/modernize-smart-ptr #include "unique_ptr.h" // CHECK-FIXES: #include "unique_ptr.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx14.cpp b/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx14.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx14.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx14.cpp @@ -1,5 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-make-unique %t -- -- -std=c++14 \ -// RUN: -I%S/Inputs/modernize-smart-ptr +// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-make-unique %t -- -- -I %S/Inputs/modernize-smart-ptr #include "unique_ptr.h" // CHECK-FIXES: #include diff --git a/clang-tools-extra/test/clang-tidy/modernize-make-unique-header.cpp b/clang-tools-extra/test/clang-tidy/modernize-make-unique-header.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-make-unique-header.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-make-unique-header.cpp @@ -5,7 +5,7 @@ // RUN: {key: modernize-make-unique.MakeSmartPtrFunctionHeader, \ // RUN: value: 'make_unique_util.h'} \ // RUN: ]}" \ -// RUN: -- -std=c++11 -I%S/Inputs/modernize-smart-ptr +// RUN: -- -I %S/Inputs/modernize-smart-ptr #include "unique_ptr.h" // CHECK-FIXES: #include "make_unique_util.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-make-unique-macros.cpp b/clang-tools-extra/test/clang-tidy/modernize-make-unique-macros.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-make-unique-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-make-unique-macros.cpp @@ -1,6 +1,6 @@ -// RUN: %check_clang_tidy %s modernize-make-unique %t -- \ +// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-make-unique %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-make-unique.IgnoreMacros, value: 0}]}" \ -// RUN: -- -std=c++14 -I%S/Inputs/modernize-smart-ptr +// RUN: -- -I %S/Inputs/modernize-smart-ptr #include "unique_ptr.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-make-unique.cpp b/clang-tools-extra/test/clang-tidy/modernize-make-unique.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-make-unique.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-make-unique.cpp @@ -1,5 +1,5 @@ -// RUN: %check_clang_tidy %s modernize-make-unique %t -- -- -std=c++14 \ -// RUN: -I%S/Inputs/modernize-smart-ptr +// RUN: %check_clang_tidy -std=c++14 %s modernize-make-unique %t -- -- -I %S/Inputs/modernize-smart-ptr +// FIXME: Fix the checker to work in C++17 mode. #include "unique_ptr.h" #include "initializer_list.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp @@ -1,6 +1,7 @@ // RUN: cp %S/Inputs/modernize-pass-by-value/header.h %T/pass-by-value-header.h // RUN: clang-tidy %s -checks='-*,modernize-pass-by-value' -header-filter='.*' -fix -- -std=c++11 -I %T | FileCheck %s -check-prefix=CHECK-MESSAGES -implicit-check-not="{{warning|error}}:" // RUN: FileCheck -input-file=%T/pass-by-value-header.h %s -check-prefix=CHECK-FIXES +// FIXME: Make the test work in all language modes. #include "pass-by-value-header.h" // CHECK-MESSAGES: :8:5: warning: pass by value and use std::move [modernize-pass-by-value] diff --git a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-macro-header.cpp b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-macro-header.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-macro-header.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-macro-header.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -std=c++11 -isystem %S/Inputs/Headers +// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -isystem %S/Inputs/Headers // CHECK-FIXES: #include diff --git a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -std=c++11 -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -fno-delayed-template-parsing namespace { // POD types are trivially move constructible. diff --git a/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal-delimiter.cpp b/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal-delimiter.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal-delimiter.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal-delimiter.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config='{CheckOptions: [{key: "modernize-raw-string-literal.DelimiterStem", value: "str"}, {key: modernize-raw-string-literal.ReplaceShorterLiterals, value: 1}]}' -- -std=c++11 +// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config='{CheckOptions: [{key: "modernize-raw-string-literal.DelimiterStem", value: "str"}, {key: modernize-raw-string-literal.ReplaceShorterLiterals, value: 1}]}' char const *const ContainsSentinel{"who\\ops)\""}; // CHECK-MESSAGES: :[[@LINE-1]]:36: warning: {{.*}} can be written as a raw string literal diff --git a/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal.cpp b/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config="{CheckOptions: [{key: modernize-raw-string-literal.ReplaceShorterLiterals, value: 1}]}" -- -std=c++11 +// RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s modernize-raw-string-literal %t -- -config="{CheckOptions: [{key: modernize-raw-string-literal.ReplaceShorterLiterals, value: 1}]}" +// FIXME: Fix the checker to work in C++2a mode. char const *const BackSlash("goink\\frob"); // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: escaped string literal can be written as a raw string literal [modernize-raw-string-literal] diff --git a/clang-tools-extra/test/clang-tidy/modernize-replace-auto-ptr.cpp b/clang-tools-extra/test/clang-tidy/modernize-replace-auto-ptr.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-replace-auto-ptr.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-replace-auto-ptr.cpp @@ -1,5 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-replace-auto-ptr %t -- -- \ -// RUN: -std=c++11 -I %S/Inputs/modernize-replace-auto-ptr +// RUN: %check_clang_tidy %s modernize-replace-auto-ptr %t -- -- -I %S/Inputs/modernize-replace-auto-ptr // CHECK-FIXES: #include diff --git a/clang-tools-extra/test/clang-tidy/modernize-replace-random-shuffle.cpp b/clang-tools-extra/test/clang-tidy/modernize-replace-random-shuffle.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-replace-random-shuffle.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-replace-random-shuffle.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-replace-random-shuffle %t -- -- -std=c++11 +// RUN: %check_clang_tidy %s modernize-replace-random-shuffle %t //CHECK-FIXES: #include diff --git a/clang-tools-extra/test/clang-tidy/modernize-return-braced-init-list.cpp b/clang-tools-extra/test/clang-tidy/modernize-return-braced-init-list.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-return-braced-init-list.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-return-braced-init-list.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s modernize-return-braced-init-list %t -- -- -std=c++14 +// RUN: %check_clang_tidy -std=c++14 %s modernize-return-braced-init-list %t +// FIXME: Fix the checker to work in C++17 mode. namespace std { typedef decltype(sizeof(int)) size_t; diff --git a/clang-tools-extra/test/clang-tidy/modernize-unary-static-assert.cpp b/clang-tools-extra/test/clang-tidy/modernize-unary-static-assert.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-unary-static-assert.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-unary-static-assert.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-unary-static-assert %t -- -- -std=c++1z +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-unary-static-assert %t #define FOO static_assert(sizeof(a) <= 15, ""); #define MSG "" diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-auto-cast-remove-stars.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-auto-cast-remove-stars.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-auto-cast-remove-stars.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-auto-cast-remove-stars.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-use-auto %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: '1'} , {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \ -// RUN: -- -std=c++11 -frtti +// RUN: -- -frtti struct A { virtual ~A() {} diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-auto-cast.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-auto-cast.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-auto-cast.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-auto-cast.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-use-auto %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \ -// RUN: -- -std=c++11 -I %S/Inputs/modernize-use-auto -frtti +// RUN: -- -I %S/Inputs/modernize-use-auto -frtti struct A { virtual ~A() {} diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-auto-iterator.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-auto-iterator.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-auto-iterator.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-auto-iterator.cpp @@ -1,5 +1,5 @@ -// RUN: %check_clang_tidy %s modernize-use-auto %t -- -- \ -// RUN: -std=c++11 -I %S/Inputs/modernize-use-auto +// RUN: %check_clang_tidy -std=c++11,c++14 %s modernize-use-auto %t -- -- -I %S/Inputs/modernize-use-auto +// FIXME: Fix the checker to work in C++17 mode. #include "containers.h" diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-auto-min-type-name-length.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-auto-min-type-name-length.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-auto-min-type-name-length.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-auto-min-type-name-length.cpp @@ -1,7 +1,7 @@ -// RUN: %check_clang_tidy -check-suffix=0-0 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 0}, {key: modernize-use-auto.MinTypeNameLength, value: 0}]}" -- --std=c++11 -frtti -// RUN: %check_clang_tidy -check-suffix=0-8 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 0}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- --std=c++11 -frtti -// RUN: %check_clang_tidy -check-suffix=1-0 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 1}, {key: modernize-use-auto.MinTypeNameLength, value: 0}]}" -- --std=c++11 -frtti -// RUN: %check_clang_tidy -check-suffix=1-8 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 1}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- --std=c++11 -frtti +// RUN: %check_clang_tidy -check-suffix=0-0 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 0}, {key: modernize-use-auto.MinTypeNameLength, value: 0}]}" -- -frtti +// RUN: %check_clang_tidy -check-suffix=0-8 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 0}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- -frtti +// RUN: %check_clang_tidy -check-suffix=1-0 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 1}, {key: modernize-use-auto.MinTypeNameLength, value: 0}]}" -- -frtti +// RUN: %check_clang_tidy -check-suffix=1-8 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 1}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- -frtti template extern T foo(); template struct P { explicit P(T t) : t_(t) {} T t_;}; diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-auto-new-remove-stars.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-auto-new-remove-stars.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-auto-new-remove-stars.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-auto-new-remove-stars.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-auto %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: '1'}, {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: '1'}, {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" class MyType {}; diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-auto-new.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-auto-new.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-auto-new.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-auto-new.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-use-auto %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \ -// RUN: -- -std=c++11 -frtti +// RUN: -- -frtti class MyType {}; diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-bool-literals-ignore-macros.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-bool-literals-ignore-macros.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-bool-literals-ignore-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-bool-literals-ignore-macros.cpp @@ -1,8 +1,7 @@ // RUN: %check_clang_tidy %s modernize-use-bool-literals %t -- \ // RUN: -config="{CheckOptions: \ // RUN: [{key: modernize-use-bool-literals.IgnoreMacros, \ -// RUN: value: 1}]}" \ -// RUN: -- -std=c++11 +// RUN: value: 1}]}" bool IntToTrue = 1; // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: converting integer literal to bool, use bool literal instead [modernize-use-bool-literals] diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-bool-literals.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-bool-literals.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-bool-literals.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-bool-literals.cpp @@ -1,8 +1,7 @@ // RUN: %check_clang_tidy %s modernize-use-bool-literals %t -- \ // RUN: -config="{CheckOptions: \ // RUN: [{key: modernize-use-bool-literals.IgnoreMacros, \ -// RUN: value: 0}]}" \ -// RUN: -- -std=c++11 +// RUN: value: 0}]}" bool IntToTrue = 1; // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: converting integer literal to bool, use bool literal instead [modernize-use-bool-literals] diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-assignment.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-assignment.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-assignment.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-assignment.cpp @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: 1}]}" -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: 1}]}" struct S { }; diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-bitfield.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-bitfield.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-bitfield.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-bitfield.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- -- -std=c++2a +// RUN: %check_clang_tidy -std=c++2a-or-later %s modernize-use-default-member-init %t struct PositiveBitField { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-macros.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-macros.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-macros.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.IgnoreMacros, value: 0}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.IgnoreMacros, value: 0}]}" #define MACRO() \ struct S { \ diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- -- -std=c++11 +// RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s modernize-use-default-member-init %t +// FIXME: Fix the checker to work in C++2a mode. struct S { }; diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-emplace-ignore-implicit-constructors.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-emplace-ignore-implicit-constructors.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-emplace-ignore-implicit-constructors.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-emplace-ignore-implicit-constructors.cpp @@ -2,7 +2,7 @@ // RUN: -config="{CheckOptions: \ // RUN: [{key: modernize-use-emplace.IgnoreImplicitConstructors, \ // RUN: value: 1}] \ -// RUN: }" -- -std=c++11 +// RUN: }" namespace std { template diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-emplace.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-emplace.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-emplace.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-emplace.cpp @@ -6,7 +6,7 @@ // RUN: value: '::std::pair; std::tuple; ::test::Single'}, \ // RUN: {key: modernize-use-emplace.TupleMakeFunctions, \ // RUN: value: '::std::make_pair; ::std::make_tuple; ::test::MakeSingle'}] \ -// RUN: }" -- -std=c++11 +// RUN: }" namespace std { template diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-copy.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-copy.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-copy.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-copy.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-use-equals-default %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: 0}]}" \ -// RUN: -- -std=c++11 -fno-delayed-template-parsing -fexceptions +// RUN: -- -fno-delayed-template-parsing -fexceptions // Out of line definition. struct OL { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-delayed.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-delayed.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-delayed.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-delayed.cpp @@ -1,6 +1,7 @@ // RUN: clang-tidy %s -checks=-*,modernize-use-equals-default -- -std=c++11 -fdelayed-template-parsing -fexceptions | count 0 // Note: this test expects no diagnostics, but FileCheck cannot handle that, // hence the use of | count 0. +// FIXME: Make the test work in all language modes. template struct S { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-macros.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-macros.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-equals-default-macros.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-equals-default %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: 0}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: 0}]}" #define STRUCT_WITH_DEFAULT(_base, _type) \ struct _type { \ diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-equals-default.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-equals-default.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-equals-default.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-equals-default.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-equals-default %t -- -- -std=c++11 -fno-delayed-template-parsing -fexceptions +// RUN: %check_clang_tidy %s modernize-use-equals-default %t -- -- -fno-delayed-template-parsing -fexceptions // Out of line definition. class OL { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-equals-delete-macros.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-equals-delete-macros.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-equals-delete-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-equals-delete-macros.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-equals-delete %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-equals-delete.IgnoreMacros, value: 0}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-equals-delete.IgnoreMacros, value: 0}]}" #define MACRO(type) void operator=(type const &) class C { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-clang-unused.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-clang-unused.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-clang-unused.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-clang-unused.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-nodiscard %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: '[[clang::warn_unused_result]]'}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: '[[clang::warn_unused_result]]'}]}" class Foo { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-nodiscard %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: '__attribute__((warn_unused_result))'}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: '__attribute__((warn_unused_result))'}]}" class Foo { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-gcc-unused.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-gcc-unused.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-gcc-unused.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-gcc-unused.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-nodiscard %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: '[[gcc::warn_unused_result]]'}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: '[[gcc::warn_unused_result]]'}]}" class Foo { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro-inscope-cxx11.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro-inscope-cxx11.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro-inscope-cxx11.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro-inscope-cxx11.cpp @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-nodiscard %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: 'CUSTOM_NO_DISCARD'}]}" -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: 'CUSTOM_NO_DISCARD'}]}" // As if the macro was not defined. // #define CUSTOM_NO_DISCARD __attribute_((warn_unused_result)) diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-nodiscard %t -- -- -std=c++17 +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-nodiscard %t class Foo { diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-noexcept-macro.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-noexcept-macro.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-noexcept-macro.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-noexcept-macro.cpp @@ -1,6 +1,8 @@ -// RUN: %check_clang_tidy %s modernize-use-noexcept %t -- \ +// RUN: %check_clang_tidy -std=c++11,c++14 %s modernize-use-noexcept %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-use-noexcept.ReplacementString, value: 'NOEXCEPT'}]}" \ -// RUN: -- -std=c++11 -fexceptions +// RUN: -- -fexceptions +// This test is not run in C++17 or later because dynamic exception +// specifications were removed in C++17. // Example definition of NOEXCEPT -- simplified test to see if noexcept is supported. #if (__has_feature(cxx_noexcept)) diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-noexcept-opt.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-noexcept-opt.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-noexcept-opt.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-noexcept-opt.cpp @@ -1,6 +1,8 @@ -// RUN: %check_clang_tidy %s modernize-use-noexcept %t -- \ +// RUN: %check_clang_tidy -std=c++11,c++14 %s modernize-use-noexcept %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-use-noexcept.UseNoexceptFalse, value: 0}]}" \ -// RUN: -- -std=c++11 -fexceptions +// RUN: -- -fexceptions +// This test is not run in C++17 or later because dynamic exception +// specifications were removed in C++17. class A {}; class B {}; diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-noexcept.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-noexcept.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-noexcept.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-noexcept.cpp @@ -1,5 +1,6 @@ -// RUN: %check_clang_tidy %s modernize-use-noexcept %t -- \ -// RUN: -- -std=c++11 -fexceptions +// RUN: %check_clang_tidy -std=c++11,c++14 %s modernize-use-noexcept %t -- -- -fexceptions +// This test is not run in C++17 or later because dynamic exception +// specifications were removed in C++17. class A {}; class B {}; diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nullptr-basic.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr-basic.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-nullptr-basic.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr-basic.cpp @@ -1,8 +1,9 @@ -// RUN: %check_clang_tidy %s modernize-use-nullptr %t -- -- \ -// RUN: -std=c++98 -Wno-non-literal-null-conversion +// RUN: %check_clang_tidy -std=c++98 %s modernize-use-nullptr %t -- -- -Wno-non-literal-null-conversion // // Some parts of the test (e.g. assignment of `const int` to `int *`) fail in // C++11, so we need to run the test in C++98 mode. +// +// FIXME: Make the test work in all language modes. const unsigned int g_null = 0; #define NULL 0 diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-nullptr %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-nullptr.NullMacros, value: 'MY_NULL,NULL'}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-nullptr.NullMacros, value: 'MY_NULL,NULL'}]}" #define NULL 0 diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-override-cxx98.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-override-cxx98.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-override-cxx98.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-override-cxx98.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-override %t -- -- -std=c++98 +// RUN: %check_clang_tidy -std=c++98 %s modernize-use-override %t struct Base { virtual ~Base() {} diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-override-ms.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-override-ms.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-override-ms.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-override-ms.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-override %t -- -- -fms-extensions -std=c++11 +// RUN: %check_clang_tidy %s modernize-use-override %t -- -- -fms-extensions // This test is designed to test ms-extension __declspec(dllexport) attributes. #define EXPORT __declspec(dllexport) diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-override-no-destructors.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-override-no-destructors.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-override-no-destructors.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-override-no-destructors.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-override %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-override.IgnoreDestructors, value: 1}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-override.IgnoreDestructors, value: 1}]}" struct Base { virtual ~Base(); diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-override-with-macro.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-override-with-macro.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-override-with-macro.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-override-with-macro.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-override %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-override.OverrideSpelling, value: 'OVERRIDE'},{key: modernize-use-override.FinalSpelling, value: 'FINAL'}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-override.OverrideSpelling, value: 'OVERRIDE'},{key: modernize-use-override.FinalSpelling, value: 'FINAL'}]}" #define ABSTRACT = 0 diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-override-with-no-macro-inscope.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-override-with-no-macro-inscope.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-override-with-no-macro-inscope.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-override-with-no-macro-inscope.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-override %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-override.OverrideSpelling, value: 'CUSTOM_OVERRIDE'},{key: modernize-use-override.FinalSpelling, value: 'CUSTOM_FINAL'}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-override.OverrideSpelling, value: 'CUSTOM_OVERRIDE'},{key: modernize-use-override.FinalSpelling, value: 'CUSTOM_FINAL'}]}" // As if the macro was not defined. //#define CUSTOM_OVERRIDE override diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-override.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-override.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-override.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-override.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-override %t -- -- -std=c++11 -fexceptions +// RUN: %check_clang_tidy %s modernize-use-override %t -- -- -fexceptions #define ABSTRACT = 0 diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-trailing-return-type.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-trailing-return-type.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-trailing-return-type.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-trailing-return-type.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-trailing-return-type %t -- -- --std=c++14 -fdeclspec -fexceptions +// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-use-trailing-return-type %t -- -- -fdeclspec -fexceptions namespace std { template diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-transparent-functors.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-transparent-functors.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-transparent-functors.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-transparent-functors.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-transparent-functors %t -- -- -std=c++14 +// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-use-transparent-functors %t namespace std { template diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-uncaught-exceptions.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-uncaught-exceptions.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-uncaught-exceptions.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-uncaught-exceptions.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s modernize-use-uncaught-exceptions %t -- -- -std=c++1z +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-uncaught-exceptions %t + #define MACRO std::uncaught_exception // CHECK-FIXES: #define MACRO std::uncaught_exception diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp --- a/clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s modernize-use-using %t -- \ -// RUN: -config="{CheckOptions: [{key: modernize-use-using.IgnoreMacros, value: 0}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: modernize-use-using.IgnoreMacros, value: 0}]}" #define CODE typedef int INT diff --git a/clang-tools-extra/test/clang-tidy/objc-no-arc-or-properties.m b/clang-tools-extra/test/clang-tidy/objc-no-arc-or-properties.m --- a/clang-tools-extra/test/clang-tidy/objc-no-arc-or-properties.m +++ b/clang-tools-extra/test/clang-tidy/objc-no-arc-or-properties.m @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s bugprone-suspicious-semicolon %t -- -- -fno-objc-arc -fobjc-abi-version=1 +// RUN: %check_clang_tidy -std=c99 %s bugprone-suspicious-semicolon %t -- -- -fno-objc-arc -fobjc-abi-version=1 // This test ensures check_clang_tidy.py allows disabling Objective-C ARC and // Objective-C 2.0 via passing arguments after -- on the command line. diff --git a/clang-tools-extra/test/clang-tidy/openmp-use-default-none.cpp b/clang-tools-extra/test/clang-tidy/openmp-use-default-none.cpp --- a/clang-tools-extra/test/clang-tidy/openmp-use-default-none.cpp +++ b/clang-tools-extra/test/clang-tidy/openmp-use-default-none.cpp @@ -1,5 +1,5 @@ -// RUN: %check_clang_tidy %s openmp-use-default-none %t -- -- -x c++ -fopenmp=libomp -fopenmp-version=40 -// RUN: %check_clang_tidy %s openmp-use-default-none %t -- -- -x c -fopenmp=libomp -fopenmp-version=40 +// RUN: %check_clang_tidy %s openmp-use-default-none %t -- -- -fopenmp=libomp -fopenmp-version=40 +// RUN: %check_clang_tidy -std=c11 %s openmp-use-default-none %t -- -- -x c -fopenmp=libomp -fopenmp-version=40 //----------------------------------------------------------------------------// // Null cases. diff --git a/clang-tools-extra/test/clang-tidy/performance-for-range-copy-allowed-types.cpp b/clang-tools-extra/test/clang-tidy/performance-for-range-copy-allowed-types.cpp --- a/clang-tools-extra/test/clang-tidy/performance-for-range-copy-allowed-types.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-for-range-copy-allowed-types.cpp @@ -1,4 +1,6 @@ -// RUN: %check_clang_tidy %s performance-for-range-copy %t -- -config="{CheckOptions: [{key: performance-for-range-copy.AllowedTypes, value: '[Pp]ointer$;[Pp]tr$;[Rr]ef(erence)?$'}]}" -- -std=c++11 -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s performance-for-range-copy %t -- \ +// RUN: -config="{CheckOptions: [{key: performance-for-range-copy.AllowedTypes, value: '[Pp]ointer$;[Pp]tr$;[Rr]ef(erence)?$'}]}" \ +// RUN: -- -fno-delayed-template-parsing template struct Iterator { diff --git a/clang-tools-extra/test/clang-tidy/performance-for-range-copy-warn-on-all-auto-copies.cpp b/clang-tools-extra/test/clang-tidy/performance-for-range-copy-warn-on-all-auto-copies.cpp --- a/clang-tools-extra/test/clang-tidy/performance-for-range-copy-warn-on-all-auto-copies.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-for-range-copy-warn-on-all-auto-copies.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s performance-for-range-copy %t -config="{CheckOptions: [{key: "performance-for-range-copy.WarnOnAllAutoCopies", value: 1}]}" -- -std=c++11 +// RUN: %check_clang_tidy %s performance-for-range-copy %t -- \ +// RUN: -config="{CheckOptions: [{key: "performance-for-range-copy.WarnOnAllAutoCopies", value: 1}]}" template struct Iterator { diff --git a/clang-tools-extra/test/clang-tidy/performance-for-range-copy.cpp b/clang-tools-extra/test/clang-tidy/performance-for-range-copy.cpp --- a/clang-tools-extra/test/clang-tidy/performance-for-range-copy.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-for-range-copy.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s performance-for-range-copy %t -- -- -std=c++11 -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s performance-for-range-copy %t -- -- -fno-delayed-template-parsing namespace std { diff --git a/clang-tools-extra/test/clang-tidy/performance-inefficient-algorithm.cpp b/clang-tools-extra/test/clang-tidy/performance-inefficient-algorithm.cpp --- a/clang-tools-extra/test/clang-tidy/performance-inefficient-algorithm.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-inefficient-algorithm.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s performance-inefficient-algorithm %t +// RUN: %check_clang_tidy -std=c++11,c++14 %s performance-inefficient-algorithm %t +// FIXME: Fix the checker to work in C++17 mode. namespace std { template struct less { diff --git a/clang-tools-extra/test/clang-tidy/performance-inefficient-vector-operation.cpp b/clang-tools-extra/test/clang-tidy/performance-inefficient-vector-operation.cpp --- a/clang-tools-extra/test/clang-tidy/performance-inefficient-vector-operation.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-inefficient-vector-operation.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s performance-inefficient-vector-operation %t -- -format-style=llvm -- --std=c++11 +// RUN: %check_clang_tidy %s performance-inefficient-vector-operation %t -- -format-style=llvm namespace std { diff --git a/clang-tools-extra/test/clang-tidy/performance-move-const-arg-trivially-copyable.cpp b/clang-tools-extra/test/clang-tidy/performance-move-const-arg-trivially-copyable.cpp --- a/clang-tools-extra/test/clang-tidy/performance-move-const-arg-trivially-copyable.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-move-const-arg-trivially-copyable.cpp @@ -1,7 +1,6 @@ // RUN: %check_clang_tidy %s performance-move-const-arg %t \ // RUN: -config='{CheckOptions: \ -// RUN: [{key: performance-move-const-arg.CheckTriviallyCopyableMove, value: 0}]}' \ -// RUN: -- -std=c++14 +// RUN: [{key: performance-move-const-arg.CheckTriviallyCopyableMove, value: 0}]}' namespace std { diff --git a/clang-tools-extra/test/clang-tidy/performance-move-constructor-init.cpp b/clang-tools-extra/test/clang-tidy/performance-move-constructor-init.cpp --- a/clang-tools-extra/test/clang-tidy/performance-move-constructor-init.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-move-constructor-init.cpp @@ -1,7 +1,7 @@ // RUN: %check_clang_tidy %s performance-move-constructor-init,modernize-pass-by-value %t -- \ // RUN: -config='{CheckOptions: \ // RUN: [{key: modernize-pass-by-value.ValuesOnly, value: 1}]}' \ -// RUN: -- -std=c++11 -isystem %S/Inputs/Headers +// RUN: -- -isystem %S/Inputs/Headers #include diff --git a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-header.cpp b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-header.cpp --- a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-header.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-header.cpp @@ -1,8 +1,9 @@ // RUN: rm -rf %t // RUN: mkdir %t // RUN: cp %S/Inputs/performance-unnecessary-value-param/header.h %t/header.h -// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t/temp -- -- -std=c++11 -I %t +// RUN: %check_clang_tidy -std=c++11 %s performance-unnecessary-value-param %t/temp -- -- -I %t // RUN: diff %t/header.h %S/Inputs/performance-unnecessary-value-param/header-fixed.h +// FIXME: Make the test work in all language modes. #include "header.h" diff --git a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp --- a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t -- -fix-errors -- --std=c++11 +// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t -- -fix-errors // Ensure that incomplete types result in an error from the frontend and not a // clang-tidy diagnostic about IncompleteType being expensive to copy. diff --git a/clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-ppc.cpp b/clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-ppc.cpp --- a/clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-ppc.cpp +++ b/clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-ppc.cpp @@ -1,7 +1,8 @@ -// RUN: %check_clang_tidy %s portability-simd-intrinsics %t -- \ +// RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s portability-simd-intrinsics %t -- \ // RUN: -config='{CheckOptions: [ \ // RUN: {key: portability-simd-intrinsics.Suggest, value: 1} \ -// RUN: ]}' -- -target ppc64le -maltivec -std=c++11 +// RUN: ]}' -- -target ppc64le -maltivec +// FIXME: Fix the checker to work in C++2a mode. vector int vec_add(vector int, vector int); diff --git a/clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-x86.cpp b/clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-x86.cpp --- a/clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-x86.cpp +++ b/clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-x86.cpp @@ -1,7 +1,8 @@ -// RUN: %check_clang_tidy %s portability-simd-intrinsics %t -- \ +// RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s portability-simd-intrinsics %t -- \ // RUN: -config='{CheckOptions: [ \ // RUN: {key: portability-simd-intrinsics.Suggest, value: 1} \ -// RUN: ]}' -- -target x86_64 -std=c++11 +// RUN: ]}' -- -target x86_64 +// FIXME: Fix the checker to work in C++2a mode. typedef long long __m128i __attribute__((vector_size(16))); typedef double __m256 __attribute__((vector_size(32))); diff --git a/clang-tools-extra/test/clang-tidy/readability-deleted-default.cpp b/clang-tools-extra/test/clang-tidy/readability-deleted-default.cpp --- a/clang-tools-extra/test/clang-tidy/readability-deleted-default.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-deleted-default.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-deleted-default %t -- -- -std=c++11 -fno-ms-compatibility +// RUN: %check_clang_tidy %s readability-deleted-default %t -- -- -fno-ms-compatibility class NoDefault { public: diff --git a/clang-tools-extra/test/clang-tidy/readability-else-after-return.cpp b/clang-tools-extra/test/clang-tidy/readability-else-after-return.cpp --- a/clang-tools-extra/test/clang-tidy/readability-else-after-return.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-else-after-return.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-else-after-return %t -- -- -std=c++11 -fexceptions +// RUN: %check_clang_tidy %s readability-else-after-return %t -- -- -fexceptions namespace std { struct string { diff --git a/clang-tools-extra/test/clang-tidy/readability-function-size.cpp b/clang-tools-extra/test/clang-tidy/readability-function-size.cpp --- a/clang-tools-extra/test/clang-tidy/readability-function-size.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-function-size.cpp @@ -1,4 +1,12 @@ -// RUN: %check_clang_tidy %s readability-function-size %t -- -config='{CheckOptions: [{key: readability-function-size.LineThreshold, value: 0}, {key: readability-function-size.StatementThreshold, value: 0}, {key: readability-function-size.BranchThreshold, value: 0}, {key: readability-function-size.ParameterThreshold, value: 5}, {key: readability-function-size.NestingThreshold, value: 2}, {key: readability-function-size.VariableThreshold, value: 1}]}' -- -std=c++11 +// RUN: %check_clang_tidy %s readability-function-size %t -- \ +// RUN: -config='{CheckOptions: [ \ +// RUN: {key: readability-function-size.LineThreshold, value: 0}, \ +// RUN: {key: readability-function-size.StatementThreshold, value: 0}, \ +// RUN: {key: readability-function-size.BranchThreshold, value: 0}, \ +// RUN: {key: readability-function-size.ParameterThreshold, value: 5}, \ +// RUN: {key: readability-function-size.NestingThreshold, value: 2}, \ +// RUN: {key: readability-function-size.VariableThreshold, value: 1} \ +// RUN: ]}' // Bad formatting is intentional, don't run clang-format over the whole file! diff --git a/clang-tools-extra/test/clang-tidy/readability-identifier-naming.cpp b/clang-tools-extra/test/clang-tidy/readability-identifier-naming.cpp --- a/clang-tools-extra/test/clang-tidy/readability-identifier-naming.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-identifier-naming.cpp @@ -80,7 +80,7 @@ // RUN: {key: readability-identifier-naming.LocalPointerPrefix, value: 'l_'}, \ // RUN: {key: readability-identifier-naming.LocalConstantPointerCase, value: CamelCase}, \ // RUN: {key: readability-identifier-naming.LocalConstantPointerPrefix, value: 'lc_'}, \ -// RUN: ]}' -- -std=c++11 -fno-delayed-template-parsing \ +// RUN: ]}' -- -fno-delayed-template-parsing \ // RUN: -I%S/Inputs/readability-identifier-naming \ // RUN: -isystem %S/Inputs/readability-identifier-naming/system diff --git a/clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-allow-in-conditions.cpp b/clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-allow-in-conditions.cpp --- a/clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-allow-in-conditions.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-allow-in-conditions.cpp @@ -1,8 +1,7 @@ // RUN: %check_clang_tidy %s readability-implicit-bool-conversion %t \ // RUN: -config='{CheckOptions: \ // RUN: [{key: readability-implicit-bool-conversion.AllowIntegerConditions, value: 1}, \ -// RUN: {key: readability-implicit-bool-conversion.AllowPointerConditions, value: 1}]}' \ -// RUN: -- -std=c++11 +// RUN: {key: readability-implicit-bool-conversion.AllowPointerConditions, value: 1}]}' template void functionTaking(T); diff --git a/clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-cxx98.cpp b/clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-cxx98.cpp --- a/clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-cxx98.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-cxx98.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-implicit-bool-conversion %t -- -- -std=c++98 +// RUN: %check_clang_tidy -std=c++98 %s readability-implicit-bool-conversion %t // We need NULL macro, but some buildbots don't like including header // This is a portable way of getting it to work diff --git a/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-macros.cpp b/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-macros.cpp --- a/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-macros.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s readability-inconsistent-declaration-parameter-name %t -- \ -// RUN: -config="{CheckOptions: [{key: readability-inconsistent-declaration-parameter-name.IgnoreMacros, value: 0}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: readability-inconsistent-declaration-parameter-name.IgnoreMacros, value: 0}]}" #define MACRO() \ void f(int x) diff --git a/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-strict.cpp b/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-strict.cpp --- a/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-strict.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-strict.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s readability-inconsistent-declaration-parameter-name %t -- \ -// RUN: -config="{CheckOptions: [{key: readability-inconsistent-declaration-parameter-name.Strict, value: 1}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: readability-inconsistent-declaration-parameter-name.Strict, value: 1}]}" void inconsistentFunction(int a, int b, int c); // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'inconsistentFunction' has 1 other declaration with different parameter names diff --git a/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp b/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp --- a/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-inconsistent-declaration-parameter-name %t -- -- -std=c++11 -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s readability-inconsistent-declaration-parameter-name %t -- -- -fno-delayed-template-parsing void consistentFunction(int a, int b, int c); void consistentFunction(int a, int b, int c); diff --git a/clang-tools-extra/test/clang-tidy/readability-isolate-declaration-cxx17.cpp b/clang-tools-extra/test/clang-tidy/readability-isolate-declaration-cxx17.cpp --- a/clang-tools-extra/test/clang-tidy/readability-isolate-declaration-cxx17.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-isolate-declaration-cxx17.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-isolate-declaration %t -- -- -std=c++17 +// RUN: %check_clang_tidy -std=c++17 %s readability-isolate-declaration %t template struct pair { diff --git a/clang-tools-extra/test/clang-tidy/readability-redundant-declaration-ignore-macros.cpp b/clang-tools-extra/test/clang-tidy/readability-redundant-declaration-ignore-macros.cpp --- a/clang-tools-extra/test/clang-tidy/readability-redundant-declaration-ignore-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-redundant-declaration-ignore-macros.cpp @@ -1,8 +1,7 @@ // RUN: %check_clang_tidy %s readability-redundant-declaration %t -- \ // RUN: -config="{CheckOptions: \ // RUN: [{key: readability-redundant-declaration.IgnoreMacros, \ -// RUN: value: 1}]}" \ -// RUN: -- -std=c++11 +// RUN: value: 1}]}" extern int Xyz; extern int Xyz; // Xyz diff --git a/clang-tools-extra/test/clang-tidy/readability-redundant-declaration.cpp b/clang-tools-extra/test/clang-tidy/readability-redundant-declaration.cpp --- a/clang-tools-extra/test/clang-tidy/readability-redundant-declaration.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-redundant-declaration.cpp @@ -1,8 +1,7 @@ // RUN: %check_clang_tidy %s readability-redundant-declaration %t -- \ // RUN: -config="{CheckOptions: \ // RUN: [{key: readability-redundant-declaration.IgnoreMacros, \ -// RUN: value: 0}]}" \ -// RUN: -- -std=c++11 +// RUN: value: 0}]}" extern int Xyz; extern int Xyz; // Xyz diff --git a/clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-macros.cpp b/clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-macros.cpp --- a/clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-macros.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-macros.cpp @@ -1,6 +1,5 @@ // RUN: %check_clang_tidy %s readability-redundant-smartptr-get %t -- \ -// RUN: -config="{CheckOptions: [{key: readability-redundant-smartptr-get.IgnoreMacros, value: 0}]}" \ -// RUN: -- -std=c++11 +// RUN: -config="{CheckOptions: [{key: readability-redundant-smartptr-get.IgnoreMacros, value: 0}]}" namespace std { diff --git a/clang-tools-extra/test/clang-tidy/readability-redundant-string-cstr.cpp b/clang-tools-extra/test/clang-tidy/readability-redundant-string-cstr.cpp --- a/clang-tools-extra/test/clang-tidy/readability-redundant-string-cstr.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-redundant-string-cstr.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-redundant-string-cstr %t -- -- -std=c++11 +// RUN: %check_clang_tidy %s readability-redundant-string-cstr %t typedef unsigned __INT16_TYPE__ char16; typedef unsigned __INT32_TYPE__ char32; diff --git a/clang-tools-extra/test/clang-tidy/readability-redundant-string-init-msvc.cpp b/clang-tools-extra/test/clang-tidy/readability-redundant-string-init-msvc.cpp --- a/clang-tools-extra/test/clang-tidy/readability-redundant-string-init-msvc.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-redundant-string-init-msvc.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s readability-redundant-string-init %t +// RUN: %check_clang_tidy -std=c++11,c++14 %s readability-redundant-string-init %t +// FIXME: Fix the checker to work in C++17 mode. namespace std { template diff --git a/clang-tools-extra/test/clang-tidy/readability-redundant-string-init.cpp b/clang-tools-extra/test/clang-tidy/readability-redundant-string-init.cpp --- a/clang-tools-extra/test/clang-tidy/readability-redundant-string-init.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-redundant-string-init.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s readability-redundant-string-init %t +// RUN: %check_clang_tidy -std=c++11,c++14 %s readability-redundant-string-init %t +// FIXME: Fix the checker to work in C++17 mode. namespace std { template diff --git a/clang-tools-extra/test/clang-tidy/readability-string-compare.cpp b/clang-tools-extra/test/clang-tidy/readability-string-compare.cpp --- a/clang-tools-extra/test/clang-tidy/readability-string-compare.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-string-compare.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-string-compare %t -- -- -std=c++11 +// RUN: %check_clang_tidy %s readability-string-compare %t namespace std { template diff --git a/clang-tools-extra/test/clang-tidy/readability-uppercase-literal-suffix-floating-point-opencl-half.cpp b/clang-tools-extra/test/clang-tidy/readability-uppercase-literal-suffix-floating-point-opencl-half.cpp --- a/clang-tools-extra/test/clang-tidy/readability-uppercase-literal-suffix-floating-point-opencl-half.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-uppercase-literal-suffix-floating-point-opencl-half.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-uppercase-literal-suffix %t -- -- -target x86_64-pc-linux-gnu -I %S -std=cl2.0 -x cl +// RUN: %check_clang_tidy -std=cl2.0 %s readability-uppercase-literal-suffix %t -- -- -target x86_64-pc-linux-gnu -I %S -x cl // RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -fix -- -target x86_64-pc-linux-gnu -I %S -std=cl2.0 -x cl // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -warnings-as-errors='-*,readability-uppercase-literal-suffix' -- -target x86_64-pc-linux-gnu -I %S -std=cl2.0 -x cl diff --git a/clang-tools-extra/test/clang-tidy/zircon-temporary-objects.cpp b/clang-tools-extra/test/clang-tidy/zircon-temporary-objects.cpp --- a/clang-tools-extra/test/clang-tidy/zircon-temporary-objects.cpp +++ b/clang-tools-extra/test/clang-tidy/zircon-temporary-objects.cpp @@ -1,7 +1,6 @@ // RUN: %check_clang_tidy %s zircon-temporary-objects %t -- \ // RUN: -config="{CheckOptions: [{key: zircon-temporary-objects.Names, value: 'Foo;NS::Bar'}]}" \ -// RUN: -header-filter=.* \ -// RUN: -- -std=c++11 +// RUN: -header-filter=.* // Should flag instances of Foo, NS::Bar.