23 lines · cpp
1// RUN: not clang-tidy %s --checks='-*,google-explicit-constructor,google-readability-casting' 2>&1 | FileCheck %s2 3// NOLINTBEGIN(google-explicit-constructor)4// NOLINTBEGIN(google-readability-casting)5class B { B(int i); };6auto Num2 = (unsigned int)(-1);7// NOLINTEND(google-explicit-constructor,google-readability-casting)8 9// Note: the expected output has been split over several lines so that clang-tidy10// does not see the "no lint" suppression comment and mistakenly assume it11// is meant for itself.12// CHECK: :[[@LINE-9]]:4: error: unmatched 'NOLIN13// CHECK: TBEGIN' comment without a subsequent 'NOLIN14// CHECK: TEND' comment [clang-tidy-nolint]15// CHECK: :[[@LINE-11]]:4: error: unmatched 'NOLIN16// CHECK: TBEGIN' comment without a subsequent 'NOLIN17// CHECK: TEND' comment [clang-tidy-nolint]18// CHECK: :[[@LINE-13]]:11: warning: single-argument constructors must be marked explicit19// CHECK: :[[@LINE-13]]:13: warning: C-style casts are discouraged; use static_cast20// CHECK: :[[@LINE-13]]:4: error: unmatched 'NOLIN21// CHECK: TEND' comment without a previous 'NOLIN22// CHECK: TBEGIN' comment [clang-tidy-nolint]23