18 lines · cpp
1// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \2// RUN: -config="{CheckOptions: {modernize-use-default-member-init.IgnoreMacros: false}}"3 4#define MACRO() \5 struct S { \6 void *P; \7 S() : P(nullptr) {} \8 };9 10MACRO();11// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use default member initializer for 'P'12 13struct S2 {14 void *P;15 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use default member initializer for 'P'16 S2() : P(nullptr) {}17};18