Files
llvm-project/clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-macros.cpp
Miklos Vajna 0854f2dd8f clang-tidy: add IgnoreMacros option to modernize-use-default-member-init
Summary:
And also enable it by default to be consistent with e.g.
modernize-use-using.

This helps e.g. when running this check on cppunit client code where the
macro is provided by the system, so there is no easy way to modify it.

Reviewers: alexfh, malcolm.parsons

Reviewed By: malcolm.parsons

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D32945

llvm-svn: 302429
2017-05-08 15:13:31 +00:00

19 lines
507 B
C++

// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \
// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.IgnoreMacros, value: 0}]}" \
// RUN: -- -std=c++11
#define MACRO() \
struct S { \
void *P; \
S() : P(nullptr) {} \
};
MACRO();
// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use default member initializer for 'P'
struct S2 {
void *P;
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use default member initializer for 'P'
S2() : P(nullptr) {}
};