summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/checkers/modernize-use-default-member-init-macros.cpp
blob: 62be60c976806c573326d313550559a03bc30145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \
// RUN:   -config="{CheckOptions: [{key: modernize-use-default-member-init.IgnoreMacros, value: 0}]}"

#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) {}
};
OpenPOWER on IntegriCloud