[clang-tidy][NFC] Update tests to specify CheckOptions using new syntax
In D128337, The spelling of CheckOptions was updated to support a more natural dictionary syntax. This patch is just updating all test files to use the new syntax. Reviewed By: PiotrZSL Differential Revision: https://reviews.llvm.org/D130209
This commit is contained in:
committed by
Piotr Zegar
parent
0f99bc2d68
commit
e8a3ddafe0
@@ -1,5 +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: -config="{CheckOptions: {abseil-string-find-startswith.StringLikeClasses: '::std::basic_string;::basic_string'}}"
|
||||
|
||||
using size_t = decltype(sizeof(int));
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s abseil-string-find-str-contains %t -- \
|
||||
// RUN: -config="{CheckOptions: []}"
|
||||
// RUN: %check_clang_tidy %s abseil-string-find-str-contains %t --
|
||||
|
||||
using size_t = decltype(sizeof(int));
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy -check-suffix=OLDCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL1.2 -c -DOLDCLOLDAOC
|
||||
// RUN: %check_clang_tidy -check-suffix=NEWCLOLDAOC %s altera-single-work-item-barrier %t -- -header-filter=.* "--" -cl-std=CL2.0 -c -DNEWCLOLDAOC
|
||||
// RUN: %check_clang_tidy -check-suffix=OLDCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL1.2 -c -DOLDCLNEWAOC
|
||||
// RUN: %check_clang_tidy -check-suffix=NEWCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: [{key: altera-single-work-item-barrier.AOCVersion, value: 1701}]}' -header-filter=.* "--" -cl-std=CL2.0 -c -DNEWCLNEWAOC
|
||||
// RUN: %check_clang_tidy -check-suffix=OLDCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: { altera-single-work-item-barrier.AOCVersion: 1701}}' -header-filter=.* "--" -cl-std=CL1.2 -c -DOLDCLNEWAOC
|
||||
// RUN: %check_clang_tidy -check-suffix=NEWCLNEWAOC %s altera-single-work-item-barrier %t -- -config='{CheckOptions: { altera-single-work-item-barrier.AOCVersion: 1701}}' -header-filter=.* "--" -cl-std=CL2.0 -c -DNEWCLNEWAOC
|
||||
|
||||
#ifdef OLDCLOLDAOC // OpenCL 1.2 Altera Offline Compiler < 17.1
|
||||
void __kernel error_barrier_no_id(__global int * foo, int size) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s altera-unroll-loops %t -- -config="{CheckOptions: [{key: "altera-unroll-loops.MaxLoopIterations", value: 50}]}" -header-filter=.*
|
||||
// RUN: %check_clang_tidy -check-suffix=MULT %s altera-unroll-loops %t -- -config="{CheckOptions: [{key: "altera-unroll-loops.MaxLoopIterations", value: 5}]}" -header-filter=.* "--" -DMULT
|
||||
// RUN: %check_clang_tidy %s altera-unroll-loops %t -- -config="{CheckOptions: {altera-unroll-loops.MaxLoopIterations: 50}}" -header-filter=.*
|
||||
// RUN: %check_clang_tidy -check-suffix=MULT %s altera-unroll-loops %t -- -config="{CheckOptions: {altera-unroll-loops.MaxLoopIterations: 5}}" -header-filter=.* "--" -DMULT
|
||||
|
||||
#ifdef MULT
|
||||
// For loops with *= and /= increments.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s android-comparison-in-temp-failure-retry %t -- -config="{CheckOptions: [{key: android-comparison-in-temp-failure-retry.RetryMacros, value: 'MY_TEMP_FAILURE_RETRY,MY_OTHER_TEMP_FAILURE_RETRY'}]}"
|
||||
// RUN: %check_clang_tidy %s android-comparison-in-temp-failure-retry %t -- -config="{CheckOptions: {android-comparison-in-temp-failure-retry.RetryMacros: 'MY_TEMP_FAILURE_RETRY,MY_OTHER_TEMP_FAILURE_RETRY'}}"
|
||||
|
||||
#define MY_TEMP_FAILURE_RETRY(x) \
|
||||
({ \
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-argument-comment.IgnoreSingleArgument, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentBoolLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentIntegerLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentFloatLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentStringLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentNullPtrs, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentCharacterLiterals, value: true}]}" --
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: bugprone-argument-comment.IgnoreSingleArgument: true, \
|
||||
// RUN: bugprone-argument-comment.CommentBoolLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentIntegerLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentFloatLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentUserDefinedLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentStringLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentNullPtrs: true, \
|
||||
// RUN: bugprone-argument-comment.CommentCharacterLiterals: true}}" --
|
||||
|
||||
struct A {
|
||||
void foo(bool abc);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-argument-comment.CommentBoolLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentIntegerLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentFloatLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentStringLiterals, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentNullPtrs, value: true}, \
|
||||
// RUN: {key: bugprone-argument-comment.CommentCharacterLiterals, value: true}]}" --
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: bugprone-argument-comment.CommentBoolLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentIntegerLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentFloatLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentUserDefinedLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentStringLiterals: true, \
|
||||
// RUN: bugprone-argument-comment.CommentNullPtrs: true, \
|
||||
// RUN: bugprone-argument-comment.CommentCharacterLiterals: true}}" --
|
||||
|
||||
struct A {
|
||||
void foo(bool abc);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" --
|
||||
// RUN: -config="{CheckOptions: {StrictMode: true}}" --
|
||||
|
||||
void f(int _with_underscores_);
|
||||
void g(int x_);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-assert-side-effect %t -- -config="{CheckOptions: [{key: bugprone-assert-side-effect.CheckFunctionCalls, value: true}, {key: bugprone-assert-side-effect.AssertMacros, value: 'assert,assert2,my_assert,convoluted_assert,msvc_assert'}, {key: bugprone-assert-side-effect.IgnoredFunctions, value: 'MyClass::badButIgnoredFunc'}]}" -- -fexceptions -I %S/Inputs/assert-side-effect
|
||||
// RUN: %check_clang_tidy %s bugprone-assert-side-effect %t -- -config="{CheckOptions: {bugprone-assert-side-effect.CheckFunctionCalls: true, bugprone-assert-side-effect.AssertMacros: 'assert,assert2,my_assert,convoluted_assert,msvc_assert', bugprone-assert-side-effect.IgnoredFunctions: 'MyClass::badButIgnoredFunc'}}" -- -fexceptions -I %S/Inputs/assert-side-effect
|
||||
#include <assert.h>
|
||||
|
||||
bool badButIgnoredFunc(int a, int b) { return a * b > 0; }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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: {bugprone-dangling-handle.HandleClasses: \
|
||||
// RUN: 'std::basic_string_view; ::llvm::StringRef;'}}"
|
||||
// FIXME: Fix the checker to work in C++17 or later mode.
|
||||
|
||||
namespace std {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: "\"\";Foo;Bar"}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: "T"}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "\"\";Foo;Bar", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "T", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' --
|
||||
|
||||
void ignoredUnnamed(int I, int, int) {} // NO-WARN: No >= 2 length of non-unnamed.
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 1}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 1}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 1, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 1, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' --
|
||||
|
||||
void numericAndQualifierConversion(int I, const double CD) { numericAndQualifierConversion(CD, I); }
|
||||
// CHECK-MESSAGES: :[[@LINE-1]]:36: warning: 2 adjacent parameters of 'numericAndQualifierConversion' of convertible types are easily swapped by mistake [bugprone-easily-swappable-parameters]
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 1}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 1, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' --
|
||||
|
||||
void implicitDoesntBreakOtherStuff(int A, int B) {}
|
||||
// CHECK-MESSAGES: :[[@LINE-1]]:36: warning: 2 adjacent parameters of 'implicitDoesntBreakOtherStuff' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy -std=c++17-or-later %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 1}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 1, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' --
|
||||
|
||||
void implicitDoesntBreakOtherStuff(int A, int B) {}
|
||||
// CHECK-MESSAGES: :[[@LINE-1]]:36: warning: 2 adjacent parameters of 'implicitDoesntBreakOtherStuff' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' --
|
||||
|
||||
namespace std {
|
||||
using size_t = decltype(sizeof(int));
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 3}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 3, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' --
|
||||
|
||||
int add(int Left, int Right) { return Left + Right; } // NO-WARN: Only 2 parameters.
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 1} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 1 \
|
||||
// RUN: }}' --
|
||||
|
||||
namespace std {
|
||||
struct string {};
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 1}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 1, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' --
|
||||
|
||||
typedef int MyInt1;
|
||||
typedef int MyInt2;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 1}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' -- -Wno-strict-prototypes -x c
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 1, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' -- -Wno-strict-prototypes -x c
|
||||
|
||||
int myprint();
|
||||
int add(int X, int Y);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 1}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' --
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 1, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' --
|
||||
|
||||
namespace std {
|
||||
template <typename T>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: "bool;MyBool;struct U;MAKE_LOGICAL_TYPE(int)"}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
|
||||
// RUN: {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
|
||||
// RUN: ]}' -- -Wno-strict-prototypes -x c
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \
|
||||
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "bool;MyBool;struct U;MAKE_LOGICAL_TYPE(int)", \
|
||||
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
|
||||
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
|
||||
// RUN: }}' -- -Wno-strict-prototypes -x c
|
||||
|
||||
#define bool _Bool
|
||||
#define true 1
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// 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: -config="{CheckOptions: { \
|
||||
// RUN: bugprone-exception-escape.IgnoredExceptions: 'ignored1,ignored2', \
|
||||
// RUN: bugprone-exception-escape.FunctionsThatShouldNotThrow: 'enabled1,enabled2,enabled3' \
|
||||
// RUN: }}" \
|
||||
// RUN: -- -fexceptions
|
||||
// FIXME: Fix the checker to work in C++17 or later mode.
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,CXX %s bugprone-implicit-widening-of-multiplication-result %t -- -- -target x86_64-unknown-unknown -x c++
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,C -std=c99 %s bugprone-implicit-widening-of-multiplication-result %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
|
||||
// RUN: ]}' -- -target x86_64-unknown-unknown -x c
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources: false \
|
||||
// RUN: }}' -- -target x86_64-unknown-unknown -x c
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,C %s bugprone-implicit-widening-of-multiplication-result %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
|
||||
// RUN: ]}' -- -target x86_64-unknown-unknown -x c++
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources: false \
|
||||
// RUN: }}' -- -target x86_64-unknown-unknown -x c++
|
||||
|
||||
char *t0(char *base, int a, int b) {
|
||||
return &base[a * b];
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,CXX %s bugprone-implicit-widening-of-multiplication-result %t -- -- -target x86_64-unknown-unknown -x c++
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,C -std=c99 %s bugprone-implicit-widening-of-multiplication-result %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
|
||||
// RUN: ]}' -- -target x86_64-unknown-unknown -x c
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources: false \
|
||||
// RUN: }}' -- -target x86_64-unknown-unknown -x c
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,C %s bugprone-implicit-widening-of-multiplication-result %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
|
||||
// RUN: ]}' -- -target x86_64-unknown-unknown -x c++
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources: false \
|
||||
// RUN: }}' -- -target x86_64-unknown-unknown -x c++
|
||||
|
||||
long t0(int a, int b) {
|
||||
return a * b;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,CXX %s bugprone-implicit-widening-of-multiplication-result %t -- -- -target x86_64-unknown-unknown -x c++
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,C -std=c99 %s bugprone-implicit-widening-of-multiplication-result %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
|
||||
// RUN: ]}' -- -target x86_64-unknown-unknown -x c
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources: false \
|
||||
// RUN: }}' -- -target x86_64-unknown-unknown -x c
|
||||
// RUN: %check_clang_tidy -check-suffixes=ALL,C %s bugprone-implicit-widening-of-multiplication-result %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
|
||||
// RUN: ]}' -- -target x86_64-unknown-unknown -x c++
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources: false \
|
||||
// RUN: }}' -- -target x86_64-unknown-unknown -x c++
|
||||
|
||||
char *t0(char *base, int a, int b) {
|
||||
return base + a * b;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: false}]}" --
|
||||
// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: {bugprone-misplaced-widening-cast.CheckImplicitCasts: false}}" --
|
||||
|
||||
void func(long arg) {}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: true}]}" --
|
||||
// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: {bugprone-misplaced-widening-cast.CheckImplicitCasts: true}}" --
|
||||
|
||||
void func(long arg) {}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: bugprone-not-null-terminated-result.WantToUseSafeFunctions, \
|
||||
// RUN: value: true}]}" \
|
||||
// RUN: {bugprone-not-null-terminated-result.WantToUseSafeFunction: true}}" \
|
||||
// RUN: -- -std=c11 -I %S/Inputs/not-null-terminated-result
|
||||
|
||||
#include "not-null-terminated-result-c.h"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-reserved-identifier %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: bugprone-reserved-identifier.Invert, value: true}, \
|
||||
// RUN: {key: bugprone-reserved-identifier.AllowedIdentifiers, value: "std;reference_wrapper;^c?ref;type;get"}, \
|
||||
// RUN: ]}' -- \
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: bugprone-reserved-identifier.Invert: true, \
|
||||
// RUN: bugprone-reserved-identifier.AllowedIdentifiers: "std;reference_wrapper;ref;^c?ref;type;get" \
|
||||
// RUN: }}' -- \
|
||||
// RUN: -I%S/Inputs/reserved-identifier \
|
||||
// RUN: -isystem %S/Inputs/reserved-identifier/system
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-signal-handler %t \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: bugprone-signal-handler.AsyncSafeFunctionSet, value: "minimal"}]}' \
|
||||
// RUN: {bugprone-signal-handler.AsyncSafeFunctionSet: "minimal"}}' \
|
||||
// RUN: -- -isystem %clang_tidy_headers
|
||||
|
||||
#include "signal.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-signal-handler %t \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: bugprone-signal-handler.AsyncSafeFunctionSet, value: "POSIX"}]}' \
|
||||
// RUN: {bugprone-signal-handler.AsyncSafeFunctionSet: "POSIX"}}' \
|
||||
// RUN: -- -isystem %clang_tidy_headers
|
||||
|
||||
#include "signal.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-signed-char-misuse %t \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: bugprone-signed-char-misuse.CharTypdefsToIgnore, value: "sal_Int8;int8_t"}]}' \
|
||||
// RUN: {bugprone-signed-char-misuse.CharTypdefsToIgnore: "sal_Int8;int8_t"}}' \
|
||||
// RUN: --
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-sizeof-expression %t -- -config="{CheckOptions: [{key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression, value: true}]}" --
|
||||
// RUN: %check_clang_tidy %s bugprone-sizeof-expression %t -- -config="{CheckOptions: {bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression: true}}" --
|
||||
|
||||
class C {
|
||||
int size() { return sizeof(this); }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: [{key: bugprone-suspicious-enum-usage.StrictMode, value: true}]}" --
|
||||
// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: {bugprone-suspicious-enum-usage.StrictMode: true}}" --
|
||||
|
||||
enum A {
|
||||
A = 1,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: [{key: bugprone-suspicious-enum-usage.StrictMode, value: false}]}" --
|
||||
// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: {bugprone-suspicious-enum-usage.StrictMode: false}}" --
|
||||
|
||||
enum Empty {
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-suspicious-string-compare %t -- \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: true}, \
|
||||
// RUN: {key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: true}]}' \
|
||||
// RUN: {bugprone-suspicious-string-compare.WarnOnImplicitComparison: true, \
|
||||
// RUN: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison: true}}' \
|
||||
// RUN: -- -std=c99
|
||||
|
||||
static const char A[] = "abc";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-suspicious-string-compare %t -- \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: true}, \
|
||||
// RUN: {key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: true}]}' \
|
||||
// RUN: {bugprone-suspicious-string-compare.WarnOnImplicitComparison: true, \
|
||||
// RUN: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison: true}}' \
|
||||
// RUN: --
|
||||
|
||||
typedef __SIZE_TYPE__ size;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-too-small-loop-variable %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit, \
|
||||
// RUN: value: 1024}]}" \
|
||||
// RUN: {bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit: 1024}}" \
|
||||
// RUN: -- --target=x86_64-linux
|
||||
|
||||
long size() { return 294967296l; }
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-unhandled-self-assignment %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField, \
|
||||
// RUN: value: false}]}"
|
||||
// RUN: {bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField: false}}"
|
||||
|
||||
// Classes with pointer field are still caught.
|
||||
class PtrField {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s bugprone-unused-return-value %t \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: bugprone-unused-return-value.CheckedFunctions, \
|
||||
// RUN: value: "::fun;::ns::Outer::Inner::memFun;::ns::Type::staticFun;::ns::ClassTemplate::memFun;::ns::ClassTemplate::staticFun"}]}' \
|
||||
// RUN: {bugprone-unused-return-value.CheckedFunctions: \
|
||||
// RUN: "::fun;::ns::Outer::Inner::memFun;::ns::Type::staticFun;::ns::ClassTemplate::memFun;::ns::ClassTemplate::staticFun"}}' \
|
||||
// RUN: --
|
||||
|
||||
namespace std {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s cert-msc32-c %t -- -config="{CheckOptions: [{key: cert-msc32-c.DisallowedSeedTypes, value: 'some_type,time_t'}]}" -- -std=c99
|
||||
// RUN: %check_clang_tidy %s cert-msc32-c %t -- -config="{CheckOptions: {cert-msc32-c.DisallowedSeedTypes: 'some_type,time_t'}}" -- -std=c99
|
||||
|
||||
void srand(int seed);
|
||||
typedef int time_t;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s cert-msc51-cpp %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: cert-msc51-cpp.DisallowedSeedTypes, value: 'some_type,time_t'}]}"
|
||||
// RUN: -config="{CheckOptions: {cert-msc51-cpp.DisallowedSeedTypes: 'some_type,time_t'}}"
|
||||
|
||||
namespace std {
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// RUN: %check_clang_tidy %s cert-oop57-cpp %t -- \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: cert-oop57-cpp.MemSetNames, value: mymemset}, \
|
||||
// RUN: {key: cert-oop57-cpp.MemCpyNames, value: mymemcpy}, \
|
||||
// RUN: {key: cert-oop57-cpp.MemCmpNames, value: mymemcmp}]}' \
|
||||
// RUN: {cert-oop57-cpp.MemSetNames: mymemset, \
|
||||
// RUN: cert-oop57-cpp.MemCpyNames: mymemcpy, \
|
||||
// RUN: cert-oop57-cpp.MemCmpNames: mymemcmp}}' \
|
||||
// RUN: --
|
||||
|
||||
void mymemset(void *, unsigned char, decltype(sizeof(int)));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s concurrency-mt-unsafe %t -- -config='{CheckOptions: [{key: "concurrency-mt-unsafe.FunctionSet", value: "glibc"}]}'
|
||||
// RUN: %check_clang_tidy %s concurrency-mt-unsafe %t -- -config='{CheckOptions: {concurrency-mt-unsafe.FunctionSet: "glibc"}}'
|
||||
|
||||
extern unsigned int sleep (unsigned int __seconds);
|
||||
extern int *gmtime (const int *__timer);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s concurrency-mt-unsafe %t -- -config='{CheckOptions: [{key: "concurrency-mt-unsafe.FunctionSet", value: "posix"}]}'
|
||||
// RUN: %check_clang_tidy %s concurrency-mt-unsafe %t -- -config='{CheckOptions: {concurrency-mt-unsafe.FunctionSet: "posix"}}'
|
||||
|
||||
extern unsigned int sleep (unsigned int __seconds);
|
||||
extern int *gmtime (const int *__timer);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-macro-usage %t \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: cppcoreguidelines-macro-usage.CheckCapsOnly, value: true}]}' --
|
||||
// RUN: {cppcoreguidelines-macro-usage.CheckCapsOnly: true}}' --
|
||||
|
||||
#ifndef INCLUDE_GUARD
|
||||
#define INCLUDE_GUARD
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %check_clang_tidy -check-suffixes=NORMAL %s cppcoreguidelines-macro-usage %t -- -- -D_ZZZ_IM_A_MACRO
|
||||
// RUN: %check_clang_tidy -check-suffixes=NORMAL %s cppcoreguidelines-macro-usage %t -- -config='{CheckOptions: [{key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros, value: true}]}' -- -D_ZZZ_IM_A_MACRO
|
||||
// RUN: %check_clang_tidy -check-suffixes=NORMAL,CL %s cppcoreguidelines-macro-usage %t -- -config='{CheckOptions: [{key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros, value: false}]}' -- -D_ZZZ_IM_A_MACRO
|
||||
// RUN: %check_clang_tidy -check-suffixes=NORMAL %s cppcoreguidelines-macro-usage %t -- -config='{CheckOptions: {cppcoreguidelines-macro-usage.IgnoreCommandLineMacros: true}}' -- -D_ZZZ_IM_A_MACRO
|
||||
// RUN: %check_clang_tidy -check-suffixes=NORMAL,CL %s cppcoreguidelines-macro-usage %t -- -config='{CheckOptions: {cppcoreguidelines-macro-usage.IgnoreCommandLineMacros: false}}' -- -D_ZZZ_IM_A_MACRO
|
||||
|
||||
// CHECK-MESSAGES-CL: warning: macro '_ZZZ_IM_A_MACRO' used to declare a constant; consider using a 'constexpr' constant
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-macro-usage %t \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: cppcoreguidelines-macro-usage.AllowedRegexp, value: 'DEBUG_*|TEST_*'}]}" --
|
||||
// RUN: {cppcoreguidelines-macro-usage.AllowedRegexp: 'DEBUG_*|TEST_*'}}" --
|
||||
|
||||
#ifndef INCLUDE_GUARD
|
||||
#define INCLUDE_GUARD
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
// RUN: %check_clang_tidy -check-suffix=DEFAULT %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: ]}'
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t --
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffix=DISABLED %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth, value: 0} \
|
||||
// RUN: ]}'
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth: 0}}'
|
||||
|
||||
void narrowing_equivalent_bitwidth() {
|
||||
int i;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
// RUN: %check_clang_tidy -check-suffix=DEFAULT %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: ]}'
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t --
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffix=IGNORED %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes, value: "global_size_t;nested_size_type"} \
|
||||
// RUN: ]}'
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes: "global_size_t;nested_size_type" \
|
||||
// RUN: }}'
|
||||
|
||||
// We use global_size_t instead of 'size_t' because windows predefines size_t.
|
||||
typedef long long global_size_t;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
// RUN: %check_clang_tidy -check-suffix=DEFAULT %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: ]}'
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t --
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffix=WARN %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: cppcoreguidelines-narrowing-conversions.WarnWithinTemplateInstantiation, value: 1} \
|
||||
// RUN: ]}'
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions.WarnWithinTemplateInstantiation: 1 \
|
||||
// RUN: }}'
|
||||
|
||||
template <typename OrigType>
|
||||
void assign_in_template(OrigType jj) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// RUN: %check_clang_tidy -check-suffix=DEFAULT %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [{key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion, value: true}]}'
|
||||
// RUN: -config='{CheckOptions: {cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion: true}}'
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffix=DISABLED %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [{key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion, value: false}]}'
|
||||
// RUN: -config='{CheckOptions: {cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion: false}}'
|
||||
|
||||
void foo(unsigned long long value) {
|
||||
int a = value;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// RUN: %check_clang_tidy -check-suffix=DEFAULT %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [{key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion, value: true}]}'
|
||||
// RUN: -config='{CheckOptions: {cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: true}}'
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffix=DISABLED %s \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions %t -- \
|
||||
// RUN: -config='{CheckOptions: [{key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion, value: false}]}'
|
||||
// RUN: -config='{CheckOptions: {cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: false}}'
|
||||
|
||||
void foo(unsigned long long value) {
|
||||
double a = value;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: "cppcoreguidelines-narrowing-conversions.PedanticMode", value: true} \
|
||||
// RUN: ]}" \
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions.PedanticMode: true}}" \
|
||||
// RUN: -- -target x86_64-unknown-linux -fsigned-char
|
||||
|
||||
namespace floats {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: "cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion", value: false}, \
|
||||
// RUN: ]}" \
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion: false}}" \
|
||||
// RUN: -- -target x86_64-unknown-linux -fsigned-char
|
||||
|
||||
float ceil(float);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-no-malloc %t \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: cppcoreguidelines-no-malloc.Allocations, value: "::malloc;::align_malloc;::calloc"},\
|
||||
// RUN: {key: cppcoreguidelines-no-malloc.Reallocations, value: "::realloc;::align_realloc"},\
|
||||
// RUN: {key: cppcoreguidelines-no-malloc.Deallocations, value: "::free;::align_free"}]}' \
|
||||
// RUN: {cppcoreguidelines-no-malloc.Allocations: "::malloc;::align_malloc;::calloc",\
|
||||
// RUN: cppcoreguidelines-no-malloc.Reallocations: "::realloc;::align_realloc",\
|
||||
// RUN: cppcoreguidelines-no-malloc.Deallocations: "::free;::align_free"}}' \
|
||||
// RUN: --
|
||||
|
||||
using size_t = __SIZE_TYPE__;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-no-malloc %t \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: cppcoreguidelines-no-malloc.Allocations, value: "::malloc"},\
|
||||
// RUN: {key: cppcoreguidelines-no-malloc.Reallocations, value: ""},\
|
||||
// RUN: {key: cppcoreguidelines-no-malloc.Deallocations, value: ""}]}' \
|
||||
// RUN: {cppcoreguidelines-no-malloc.Allocations: "::malloc",\
|
||||
// RUN: cppcoreguidelines-no-malloc.Reallocations: "",\
|
||||
// RUN: cppcoreguidelines-no-malloc.Deallocations: ""}}' \
|
||||
// RUN: --
|
||||
|
||||
// Just ensure, the check will not crash, when no functions shall be checked.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-owning-memory %t \
|
||||
// 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: {cppcoreguidelines-owning-memory.LegacyResourceProducers: "::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile", \
|
||||
// RUN: cppcoreguidelines-owning-memory.LegacyResourceConsumers: "::free;::realloc;::freopen;::fclose"}}' \
|
||||
// RUN: -- -nostdlib -nostdinc++
|
||||
|
||||
namespace gsl {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-prefer-member-initializer,modernize-use-default-member-init %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: true}]}"
|
||||
// RUN: -config="{CheckOptions: {modernize-use-default-member-init.UseAssignment: true}}"
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-prefer-member-initializer,modernize-use-default-member-init %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: false}, \
|
||||
// RUN: {key: cppcoreguidelines-prefer-member-initializer.UseAssignment, value: true}]}"
|
||||
// RUN: -config="{CheckOptions: {modernize-use-default-member-init.UseAssignment: false, cppcoreguidelines-prefer-member-initializer.UseAssignment: true}}"
|
||||
|
||||
class Simple1 {
|
||||
int n;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// 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"}]}'
|
||||
// RUN: -config='{CheckOptions: {cppcoreguidelines-pro-bounds-constant-array-index.GslHeader: "dir1/gslheader.h"}}'
|
||||
// CHECK-FIXES: #include "dir1/gslheader.h"
|
||||
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init %t -- -config="{CheckOptions: [{key: "cppcoreguidelines-pro-type-member-init.UseAssignment", value: true}]}" -- -fsigned-char
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init %t -- -config="{CheckOptions: {cppcoreguidelines-pro-type-member-init.UseAssignment: true}}" -- -fsigned-char
|
||||
|
||||
struct T {
|
||||
int i;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s \
|
||||
// RUN: cppcoreguidelines-pro-type-member-init %t \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: cppcoreguidelines-pro-type-member-init.IgnoreArrays, value: true} ]}"
|
||||
// RUN: {cppcoreguidelines-pro-type-member-init.IgnoreArrays: true}}"
|
||||
|
||||
typedef int TypedefArray[4];
|
||||
using UsingArray = int[4];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -config="{CheckOptions: [{key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted, value: true}]}" --
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -config="{CheckOptions: {cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted: true}}" --
|
||||
|
||||
class DefinesEverything {
|
||||
DefinesEverything(const DefinesEverything &);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -config="{CheckOptions: [{key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions, value: true}, {key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor, value: true}]}" --
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -config="{CheckOptions: {cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions: true, cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor: true}}" --
|
||||
|
||||
// Don't warn on destructors without definitions, they might be defaulted in another TU.
|
||||
class DeclaresDestructor {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// RUN: %check_clang_tidy %s google-runtime-int %t -- \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// 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: ]}'
|
||||
// RUN: -config='{CheckOptions: { \
|
||||
// RUN: google-runtime-int.UnsignedTypePrefix: "std::uint", \
|
||||
// RUN: google-runtime-int.SignedTypePrefix: "std::int", \
|
||||
// RUN: google-runtime-int.TypeSuffix: "_t", \
|
||||
// RUN: }}'
|
||||
|
||||
long a();
|
||||
// CHECK-MESSAGES: [[@LINE-1]]:1: warning: consider replacing 'long' with 'std::int{{..}}_t'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %check_clang_tidy %s hicpp-multiway-paths-covered %t \
|
||||
// RUN: -config='{CheckOptions: \
|
||||
// RUN: [{key: hicpp-multiway-paths-covered.WarnOnMissingElse, value: true}]}'\
|
||||
// RUN: {hicpp-multiway-paths-covered.WarnOnMissingElse: true}}'\
|
||||
// RUN: --
|
||||
|
||||
enum OS { Mac,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: hicpp-signed-bitwise.IgnorePositiveIntegerLiterals, value: true }]}" \
|
||||
// RUN: -config="{CheckOptions: {hicpp-signed-bitwise.IgnorePositiveIntegerLiterals: true}}" \
|
||||
// RUN: -- -std=c++11
|
||||
|
||||
void examples() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// RUN: %check_clang_tidy -check-suffixes=PUBLIC,NONPRIVATE,PROTECTED %s misc-non-private-member-variables-in-classes %t
|
||||
// RUN: %check_clang_tidy -check-suffixes=PUBLIC,NONPRIVATE,PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: false}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: false}]}' --
|
||||
// RUN: %check_clang_tidy -check-suffixes=PUBLIC,PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: false}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: true}]}' --
|
||||
// RUN: %check_clang_tidy -check-suffixes=PUBLIC,NONPRIVATE,PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: {misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables: false, misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: false}}' --
|
||||
// RUN: %check_clang_tidy -check-suffixes=PUBLIC,PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: {misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables: false, misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: true}}' --
|
||||
// RUN: %check_clang_tidy -check-suffixes=PUBLIC,PROTECTED %s cppcoreguidelines-non-private-member-variables-in-classes %t -- --
|
||||
// RUN: %check_clang_tidy -check-suffixes=PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: true}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: false}]}' --
|
||||
// RUN: %check_clang_tidy -check-suffixes=PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: true}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: true}]}' --
|
||||
// RUN: %check_clang_tidy -check-suffixes=PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: {misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables: true, misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: false}}' --
|
||||
// RUN: %check_clang_tidy -check-suffixes=PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: {misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables: true, misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: true}}' --
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s misc-unused-parameters %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" --
|
||||
// RUN: -config="{CheckOptions: {StrictMode: true}}" --
|
||||
|
||||
// Warn on empty function bodies in StrictMode.
|
||||
namespace strict_mode {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-avoid-bind %t -- \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-avoid-bind.PermissiveParameterList, value: true}]}" --
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: modernize-avoid-bind.PermissiveParameterList: true}}" --
|
||||
|
||||
namespace std {
|
||||
inline namespace impl {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
// RUN: %check_clang_tidy -std=c++11 %s modernize-deprecated-headers %t \
|
||||
// RUN: -check-suffixes=DEFAULT,CHECK-HEADER-FILE \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-deprecated-headers.CheckHeaderFile, value: 'true'}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-deprecated-headers.CheckHeaderFile: 'true'}}" \
|
||||
// RUN: --header-filter='.*' --system-headers \
|
||||
// RUN: -- -I %t/usr -isystem %t/sys -isystem %S/Inputs/deprecated-headers
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'camelBack'}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-loop-convert.NamingStyle: 'camelBack'}}" \
|
||||
// RUN: -- -I %S/Inputs/loop-convert
|
||||
|
||||
#include "structures.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'lower_case'}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-loop-convert.NamingStyle: 'lower_case'}}" \
|
||||
// RUN: -- -I %S/Inputs/loop-convert
|
||||
|
||||
#include "structures.h"
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
// RUN: %check_clang_tidy -std=c++20 -check-suffixes=,RANGES %s modernize-loop-convert %t
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffixes=,CUSTOM,CUSTOM-NO-SYS %s modernize-loop-convert %t -- \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-loop-convert.MakeReverseRangeFunction, value: 'llvm::reverse'}, \
|
||||
// RUN: {key: modernize-loop-convert.MakeReverseRangeHeader, value: 'llvm/ADT/STLExtras.h'}]}"
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: modernize-loop-convert.MakeReverseRangeFunction: 'llvm::reverse', \
|
||||
// RUN: modernize-loop-convert.MakeReverseRangeHeader: 'llvm/ADT/STLExtras.h'}}"
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffixes=,CUSTOM,CUSTOM-SYS %s modernize-loop-convert %t -- \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-loop-convert.MakeReverseRangeFunction, value: 'llvm::reverse'}, \
|
||||
// RUN: {key: modernize-loop-convert.MakeReverseRangeHeader, value: '<llvm/ADT/STLExtras.h>'}]}"
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: modernize-loop-convert.MakeReverseRangeFunction: 'llvm::reverse', \
|
||||
// RUN: modernize-loop-convert.MakeReverseRangeHeader: '<llvm/ADT/STLExtras.h>'}}"
|
||||
|
||||
// RUN: %check_clang_tidy -check-suffixes=,CUSTOM,CUSTOM-NO-HEADER %s modernize-loop-convert %t -- \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-loop-convert.MakeReverseRangeFunction, value: 'llvm::reverse'}]}"
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: modernize-loop-convert.MakeReverseRangeFunction: 'llvm::reverse'}}"
|
||||
|
||||
// Ensure the check doesn't transform reverse loops when not in c++20 mode or
|
||||
// when UseCxx20ReverseRanges has been disabled
|
||||
// RUN: clang-tidy %s -checks=-*,modernize-loop-convert -- -std=c++17 | count 0
|
||||
|
||||
// RUN: clang-tidy %s -checks=-*,modernize-loop-convert -config="{CheckOptions: \
|
||||
// RUN: [{key: modernize-loop-convert.UseCxx20ReverseRanges, value: 'false'}] \
|
||||
// RUN: {modernize-loop-convert.UseCxx20ReverseRanges: 'false'} \
|
||||
// RUN: }" -- -std=c++20 | count 0
|
||||
|
||||
// Ensure we get a warning if we supply the header argument without the
|
||||
// function argument.
|
||||
// RUN: clang-tidy %s -checks=-*,modernize-loop-convert -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-loop-convert.MakeReverseRangeHeader, value: 'llvm/ADT/STLExtras.h'}]}" \
|
||||
// RUN: clang-tidy %s -checks=-*,modernize-loop-convert -config="{CheckOptions: { \
|
||||
// RUN: modernize-loop-convert.MakeReverseRangeHeader: 'llvm/ADT/STLExtras.h'}}" \
|
||||
// RUN: -- -std=c++17 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-HEADER-NO-FUNC \
|
||||
// RUN: -implicit-check-not="{{warning|error}}:"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'UPPER_CASE'}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-loop-convert.NamingStyle: 'UPPER_CASE'}}" \
|
||||
// RUN: -- -I %S/Inputs/loop-convert
|
||||
|
||||
#include "structures.h"
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// RUN: %check_clang_tidy %s modernize-make-shared %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: modernize-make-shared.MakeSmartPtrFunction, \
|
||||
// RUN: value: 'my::MakeShared'}, \
|
||||
// RUN: {key: modernize-make-shared.MakeSmartPtrFunctionHeader, \
|
||||
// RUN: value: 'make_shared_util.h'} \
|
||||
// RUN: ]}" \
|
||||
// RUN: {modernize-make-shared.MakeSmartPtrFunction: 'my::MakeShared', \
|
||||
// RUN: modernize-make-shared.MakeSmartPtrFunctionHeader: 'make_shared_util.h' \
|
||||
// RUN: }}" \
|
||||
// RUN: -- -I %S/Inputs/smart-ptr
|
||||
|
||||
#include "shared_ptr.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-make-unique %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: modernize-make-unique.IgnoreDefaultInitialization, \
|
||||
// RUN: value: 'false'}] \
|
||||
// RUN: {modernize-make-unique.IgnoreDefaultInitialization: \
|
||||
// RUN: 'false'}} \
|
||||
// RUN: }" \
|
||||
// RUN: -- -I %S/Inputs/smart-ptr
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// RUN: %check_clang_tidy %s modernize-make-unique %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: modernize-make-unique.MakeSmartPtrFunction, \
|
||||
// RUN: value: 'my::MakeUnique'}, \
|
||||
// RUN: {key: modernize-make-unique.MakeSmartPtrFunctionHeader, \
|
||||
// RUN: value: 'make_unique_util.h'} \
|
||||
// RUN: ]}" \
|
||||
// RUN: {modernize-make-unique.MakeSmartPtrFunction: 'my::MakeUnique', \
|
||||
// RUN: modernize-make-unique.MakeSmartPtrFunctionHeader: 'make_unique_util.h' \
|
||||
// RUN: }}" \
|
||||
// RUN: -- -I %S/Inputs/smart-ptr
|
||||
|
||||
#include "unique_ptr.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-make-unique %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-make-unique.IgnoreMacros, value: false}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-make-unique.IgnoreMacros: false}}" \
|
||||
// RUN: -- -I %S/Inputs/smart-ptr
|
||||
|
||||
#include "unique_ptr.h"
|
||||
|
||||
@@ -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: true}]}'
|
||||
// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config='{CheckOptions: {modernize-raw-string-literal.DelimiterStem: "str", modernize-raw-string-literal.ReplaceShorterLiterals: true}}'
|
||||
|
||||
char const *const ContainsSentinel{"who\\ops)\""};
|
||||
// CHECK-MESSAGES: :[[@LINE-1]]:36: warning: {{.*}} can be written as a raw string literal
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config="{CheckOptions: [{key: modernize-raw-string-literal.ReplaceShorterLiterals, value: true}]}"
|
||||
// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config="{CheckOptions: {modernize-raw-string-literal.ReplaceShorterLiterals: true}}"
|
||||
|
||||
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]
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
|
||||
// RUN: %check_clang_tidy -format-style=LLVM -check-suffix=DIFFERENT-NAME %s \
|
||||
// RUN: modernize-replace-disallow-copy-and-assign-macro %t \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-replace-disallow-copy-and-assign-macro.MacroName, \
|
||||
// RUN: value: MY_MACRO_NAME}]}"
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: modernize-replace-disallow-copy-and-assign-macro.MacroName: \
|
||||
// RUN: MY_MACRO_NAME}}"
|
||||
|
||||
// RUN: %check_clang_tidy -format-style=LLVM -check-suffix=FINALIZE %s \
|
||||
// RUN: modernize-replace-disallow-copy-and-assign-macro %t \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-replace-disallow-copy-and-assign-macro.MacroName, \
|
||||
// RUN: value: DISALLOW_COPY_AND_ASSIGN_FINALIZE}]}"
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: modernize-replace-disallow-copy-and-assign-macro.MacroName: \
|
||||
// RUN: DISALLOW_COPY_AND_ASSIGN_FINALIZE}}"
|
||||
|
||||
// RUN: clang-tidy %s -checks="-*,modernize-replace-disallow-copy-and-assign-macro" \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-replace-disallow-copy-and-assign-macro.MacroName, \
|
||||
// RUN: value: DISALLOW_COPY_AND_ASSIGN_MORE_AGUMENTS}]}" -- -Wno-extra-semi | count 0
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: modernize-replace-disallow-copy-and-assign-macro.MacroName: \
|
||||
// RUN: DISALLOW_COPY_AND_ASSIGN_MORE_AGUMENTS}}" -- -Wno-extra-semi | count 0
|
||||
|
||||
// RUN: clang-tidy %s -checks="-*,modernize-replace-disallow-copy-and-assign-macro" \
|
||||
// RUN: -config="{CheckOptions: [ \
|
||||
// RUN: {key: modernize-replace-disallow-copy-and-assign-macro.MacroName, \
|
||||
// RUN: value: DISALLOW_COPY_AND_ASSIGN_NEEDS_PREEXPANSION}]}" -- -Wno-extra-semi | count 0
|
||||
// RUN: -config="{CheckOptions: { \
|
||||
// RUN: modernize-replace-disallow-copy-and-assign-macro.MacroName: \
|
||||
// RUN: DISALLOW_COPY_AND_ASSIGN_NEEDS_PREEXPANSION}}" -- -Wno-extra-semi | count 0
|
||||
|
||||
// Note: the last two tests expect no diagnostics, but FileCheck cannot handle
|
||||
// that, hence the use of | count 0.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-auto %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 'true'} , {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-use-auto.RemoveStars: 'true' , modernize-use-auto.MinTypeNameLength: '0'}}" \
|
||||
// RUN: -- -frtti
|
||||
|
||||
struct A {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-auto %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-use-auto.MinTypeNameLength: '0'}}" \
|
||||
// RUN: -- -I %S/Inputs/use-auto -frtti
|
||||
|
||||
struct A {
|
||||
|
||||
@@ -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: false}, {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: false}, {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: true}, {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: true}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- -frtti
|
||||
// RUN: %check_clang_tidy -check-suffix=0-0 %s modernize-use-auto %t -- -config="{CheckOptions: {modernize-use-auto.RemoveStars: false, modernize-use-auto.MinTypeNameLength: 0}}" -- -frtti
|
||||
// RUN: %check_clang_tidy -check-suffix=0-8 %s modernize-use-auto %t -- -config="{CheckOptions: {modernize-use-auto.RemoveStars: false, modernize-use-auto.MinTypeNameLength: 8}}" -- -frtti
|
||||
// RUN: %check_clang_tidy -check-suffix=1-0 %s modernize-use-auto %t -- -config="{CheckOptions: {modernize-use-auto.RemoveStars: true, modernize-use-auto.MinTypeNameLength: 0}}" -- -frtti
|
||||
// RUN: %check_clang_tidy -check-suffix=1-8 %s modernize-use-auto %t -- -config="{CheckOptions: {modernize-use-auto.RemoveStars: true, modernize-use-auto.MinTypeNameLength: 8}}" -- -frtti
|
||||
|
||||
template <class T> extern T foo();
|
||||
template <class T> struct P { explicit P(T t) : t_(t) {} T t_;};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-auto %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 'true'}, {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}"
|
||||
// RUN: -config="{CheckOptions: {modernize-use-auto.RemoveStars: 'true', modernize-use-auto.MinTypeNameLength: '0'}}"
|
||||
|
||||
class MyType {};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-auto %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-use-auto.MinTypeNameLength: '0'}}" \
|
||||
// RUN: -- -frtti
|
||||
|
||||
class MyType {};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-bool-literals %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: modernize-use-bool-literals.IgnoreMacros, \
|
||||
// RUN: value: true}]}"
|
||||
// RUN: {modernize-use-bool-literals.IgnoreMacros: \
|
||||
// RUN: true}}"
|
||||
|
||||
bool IntToTrue = 1;
|
||||
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: converting integer literal to bool, use bool literal instead [modernize-use-bool-literals]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-bool-literals %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: modernize-use-bool-literals.IgnoreMacros, \
|
||||
// RUN: value: false}]}"
|
||||
// RUN: {modernize-use-bool-literals.IgnoreMacros: \
|
||||
// RUN: false}}"
|
||||
|
||||
bool IntToTrue = 1;
|
||||
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: converting integer literal to bool, use bool literal instead [modernize-use-bool-literals]
|
||||
|
||||
@@ -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: true}]}"
|
||||
// RUN: -config="{CheckOptions: {modernize-use-default-member-init.UseAssignment: true}}"
|
||||
|
||||
struct S {
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.IgnoreMacros, value: false}]}"
|
||||
// RUN: -config="{CheckOptions: {modernize-use-default-member-init.IgnoreMacros: false}}"
|
||||
|
||||
#define MACRO() \
|
||||
struct S { \
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: modernize-use-emplace.IgnoreImplicitConstructors, \
|
||||
// RUN: value: true}] \
|
||||
// RUN: }"
|
||||
// RUN: {modernize-use-emplace.IgnoreImplicitConstructors: \
|
||||
// RUN: true}}"
|
||||
|
||||
namespace std {
|
||||
template <typename>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \
|
||||
// RUN: -config="{CheckOptions: \
|
||||
// RUN: [{key: modernize-use-emplace.ContainersWithPushBack, \
|
||||
// RUN: value: '::std::vector; ::std::list; ::std::deque; llvm::LikeASmallVector'}, \
|
||||
// RUN: {key: modernize-use-emplace.TupleTypes, \
|
||||
// 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: }"
|
||||
// RUN: {modernize-use-emplace.ContainersWithPushBack: \
|
||||
// RUN: '::std::vector; ::std::list; ::std::deque; llvm::LikeASmallVector', \
|
||||
// RUN: modernize-use-emplace.TupleTypes: \
|
||||
// RUN: '::std::pair; std::tuple; ::test::Single', \
|
||||
// RUN: modernize-use-emplace.TupleMakeFunctions: \
|
||||
// RUN: '::std::make_pair; ::std::make_tuple; ::test::MakeSingle'}}"
|
||||
|
||||
namespace std {
|
||||
template <typename>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-equals-default %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: false}]}" \
|
||||
// RUN: -config="{CheckOptions: {modernize-use-equals-default.IgnoreMacros: false}}" \
|
||||
// RUN: -- -fno-delayed-template-parsing -fexceptions
|
||||
|
||||
// Out of line definition.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-equals-default %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: false}]}"
|
||||
// RUN: -config="{CheckOptions: {modernize-use-equals-default.IgnoreMacros: false}}"
|
||||
|
||||
#define STRUCT_WITH_DEFAULT(_base, _type) \
|
||||
struct _type { \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %check_clang_tidy %s modernize-use-equals-delete %t -- \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-equals-delete.IgnoreMacros, value: false}]}"
|
||||
// RUN: -config="{CheckOptions: {modernize-use-equals-delete.IgnoreMacros: false}}"
|
||||
|
||||
#define MACRO(type) void operator=(type const &)
|
||||
class C {
|
||||
|
||||
@@ -1,5 +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: -config="{CheckOptions: {modernize-use-nodiscard.ReplacementString: '[[clang::warn_unused_result]]'}}"
|
||||
|
||||
class Foo
|
||||
{
|
||||
|
||||
@@ -1,5 +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: -config="{CheckOptions: {modernize-use-nodiscard.ReplacementString: '__attribute__((warn_unused_result))'}}"
|
||||
|
||||
class Foo
|
||||
{
|
||||
|
||||
@@ -1,5 +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: -config="{CheckOptions: {modernize-use-nodiscard.ReplacementString: '[[gcc::warn_unused_result]]'}}"
|
||||
|
||||
class Foo
|
||||
{
|
||||
|
||||
@@ -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'}]}"
|
||||
// RUN: -config="{CheckOptions: {modernize-use-nodiscard.ReplacementString: 'CUSTOM_NO_DISCARD'}}"
|
||||
|
||||
// As if the macro was not defined.
|
||||
// #define CUSTOM_NO_DISCARD __attribute_((warn_unused_result))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user