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