[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / TableGen / redefined-group.td
blob558c6775ef4bf40c99053613ee73bce8abe8ef1a
1 // RUN: clang-tblgen -gen-clang-diag-groups -I%S %s -o /dev/null 2>&1 | FileCheck %s
2 include "DiagnosticBase.inc"
4 def NamedGroup : DiagGroup<"a">;
5 def InNamedGroup1 : Warning<"">, InGroup<DiagGroup<"a">>;
6 def InNamedGroup2 : Warning<"">, InGroup  < DiagGroup<"a"> >;
7 // CHECK: redefined-group.td:[[@LINE-3]]:5: error: group 'a' is defined more than once
8 // CHECK: redefined-group.td:[[@LINE-3]]:5: note: also implicitly defined here
9 // CHECK: redefined-group.td:[[@LINE-3]]:5: note: also implicitly defined here
11 def : DiagGroup<"b">;
12 def InUnnamedGroup : Warning<"">, InGroup<DiagGroup<"b">>;
13 // CHECK: redefined-group.td:[[@LINE-2]]:1: error: group 'b' is defined more than once
14 // CHECK: redefined-group.td:[[@LINE-2]]:5: note: also implicitly defined here
16 def ImplicitGroup1 : Warning<"">, InGroup<DiagGroup<"c">>;
17 def ImplicitGroup2 : Warning<"">, InGroup<DiagGroup<"c">>;
18 def ImplicitGroup3 : Warning<"">,
19   InGroup<DiagGroup<"c">>;
20 // CHECK: redefined-group.td:[[@LINE-4]]:5: error: group 'c' is implicitly defined more than once
21 // CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here
22 // CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here
24 def NamedAndUnnamed : DiagGroup<"d">;
25 def : DiagGroup<"d">;
26 // CHECK: redefined-group.td:[[@LINE-2]]:5: error: group 'd' is defined more than once
27 // CHECK: redefined-group.td:[[@LINE-2]]:1: note: also defined here
29 def : DiagGroup<"e">;
30 def NamedAndUnnamed2 : DiagGroup<"e">;
31 // CHECK: redefined-group.td:[[@LINE-1]]:5: error: group 'e' is defined more than once
32 // CHECK: redefined-group.td:[[@LINE-3]]:1: note: also defined here
34 def InGroupF1 : Warning<"">, InGroup<DiagGroup<"f">>;
35 def : DiagGroup<"f">; // FIXME: It'd be nice to also note this, but it's hard to detect.
36 def InGroupF2 : Warning<"">, InGroup<DiagGroup<"f">>;
37 def GroupF : DiagGroup<"f">;
38 def InGroupF3 : Warning<"">, InGroup<GroupF>;
39 def InGroupF4 : Warning<"">, InGroup<DiagGroup<"f">>;
40 // CHECK: redefined-group.td:[[@LINE-5]]:1: error: group 'f' is defined more than once
41 // CHECK: redefined-group.td:[[@LINE-7]]:5: note: also implicitly defined here
42 // CHECK: redefined-group.td:[[@LINE-6]]:5: note: also implicitly defined here
43 // CHECK: redefined-group.td:[[@LINE-4]]:5: note: also implicitly defined here