brintos

brintos / llvm-project-archived public Read only

0
0
Text · 696 B · 1fe7d1d Raw
22 lines · cpp
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; // Xyz8// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: redundant 'Xyz' declaration [readability-redundant-declaration]9// CHECK-FIXES: // Xyz10 11namespace macros {12#define DECLARE(x) extern int x13#define DEFINE(x) extern int x; int x = 4214DECLARE(test);15DEFINE(test);16// CHECK-FIXES: #define DECLARE(x) extern int x17// CHECK-FIXES: #define DEFINE(x) extern int x; int x = 4218// CHECK-FIXES: DECLARE(test);19// CHECK-FIXES: DEFINE(test);20 21} // namespace macros22