Run ClangTidy tests in all C++ language modes
authorDmitri Gribenko <gribozavr@gmail.com>
Mon, 20 May 2019 09:26:47 +0000 (09:26 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Mon, 20 May 2019 09:26:47 +0000 (09:26 +0000)
Summary:
I inspected every test and did one of the following:

- changed the test to run in all language modes,

- added a comment explaining why the test is only applicable in a
  certain mode,

- limited the test to language modes where it passes and added a FIXME
  to fix the checker or the test.

Reviewers: alexfh, lebedev.ri

Subscribers: nemanjai, kbarton, arphaman, jdoerfert, lebedev.ri, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62125

llvm-svn: 361131

141 files changed:
clang-tools-extra/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp
clang-tools-extra/test/clang-tidy/abseil-faster-strsplit-delimiter.cpp
clang-tools-extra/test/clang-tidy/abseil-str-cat-append.cpp
clang-tools-extra/test/clang-tidy/abseil-string-find-startswith.cpp
clang-tools-extra/test/clang-tidy/abseil-time-subtraction.cpp
clang-tools-extra/test/clang-tidy/abseil-upgrade-duration-conversions.cpp
clang-tools-extra/test/clang-tidy/bugprone-dangling-handle.cpp
clang-tools-extra/test/clang-tidy/bugprone-exception-escape.cpp
clang-tools-extra/test/clang-tidy/bugprone-forwarding-reference-overload.cpp
clang-tools-extra/test/clang-tidy/bugprone-inaccurate-erase.cpp
clang-tools-extra/test/clang-tidy/bugprone-move-forwarding-reference.cpp
clang-tools-extra/test/clang-tidy/bugprone-sizeof-container.cpp
clang-tools-extra/test/clang-tidy/cert-err34-c.cpp
clang-tools-extra/test/clang-tidy/cert-msc51-cpp.cpp
clang-tools-extra/test/clang-tidy/cert-oop11-cpp.cpp
clang-tools-extra/test/clang-tidy/cert-setlongjmp.cpp
clang-tools-extra/test/clang-tidy/cert-throw-exception-type.cpp
clang-tools-extra/test/clang-tidy/check_clang_tidy.py
clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-legacy-functions.cpp
clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp
clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-gslheader.cpp
clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic-pr36489.cpp
clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx2a.cpp
clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp
clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
clang-tools-extra/test/clang-tidy/cppcoreguidelines-special-member-functions-cxx-03.cpp
clang-tools-extra/test/clang-tidy/expand-modular-headers-ppcallbacks.cpp
clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-all.cpp
clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-glob.cpp
clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-headers.cpp
clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes.cpp
clang-tools-extra/test/clang-tidy/google-readability-casting.cpp
clang-tools-extra/test/clang-tidy/google-runtime-int-std.cpp
clang-tools-extra/test/clang-tidy/google-runtime-references.cpp
clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-standard-types.cpp
clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise.cpp
clang-tools-extra/test/clang-tidy/misc-new-delete-overloads-sized-dealloc.cpp
clang-tools-extra/test/clang-tidy/misc-new-delete-overloads.cpp
clang-tools-extra/test/clang-tidy/misc-redundant-expression.cpp
clang-tools-extra/test/clang-tidy/misc-throw-by-value-catch-by-reference.cpp
clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator-cxx17.cpp
clang-tools-extra/test/clang-tidy/misc-unconventional-assign-operator.cpp
clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp
clang-tools-extra/test/clang-tidy/modernize-avoid-bind.cpp
clang-tools-extra/test/clang-tidy/modernize-concat-nested-namespaces.cpp
clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp
clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp
clang-tools-extra/test/clang-tidy/modernize-loop-convert-basic.cpp
clang-tools-extra/test/clang-tidy/modernize-loop-convert-camelback.cpp
clang-tools-extra/test/clang-tidy/modernize-loop-convert-const.cpp
clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp
clang-tools-extra/test/clang-tidy/modernize-loop-convert-lowercase.cpp
clang-tools-extra/test/clang-tidy/modernize-loop-convert-negative.cpp
clang-tools-extra/test/clang-tidy/modernize-loop-convert-uppercase.cpp
clang-tools-extra/test/clang-tidy/modernize-make-shared-header.cpp
clang-tools-extra/test/clang-tidy/modernize-make-shared.cpp
clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx11.cpp
clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx14.cpp
clang-tools-extra/test/clang-tidy/modernize-make-unique-header.cpp
clang-tools-extra/test/clang-tidy/modernize-make-unique-macros.cpp
clang-tools-extra/test/clang-tidy/modernize-make-unique.cpp
clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp
clang-tools-extra/test/clang-tidy/modernize-pass-by-value-macro-header.cpp
clang-tools-extra/test/clang-tidy/modernize-pass-by-value.cpp
clang-tools-extra/test/clang-tidy/modernize-raw-string-literal-delimiter.cpp
clang-tools-extra/test/clang-tidy/modernize-raw-string-literal.cpp
clang-tools-extra/test/clang-tidy/modernize-replace-auto-ptr.cpp
clang-tools-extra/test/clang-tidy/modernize-replace-random-shuffle.cpp
clang-tools-extra/test/clang-tidy/modernize-return-braced-init-list.cpp
clang-tools-extra/test/clang-tidy/modernize-unary-static-assert.cpp
clang-tools-extra/test/clang-tidy/modernize-use-auto-cast-remove-stars.cpp
clang-tools-extra/test/clang-tidy/modernize-use-auto-cast.cpp
clang-tools-extra/test/clang-tidy/modernize-use-auto-iterator.cpp
clang-tools-extra/test/clang-tidy/modernize-use-auto-min-type-name-length.cpp
clang-tools-extra/test/clang-tidy/modernize-use-auto-new-remove-stars.cpp
clang-tools-extra/test/clang-tidy/modernize-use-auto-new.cpp
clang-tools-extra/test/clang-tidy/modernize-use-bool-literals-ignore-macros.cpp
clang-tools-extra/test/clang-tidy/modernize-use-bool-literals.cpp
clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-assignment.cpp
clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-bitfield.cpp
clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-macros.cpp
clang-tools-extra/test/clang-tidy/modernize-use-default-member-init.cpp
clang-tools-extra/test/clang-tidy/modernize-use-emplace-ignore-implicit-constructors.cpp
clang-tools-extra/test/clang-tidy/modernize-use-emplace.cpp
clang-tools-extra/test/clang-tidy/modernize-use-equals-default-copy.cpp
clang-tools-extra/test/clang-tidy/modernize-use-equals-default-delayed.cpp
clang-tools-extra/test/clang-tidy/modernize-use-equals-default-macros.cpp
clang-tools-extra/test/clang-tidy/modernize-use-equals-default.cpp
clang-tools-extra/test/clang-tidy/modernize-use-equals-delete-macros.cpp
clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-clang-unused.cpp
clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp
clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-gcc-unused.cpp
clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro-inscope-cxx11.cpp
clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-no-macro.cpp
clang-tools-extra/test/clang-tidy/modernize-use-noexcept-macro.cpp
clang-tools-extra/test/clang-tidy/modernize-use-noexcept-opt.cpp
clang-tools-extra/test/clang-tidy/modernize-use-noexcept.cpp
clang-tools-extra/test/clang-tidy/modernize-use-nullptr-basic.cpp
clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp
clang-tools-extra/test/clang-tidy/modernize-use-override-cxx98.cpp
clang-tools-extra/test/clang-tidy/modernize-use-override-ms.cpp
clang-tools-extra/test/clang-tidy/modernize-use-override-no-destructors.cpp
clang-tools-extra/test/clang-tidy/modernize-use-override-with-macro.cpp
clang-tools-extra/test/clang-tidy/modernize-use-override-with-no-macro-inscope.cpp
clang-tools-extra/test/clang-tidy/modernize-use-override.cpp
clang-tools-extra/test/clang-tidy/modernize-use-trailing-return-type.cpp
clang-tools-extra/test/clang-tidy/modernize-use-transparent-functors.cpp
clang-tools-extra/test/clang-tidy/modernize-use-uncaught-exceptions.cpp
clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp
clang-tools-extra/test/clang-tidy/objc-no-arc-or-properties.m
clang-tools-extra/test/clang-tidy/openmp-use-default-none.cpp
clang-tools-extra/test/clang-tidy/performance-for-range-copy-allowed-types.cpp
clang-tools-extra/test/clang-tidy/performance-for-range-copy-warn-on-all-auto-copies.cpp
clang-tools-extra/test/clang-tidy/performance-for-range-copy.cpp
clang-tools-extra/test/clang-tidy/performance-inefficient-algorithm.cpp
clang-tools-extra/test/clang-tidy/performance-inefficient-vector-operation.cpp
clang-tools-extra/test/clang-tidy/performance-move-const-arg-trivially-copyable.cpp
clang-tools-extra/test/clang-tidy/performance-move-constructor-init.cpp
clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-header.cpp
clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp
clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-ppc.cpp
clang-tools-extra/test/clang-tidy/portability-simd-intrinsics-x86.cpp
clang-tools-extra/test/clang-tidy/readability-deleted-default.cpp
clang-tools-extra/test/clang-tidy/readability-else-after-return.cpp
clang-tools-extra/test/clang-tidy/readability-function-size.cpp
clang-tools-extra/test/clang-tidy/readability-identifier-naming.cpp
clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-allow-in-conditions.cpp
clang-tools-extra/test/clang-tidy/readability-implicit-bool-conversion-cxx98.cpp
clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-macros.cpp
clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name-strict.cpp
clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
clang-tools-extra/test/clang-tidy/readability-isolate-declaration-cxx17.cpp
clang-tools-extra/test/clang-tidy/readability-redundant-declaration-ignore-macros.cpp
clang-tools-extra/test/clang-tidy/readability-redundant-declaration.cpp
clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-macros.cpp
clang-tools-extra/test/clang-tidy/readability-redundant-string-cstr.cpp
clang-tools-extra/test/clang-tidy/readability-redundant-string-init-msvc.cpp
clang-tools-extra/test/clang-tidy/readability-redundant-string-init.cpp
clang-tools-extra/test/clang-tidy/readability-string-compare.cpp
clang-tools-extra/test/clang-tidy/readability-uppercase-literal-suffix-floating-point-opencl-half.cpp
clang-tools-extra/test/clang-tidy/zircon-temporary-objects.cpp

index d32837f80ee804a7c8289b23ffb5d887fbbf80a9..886722eb3e9637f83931887c912a44cb5f72437d 100644 (file)
@@ -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"
 
index 5895e45a9c7eaf1bf440f3519e688bc31802e9fa..3e73d3f36cb11999fa1f9aa5957d96039e55d986 100644 (file)
@@ -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 {
 
index 5ecb284df4b33afbc44d034429aae4a6f2980387..9a2585da5b2779a968c0c7aaaf7ffbe9597432e5 100644 (file)
@@ -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;
index 7d5fd73cb2b4d8884af8a79656376528f8047bb8..89365bfa1f8157f537a1867efab395d07cfebad6 100644 (file)
@@ -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 <typename T> class allocator {};
index 6f5d4b45af9760ed6fb6b713c5ec861514c79347..4cc738c2af2a2b53767802e557a8acb958e78a49 100644 (file)
@@ -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"
 
index fed0f8bd773d15578467d558cc6b75a6d9450c88..54d683ae240144a4b71e2c99c563e05d2faa23c9 100644 (file)
@@ -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;
 
index d11a2f2d6503149904a3c1114fb99a5003ef8326..d3caf73b88c14c38870d45d111d5155f0f467643 100644 (file)
@@ -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 {
 
index eba14bfcf0354cbcad97594ecf12dd3193bda9de..ebb44f84f67ccb7c0a35816fd5e1ca04570de3b4 100644 (file)
@@ -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() {
index cb842e3e8ae13d0c0048ed5d081920ec088972bc..e5d0ba395d1431207438c4d52f91faa8279327e2 100644 (file)
@@ -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 <bool B, class T = void> struct enable_if { typedef T type; };
index d29fa9cdd4e9b19dac97bed5e2c8fbfda5f4efa1..eff57eaabf7ac1ee368dfe2c308c075dd88c0261 100644 (file)
@@ -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 <typename T> struct vec_iterator {
index befca292de812396a08321882442def569451bb8..68eeb126b5dfa25f2691590bdf73664954aedb63 100644 (file)
@@ -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 <typename> struct remove_reference;
index 27798d6c39825f94d8efb707eac3d3ab131a07ce..b45183de895a2c7190adb04e0bf4dcc6c60e0992 100644 (file)
@@ -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 {
 
index dde7dc1cab210ecf5192ea71bdeb84f0363ff9c6..1c358bc3fb54c09c4bd115a39e83543c9de1f192 100644 (file)
@@ -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;
 
index 8a8d778e2eae6296b1cd3ba189688cf8b5e5caf6..4aec74b1ed7405cfea6a53fd8cf970b96d04921c 100644 (file)
@@ -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 {
 
index 650d6ec311de5878967d581b5feaf020afbe3985..f7f3a648675989a8ba775c7adc985715e018b70a 100644 (file)
@@ -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;
index 1bf5444ffcc157d48386ac64b78e4d05dcaa65c9..88d1db35f6b6ac5998b1bd39492289dc5f37af05 100644 (file)
@@ -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);
index 2ff9be5df5d93f4a0bacb65b7fe6b3cb050fc136..bc0ecc808b295da8eea583db30f1de266752017f 100644 (file)
@@ -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 {};
index ceacf0a69d2953549cf177e3cfd2b00da1009f3b..aa6304baef813af13ff4c74c677693eccfd23097 100755 (executable)
@@ -38,29 +38,15 @@ def write_file(file_name, text):
     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 @@ def main():
       [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 @@ def main():
       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()
index 5785e9f7d0cda13aa6b5014eb9cff49794ca348d..d5bfcbc31c907d8ff1c32133612d4a35622531b1 100644 (file)
@@ -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 <class T>
index ad9fcd97daa4fd28b324fb8258697a43529d7ba1..ad1cc5ab897d94d16104311dbaeb1307595f008b 100644 (file)
@@ -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 @@ template <int index> struct B {
   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];
 };
index a88a2d9e9ce829685e0aed604d4b68e8ee374535..71b957d84740b85d78d29f03ab6d20ec9728bafe 100644 (file)
@@ -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;
index 47109522667be343111c017a1c56018f02a92917..faab2a1ccf0e1eb5c9c0667f36df070cc3c2f5a9 100644 (file)
@@ -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();
index d3e3ade3861a31d13da85efbec43e456ba9252b0..3b384c24b848a0ac85d666471a7733c605298dde 100644 (file)
@@ -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() {}
index db97bb456864c6584f26cc9b57863bbc7a8c60aa..6e47123568f451ed5be4b54e079c380798e86ea5 100644 (file)
@@ -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;
index 86f094de8dec1389303b1d19f8801a143401011f..7daf9dfeaeb44e1a156b35e56721656181ee0195 100644 (file)
@@ -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;
index 8fe5e429dbfa2b98c8d526dd775b087a4ff4d78c..10f3955846d714ef80a8996df3e5cca2beb81bba 100644 (file)
@@ -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();
index d191922de27eb818da9405b5d41c0671e07ce771..c9b05517d210cebb7e8c543d39243a62068d1314 100644 (file)
@@ -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:   -- -%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]
index 21f4b68b9c8d74fcbd99119baf630236ad86ab6d..d521c1358dba6536efa70aafa2403faef2044daa 100644 (file)
@@ -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 <cstdlib.h>
 // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include cstdlib.h not allowed
index 334990dd84dd5fd14a3d9d8f8d10a2a45d7252a5..104f3689246c0f488947800b079a0d2af3f7e707 100644 (file)
@@ -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 <cstdlib.h>
 #include <cstdarg.h>
index f392eacc9a9762a1ce547eec0b7782956c563a61..b9c00e2a105aff210b9b5c7f13d7130040b304fa 100644 (file)
@@ -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 <r.h> and <t.h>
 #include <transitive.h>
index e2ba71060c38eb2bcd4c2908a0e232f1dfdf2761..c36640822b444f121d8e86c9ee8b6d344b25b225 100644 (file)
@@ -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"
 
index d36fef6fc94ecb13618d10c6bc02ffbf22a7177d..ffec0f89dabcb2a29de8bca1e90173ca127917d3 100644 (file)
@@ -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; }
 
index c5d3112075cf089b972094444df36c437117d71b..e5cdb3ec048e2ec7e431305712248fe031a534d3 100644 (file)
@@ -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'
index b9f84b62955860b4e6209fac60eb71278382dc79..2abd5afc75eaadbc18179deb383c7b85b348ecc8 100644 (file)
@@ -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;
index c85fe20ca77f1e79933af2c0addf7e4d78812fcb..b88b266ff4bbe478163d7a724a06bdbd69f670d4 100644 (file)
@@ -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"
 
index 97a24b6bca93590cbbeff58319e1a55aa518c899..58cc911d108ea8444c84c97f0df3e7cad87078de 100644 (file)
@@ -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 {
index 2ba60e46fa9d0ec57a5a48e1f9148f93d5e377c4..69867882797cdf715d6a84fb8949a9450ca7095d 100644 (file)
@@ -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;
 
index 3e60537ef65d8e791b85c8c1007894668fa861fd..78f021144b2e19c1d8f91534cf0c6b0242e8dec7 100644 (file)
@@ -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;
 
index 3454318148d2ed1ddb137a18b314f9e90db81df1..becec875c0940c3902ad45bf7707f44ab9801d89 100644 (file)
@@ -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;
 
index 120b07eecc71ef93dfd6dc258fa1f8eb8acea0a7..269ef90f38fb82680c7557b0132606b12c43ee68 100644 (file)
@@ -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 {
index ba1a685842ef7099cbee348273cd8d7b9cf9aa33..d6e9ebe49a97791335306813f6aa6731d1c2dcfd 100644 (file)
@@ -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;
index 4bd9cb2f2d6bb659cc90f178b0ea5aab34afe399..a0a37c0ff1c7a0c82ceeb6caac8e75974a12cfc8 100644 (file)
@@ -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 <typename T>
index ec1ee2d01194b937259296807c19ed58321361dd..119eff67318eab48e58fd10de003ea48acb2fab8 100644 (file)
@@ -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
index 721801bef11d088ce7ad455d6f5cdc745b4715e3..fa60cdc2c9d08363849bf7d1403fd29b5a3b7c58 100644 (file)
@@ -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 {
index 22a92f6016dea4186bc9ed4d98a3d11bf9b4ab55..dcde32d0f06904ee7fed3a9b1f7d4181af1e7a45 100644 (file)
@@ -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 {}
 
index c604ba4fcc289ccc64a96db279c0c19b3931346a..4511f46d57b33ed5d8b6d6579045641dbce00dde 100644 (file)
@@ -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 <assert.h>
 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead [modernize-deprecated-headers]
index 366f04538dea6dd63265bad4734dcbdfefc54a80..c3374a9123bd1dc90cd1b256856bb07870a6a7e9 100644 (file)
@@ -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 <assert.h>
 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead [modernize-deprecated-headers]
index 0cd108789088493a59801b2bd243abd9a67287b2..06b1b739632f0dca35452f06c3cb230efd4b1477 100644 (file)
@@ -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"
 
index 50044de666500ac37c8c613877b868e5ce624f01..42c492f58b5a56318ea25180a4167681ffae4d61 100644 (file)
@@ -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"
 
index 806b6c11f9c226fc3b095a37da4a9368f6116d1f..fd3bddedd567521e570fa05a4074cbb3ce08e047 100644 (file)
@@ -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;
index d7011f711e1816a0c050296b27b2165434fe2aca..d57c335d922bc87001e4a12ff2f593e23b3d6d12 100644 (file)
@@ -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"
 
index c7bb22132ef01c3307f3052ead504d7eddbe80c6..1389376b2e4d790deed9dd766d407cb56bac1ee6 100644 (file)
@@ -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"
 
index c038437298ec3f48544b600d0dae0ebc7f290eae..607baaed5dd3895637affd18ea93d27b4cc4c92e 100644 (file)
@@ -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"
 
index 4d1d5c2fd590ef93e09e0258147f4b61ccd54e2e..09e5f45ed040263aac964869a0b42b1e8e7caea7 100644 (file)
@@ -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"
 
index 21b07ee4496476353d042fe7df025d97766a2f97..8f293312f0d6b940eaee143be47333f017ce9089 100644 (file)
@@ -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:   -- -%S/Inputs/modernize-smart-ptr
 
 #include "shared_ptr.h"
 // CHECK-FIXES: #include "make_shared_util.h"
index 49012dc1858ec9b7cfae78f90536c03e874b1748..e046801e24212f698d611ad635426a9b9d0b2f86 100644 (file)
@@ -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 <memory>
index 89beb0813cb42509432dacaa9017560ea67a6aa8..9cd58b4198fc7bc3777446c396e21561a31f1bc7 100644 (file)
@@ -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"
index cd35f751bb439dd86af2dc65c7b8874923406809..96173710d7fd3f4ce1ee0334879254c80729eca1 100644 (file)
@@ -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 <memory>
index e6c2a613d9f3f023664f3343a48129c68d1d8052..88d82d6b38c7c715afa6d8f852f570dd8c710462 100644 (file)
@@ -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:   -- -%S/Inputs/modernize-smart-ptr
 
 #include "unique_ptr.h"
 // CHECK-FIXES: #include "make_unique_util.h"
index 117a45cb6d4f70dc05c7c57cdfad88c88d238d3c..3a7da9112605111052d44d20b6befbda0b883070 100644 (file)
@@ -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:   -- -%S/Inputs/modernize-smart-ptr
 
 #include "unique_ptr.h"
 
index 9ec5d194eb6d1813edd0c433f7da9719ac0c27b8..3b7a3de43ac5f88d86c8557697fcab3f3ffb412d 100644 (file)
@@ -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"
index 95ad623dca2b74bdad485c764eff598eca959c6a..992ad27c61fdfc8c5b6ae31c941da90485379aae 100644 (file)
@@ -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]
index 543b7e4651da31b0b57bc6508f2a2f52b6fd7694..5bfe680f58353b08ef6675a6f273b1b3c43a47d8 100644 (file)
@@ -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 <utility>
 
index 87e22ba170cdb4827bd3faffc65d07aa7c5f7494..6bf68ca0b6ab211f2312f6f9ece1fa80a35d2f9a 100644 (file)
@@ -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.
index 1dd3e1321aa1b3c3b58cd30541b24f8982d51ac8..2507a6f69745ff7e4e458fbd59275b14dbb149b3 100644 (file)
@@ -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
index b6d499513bf22e0cebeda0a913b868a3980ed290..0fb0db10181505c03d2d8c6d7cadda874dd10203 100644 (file)
@@ -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]
index 13405b2a206a9586ffe629366bed072902e9831b..c54ba1c75c69bf46e1482d8dfa381abccd9ddbcb 100644 (file)
@@ -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 <utility>
 
index 019471e2a3ebef04bf25e8f1cefedf2cb68c1bf9..f96a60b377873870242bd69964b46b9a7f1df07b 100644 (file)
@@ -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 <random>
 
index 49a41ae18cf8b2875424adbdffc713e9d4ab014f..29d81c6df1f02670850a793fe67353508b7c5e54 100644 (file)
@@ -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;
index fd39d5be527f8f38f3143defc1c4fa343fefd6f0..97ad94834cd0e6d331b95d9668cf5baeaffe71b9 100644 (file)
@@ -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 ""
index 97b87b8421a9bed706c62df7ad9c214e79075046..5fbc243c66a392ec02174004316c39c18e85704f 100644 (file)
@@ -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() {}
index e07c9cbf6003d9dd2267457e59565215fbbd7bd3..47c12471fec69af9c25be35f289ab479682c5bba 100644 (file)
@@ -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() {}
index 98117fc544b14da6810024b1098b1ddefbc94d5a..9690972a97ce9d140e6f0f42de29d1f98b0ef2c7 100644 (file)
@@ -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"
 
index 1cd91582b970f93ae004482e2852cd49c0fd089e..dd79ad416ed864d66dd3773cace2ce55cb04ce17 100644 (file)
@@ -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 <class T> extern T foo();
 template <class T> struct P {  explicit P(T t) : t_(t) {}  T t_;};
index 00e3c8951941202b5187b5190061a06ea9d8d4ee..3eb1bf9d76978a6680f558ba470c5b8b4e770d4b 100644 (file)
@@ -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 {};
 
index 3c872c986bcbeeb1a223d96574eb0c87a7879050..c9a438971cfd35990009627aa888c2b50ee1119e 100644 (file)
@@ -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 {};
 
index cf8f72c976449cdceadf6918c0f7a6c1ece902e5..fc0ec47186a334bb26cb55d20cdd1c1eebed5a96 100644 (file)
@@ -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]
index f2ab9ce438ae1a6f16fe5be7c98f5749bbf02610..a6b66be92a07e3e0e56c83f9ef820556131fd37c 100644 (file)
@@ -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]
index b98055c9f44ad11bdbc9bc913b0e229072fd6ebe..f27a95bcc30c39412ea1b624879bbe8f69463860 100644 (file)
@@ -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 {
 };
index 1ff08f97d416b46122c31881453d09ddcbdbc6c1..2eaf8f8a62e8f164a45080f083d62a165a7767af 100644 (file)
@@ -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
 {
index 5b366b57d1109e04987eb6720fed7bae7b8a837c..62be60c976806c573326d313550559a03bc30145 100644 (file)
@@ -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 { \
index 825bfa0bfbeed67e9c50448d283ddbb0148c56a4..5af9855835ca51d234ee97bf8c95e0e1e59c58b0 100644 (file)
@@ -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 {
 };
index 2f6b37f3e9fd9f75efd65b8c1320c7e28df89428..538b641c03c8f09dc2756e2ad9e83390a307e876 100644 (file)
@@ -2,7 +2,7 @@
 // RUN:   -config="{CheckOptions: \
 // RUN:             [{key: modernize-use-emplace.IgnoreImplicitConstructors, \
 // RUN:               value: 1}] \
-// RUN:             }" -- -std=c++11
+// RUN:             }"
 
 namespace std {
 template <typename>
index c03d0241e201ed10088367487461c3ee237c9b49..4e74d49d33fb7b3f7342f2e77e479e8d2132dcfe 100644 (file)
@@ -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 <typename>
index 39a864d6651ab82b174f4dec03d06f0cdd9d9761..8aa80d8a957f04ae962dc6b7f7571ff437fbe212 100644 (file)
@@ -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 {
index 953d88a9b79dedca777d50c0da27fa8be8ca4a11..f39efd8452f7945a493fa21dff4036f74bb8a38c 100644 (file)
@@ -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 <typename Ty>
 struct S {
index 2277a862a22c96322ce935bbb7dc661c8eb77528..a660f81e2935e8365dcb04e908d00e3e78562b3b 100644 (file)
@@ -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 {                          \
index 8fa15ff65a555f583b8f1b94573ebf1d64250066..c214f6a573946d765d03b393b50e869639779c49 100644 (file)
@@ -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 {
index 1b5a89cca4e78812ea7a20ce7bbab04c002acdd4..f20804f1e598c50b443b94301ec732f1ef99df03 100644 (file)
@@ -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 {
index 0951e6118d4a2250ff398540b33374afdd5dadcd..0d29a03227494334d27b51fc5c2450f8853a66e9 100644 (file)
@@ -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
 {
index cbf0cead0559c39dae4c6687ec7b6e8bd5b5d3a9..8c75043a06414b4cef878501342db339e8c2222f 100644 (file)
@@ -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
 {
index 54b808ed726b63ca941acd0432cdd3f402799c5a..7ddcb7aff380cc750702a6be69c572834b088a6c 100644 (file)
@@ -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
 {
index 0564a1336031dc3174235b5f918ee67e48bb798e..5ac821ad466fe019082a35c9f7b493fc1ce1e299 100644 (file)
@@ -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))
index 7898b6ede343334e479e158058f32df175a6a33d..578df3665f89c54bf3d95a9937cc89339c8cbaf8 100644 (file)
@@ -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
 {
index 3948b66000f90d9c4333be532156f349104ea74f..77b59cf51dfa31407f6eef09986ac3ebff859f10 100644 (file)
@@ -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))
index 85a83c81d07288716b406bb970c6193ff5f72165..92c1387d64d66386e117503cfa85ef1ced4e6b08 100644 (file)
@@ -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 {};
index 58c764ab90f9005c4fb952b369e3bd5f6c1a27c9..863a4ed9a6fc0c1cf716f4e4608be7b43ff5fb5e 100644 (file)
@@ -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 {};
index 7a953a70c7779bef80357c81b9a2ff2fa6326b64..5fd823b754e622fc1c83a653439b0d04ababdc5a 100644 (file)
@@ -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
index 878c11473c92a1dadfd5e68aaef459128a733e2a..d7b78ac9c3f644ff442cb349ce1c9c40c2659567 100644 (file)
@@ -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
 
index bc162d63a60a4e538781fe2e6ecca0d27a4b2ee2..aaa9d35cdef57732f0648ed073e0624fd5631fbf 100644 (file)
@@ -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() {}
index 0cee91708375fca6fc7a3b870912dec8295eea32..e7c00895860c212d1ec1ca3865180dbc3c5b16b3 100644 (file)
@@ -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)
index eaadb07b947b383f7b8c207cf122315cdd613883..aa8ee42eb84f0b2c495cb23422f05af897017487 100644 (file)
@@ -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();
index ad682f1559136228b66265269fc75665b9ba53ac..37013adaff808ff100fb4e3f784f8da165273941 100644 (file)
@@ -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
 
index 97b71053d333fb523c4ff7db6d9dc4f413e4399f..f0cbdc5c2b17941501da7e57f3470b97602e706d 100644 (file)
@@ -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
index 24aafe5c4698cc252d169b1e6479c01aa63fe9b1..8e4e113e4f43141e979ac76b6b421ed0bd56ecc0 100644 (file)
@@ -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
 
index cc48415c668310b3e26f781a180783cb75fc6e26..5f0dac3006cfd3427db5b7baee5c26d989b0c874 100644 (file)
@@ -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 <typename T>
index 3efa916b247f2bb0f32d73568039171be0bf671f..dde427a79201de995cd6d5385019adf58641d2f0 100644 (file)
@@ -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<class T>
index e6bae2bcbbfd895454d35d7e0fbf79474df21d22..8f399c21ca0e631bd54c96e9ffcbcc2b419f5fa0 100644 (file)
@@ -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
 
index 5d88d1d0b1daf44235c204b5ea323d21b7f2da2f..93a50eb5ba0952cbb2a7d50941f8caaaf49e5d40 100644 (file)
@@ -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
 
index c1e73edeb868a392a9ea5e62be1f98a2ff370297..596e8737ddca51e43488e57e20a351f81cfcba2f 100644 (file)
@@ -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.
index 1a374bde94af582e2cc2d8dc857ad683f78487d1..1e388ed0860b13abea1dcfbf481a28cba75c4ea6 100644 (file)
@@ -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.
index a3e7a6bf2c98ed6b30f08f252e8536b19b13afe5..c40347c6d355835b11ffde9b4b62f033068a15a3 100644 (file)
@@ -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 <typename T>
 struct Iterator {
index 75655a6fffb782218e4cd39e50687fcd684aff7e..99d23a971f5625631ca94e8d6559871a224ba105 100644 (file)
@@ -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 <typename T>
 struct Iterator {
index 5e174fad90137be1d0420bc25313044096814d67..e51142161ed905eaae18a7ebb2c5a3ced681dc64 100644 (file)
@@ -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 {
 
index 19a6701c5b6aa7510b1b7088baa15a04f1045a40..aa4e30d6f3fece3e9f0cd16bab516e32b39af6f6 100644 (file)
@@ -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 <typename T> struct less {
index a04f66e7f7349c97c84904cf5d4dc5b8c1cd9919..d5e38eb71f83568ae8b666ce7e6ae9fb6bd6410e 100644 (file)
@@ -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 {
 
index ea0c2fc71309bf7d8440ea85777dfbbde12758bc..2bf1de46de86521520b8841630c00f7abb112528 100644 (file)
@@ -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 {
 
index 09108fcca357ead0972c5c52eb412b97ae5e779a..ddc1107d14c49fc65e7fa719f558f1bb56bcde2d 100644 (file)
@@ -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 <s.h>
 
index 9e4c24650f6cbc1c246bf1eebe94df8e16bbc951..6c09fca330b8f069e7d837de052f2865ab622a55 100644 (file)
@@ -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"
 
index cd8c4daccb00d2c04fd5be0ff954fb23a3df4ad7..e46163a3e231503658708b063d24de72ed7cab74 100644 (file)
@@ -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.
index be0ef760d8d474b71284bb394dfbc40a04909ba9..e8700bc15d7e419c53766aa01224c3fe2cbae529 100644 (file)
@@ -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);
 
index 1fb22891f8ee320e1e7a725e62658df3f219a3be..3ec64e0f713242afefc97b0af805690e451b2a6d 100644 (file)
@@ -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)));
index bf27e00135958f398031a41edcf32464352f65cf..232f224128a69e7221201bcf9798f4f72dc8489c 100644 (file)
@@ -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:
index b06c02c9c6293a7587126516c287fdc19927a007..f9e52e012430a39ef71953bf4c7f4d6ae13b0f74 100644 (file)
@@ -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 {
index efb41a19cbb083d0b87cf3363fe807a56af96337..9c52f1e6e1cf7c14884f3c79e5fbf66c2e623878 100644 (file)
@@ -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!
 
index 211a28bccfcdc97fbd826e90d8bd19b37e032e48..ec508ecab25a01ec1ba689d1a2918a0cebcaf814 100644 (file)
@@ -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
 
index c50b7984effd00bd6372e6d57ccdfa4ac83831d7..bd149ef584482373b40e71d27e9084ce7f3b88f5 100644 (file)
@@ -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<typename T>
 void functionTaking(T);
index 587f7e259d74ac3a4cb483267614f30a530af7ba..861677ac6c3037c925c7352a352c8d52f3fe7355 100644 (file)
@@ -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 <cstddef> header
 // This is a portable way of getting it to work
index ed05faca4154e6797a2ec9de9a2a96a4f6b35364..4dcf99ec8ef3ddba3d6f1cd9bf8d47af09293d14 100644 (file)
@@ -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)
index 90ac45fd4b4e9488a4ff31cf620f3ada48be5c40..a02492b673ae656bef728c213648c852145976f2 100644 (file)
@@ -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
index c98258bd9314300955a9b3ac1177e41b0e61f9b5..f00ebfa896a5f9899b30bb4119e29c086e032f92 100644 (file)
@@ -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);
index 623eafeee5fb3c7b94ff24b78d746360e05a44be..ac2652771a81bfcd1eb31d92c020f516c222ab53 100644 (file)
@@ -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 <typename T1, typename T2>
 struct pair {
index 2dc86182606b3659e989adf7f18a9fd07cde9804..8e556f5d26b782a9525c51ffeb6640d03c0bff64 100644 (file)
@@ -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
index 121ee0c73c2804b0309d506d92d18f4cf22e15ee..2a3dd7a1d65bcc810addd007021b77e0f0d91a07 100644 (file)
@@ -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
index 79e4d9224bc09edcb3f1d1e341a77b62bd208590..91af3fcec61f404afec0111741cc1106bc58399c 100644 (file)
@@ -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 {
 
index 976a54f7f3a61ae0fc0f6871eed9700772982ecf..d8434d3ca7c5a350ae27020afe80a25695fc237b 100644 (file)
@@ -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;
index 0299519a508efcc70132b314286279cef1ca998a..fe05845db6639c0de28db2378368e65b2792cfe1 100644 (file)
@@ -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 <typename T>
index 4455ad44d050f526ab6d1fe8e6bde5473a7bbb00..b88e4a0f4d625c9b902ebe817d8e81101d08a855 100644 (file)
@@ -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 <typename T>
index 9bd11dab453328c8a70e071474c26f824be840c3..45114edf2f0b7d38e7d3bc59189c8c0d971b1987 100644 (file)
@@ -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 <typename T>
index 96d2eb086a9a4730929dfe6bcf1746a9c3e393b2..8cea2a4d827cbc55e00576b5ea9944c5e9b84ac2 100644 (file)
@@ -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
index b29b4821abd26c001002412962a8f2c6d6991363..6090fe9e9acfc4e5e48d5c0797a35be56e8c6e66 100644 (file)
@@ -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.