1// RUN: %check_clang_tidy %s readability-redundant-declaration %t -- \
2// RUN: -config="{CheckOptions: \
3// RUN: {readability-redundant-declaration.IgnoreMacros: \
4// RUN: true}}"
5
6extern int Xyz;
7extern int Xyz; // Xyz
8// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: redundant 'Xyz' declaration [readability-redundant-declaration]
9// CHECK-FIXES: {{^}}// Xyz{{$}}
10
11namespace macros {
12#define DECLARE(x) extern int x
13#define DEFINE(x) extern int x; int x = 42
14DECLARE(test);
15DEFINE(test);
16// CHECK-FIXES: {{^}}#define DECLARE(x) extern int x{{$}}
17// CHECK-FIXES: {{^}}#define DEFINE(x) extern int x; int x = 42{{$}}
18// CHECK-FIXES: {{^}}DECLARE(test);{{$}}
19// CHECK-FIXES: {{^}}DEFINE(test);{{$}}
20
21} // namespace macros
22

source code of clang-tools-extra/test/clang-tidy/checkers/readability/redundant-declaration-ignore-macros.cpp