summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/checkers/readability-isolate-declaration.c
blob: e09a581fa9fcad1112e307485afe8ff71671c461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %check_clang_tidy %s readability-isolate-declaration %t

void c_specific() {
  void (*signal(int sig, void (*func)(int)))(int);
  int i = sizeof(struct S { int i; });
  int j = sizeof(struct T { int i; }), k;
  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: multiple declarations in a single statement reduces readability
  // CHECK-FIXES: int j = sizeof(struct T { int i; });
  // CHECK-FIXES: {{^  }}int k;

  void g(struct U { int i; } s);                // One decl
  void h(struct V { int i; } s), m(int i, ...); // Two decls
}
OpenPOWER on IntegriCloud