|
1 |
| -// RUN: %check_clang_tidy -std=c++11-or-later %s cppcoreguidelines-use-enum-class %t |
| 1 | +// RUN: %check_clang_tidy -std=c++11-or-later -check-suffix=ALL,DEFAULT %s \ |
| 2 | +// RUN: cppcoreguidelines-use-enum-class %t -- |
| 3 | + |
| 4 | +// RUN: %check_clang_tidy -std=c++11-or-later -check-suffix=ALL %s \ |
| 5 | +// RUN: cppcoreguidelines-use-enum-class %t -- \ |
| 6 | +// RUN: -config="{CheckOptions: { \ |
| 7 | +// RUN: cppcoreguidelines-use-enum-class.IgnoreUnscopedEnumsInClasses: true \ |
| 8 | +// RUN: }}" -- |
2 | 9 |
|
3 | 10 | enum E {};
|
4 |
| -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: enum 'E' is unscoped, use 'enum class' instead |
| 11 | +// CHECK-MESSAGES-ALL: :[[@LINE-1]]:6: warning: enum 'E' is unscoped, use 'enum class' instead |
5 | 12 |
|
6 | 13 | enum class EC {};
|
7 | 14 |
|
| 15 | +enum struct ES {}; |
| 16 | + |
8 | 17 | struct S {
|
9 | 18 | enum E {};
|
10 |
| - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead |
| 19 | + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead |
11 | 20 | enum class EC {};
|
12 | 21 | };
|
13 | 22 |
|
14 | 23 | class C {
|
15 | 24 | enum E {};
|
16 |
| - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead |
| 25 | + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead |
17 | 26 | enum class EC {};
|
18 | 27 | };
|
19 | 28 |
|
20 | 29 | template<class T>
|
21 | 30 | class TC {
|
22 | 31 | enum E {};
|
23 |
| - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead |
| 32 | + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead |
24 | 33 | enum class EC {};
|
25 | 34 | };
|
26 | 35 |
|
27 | 36 | union U {
|
28 | 37 | enum E {};
|
29 |
| - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead |
| 38 | + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead |
30 | 39 | enum class EC {};
|
31 | 40 | };
|
32 | 41 |
|
33 | 42 | namespace {
|
34 | 43 | enum E {};
|
35 |
| -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: enum 'E' is unscoped, use 'enum class' instead |
| 44 | +// CHECK-MESSAGES-ALL: :[[@LINE-1]]:6: warning: enum 'E' is unscoped, use 'enum class' instead |
36 | 45 | enum class EC {};
|
37 | 46 | } // namespace
|
38 | 47 |
|
39 | 48 | namespace N {
|
40 | 49 | enum E {};
|
41 |
| -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: enum 'E' is unscoped, use 'enum class' instead |
| 50 | +// CHECK-MESSAGES-ALL: :[[@LINE-1]]:6: warning: enum 'E' is unscoped, use 'enum class' instead |
42 | 51 | enum class EC {};
|
43 | 52 | } // namespace N
|
44 | 53 |
|
45 | 54 | template<enum ::EC>
|
46 | 55 | static void foo();
|
47 | 56 |
|
48 | 57 | enum ForwardE : int;
|
49 |
| -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: enum 'ForwardE' is unscoped, use 'enum class' instead |
| 58 | +// CHECK-MESSAGES-ALL: :[[@LINE-1]]:6: warning: enum 'ForwardE' is unscoped, use 'enum class' instead |
| 59 | + |
50 | 60 | enum class ForwardEC : int;
|
| 61 | + |
| 62 | +enum struct ForwardES : int; |
0 commit comments