1 // RUN: not clang-tidy %s --checks='-*,google-explicit-constructor,google-readability-casting' 2>&1 | FileCheck %s
3 // NOLINTBEGIN(google-explicit-constructor)
5 auto Num
= (unsigned int)(-1);
6 // NOLINTEND(google-readability-casting)
8 // Note: the expected output has been split over several lines so that clang-tidy
9 // does not see the "no lint" suppression comment and mistakenly assume it
10 // is meant for itself.
11 // CHECK: :[[@LINE-8]]:4: error: unmatched 'NOLIN
12 // CHECK: TBEGIN' comment without a subsequent 'NOLIN
13 // CHECK: TEND' comment [clang-tidy-nolint]
14 // CHECK: :[[@LINE-10]]:11: warning: single-argument constructors must be marked explicit
15 // CHECK: :[[@LINE-10]]:12: warning: C-style casts are discouraged; use static_cast
16 // CHECK: :[[@LINE-10]]:4: error: unmatched 'NOLIN
17 // CHECK: TEND' comment without a previous 'NOLIN
18 // CHECK: TBEGIN' comment [clang-tidy-nolint]
20 // NOLINTBEGIN(google-explicit-constructor,google-readability-casting)
21 class B
{ B(int i
); };
22 // NOLINTEND(google-explicit-constructor)
23 auto Num2
= (unsigned int)(-1);
24 // NOLINTEND(google-readability-casting)
26 // Note: the expected output has been split over several lines so that clang-tidy
27 // does not see the "no lint" suppression comment and mistakenly assume it
28 // is meant for itself.
29 // CHECK: :[[@LINE-9]]:4: error: unmatched 'NOLIN
30 // CHECK: TBEGIN' comment without a subsequent 'NOLIN
31 // CHECK: TEND' comment [clang-tidy-nolint]
32 // CHECK: :[[@LINE-11]]:11: warning: single-argument constructors must be marked explicit
33 // CHECK: :[[@LINE-11]]:4: error: unmatched 'NOLIN
34 // CHECK: TEND' comment without a previous 'NOLIN
35 // CHECK: TBEGIN' comment [clang-tidy-nolint]
36 // CHECK: :[[@LINE-13]]:13: warning: C-style casts are discouraged; use static_cast
37 // CHECK: :[[@LINE-13]]:4: error: unmatched 'NOLIN
38 // CHECK: TEND' comment without a previous 'NOLIN
39 // CHECK: TBEGIN' comment [clang-tidy-nolint]