11// RUN: %check_clang_tidy %s cert-dcl16-c %t -- -- -I %clang_tidy_headers
2- // RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
3- // RUN: clang-tidy %t.cpp -checks='-*,cert-dcl16-c' -fix -- -I %clang_tidy_headers
4- // RUN: clang-tidy %t.cpp -checks='-*,cert-dcl16-c' -warnings-as-errors='-*,cert-dcl16-c' -- -I %clang_tidy_headers
52
63#include " integral_constant.h"
74
85void integer_suffix () {
96 static constexpr auto v0 = __LINE__; // synthetic
10- static_assert (v0 == 9 || v0 == 5 , " " );
11-
127 static constexpr auto v1 = __cplusplus; // synthetic, long
138
149 static constexpr auto v2 = 1 ; // no literal
@@ -29,9 +24,6 @@ void integer_suffix() {
2924
3025 static constexpr auto v5 = 1l ;
3126 // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'l', which is not uppercase
32- // CHECK-MESSAGES-NEXT: static constexpr auto v5 = 1l;
33- // CHECK-MESSAGES-NEXT: ^~
34- // CHECK-MESSAGES-NEXT: {{^ *| *}}L{{$}}
3527 // CHECK-FIXES: static constexpr auto v5 = 1L;
3628 static_assert (is_same<decltype (v5), const long >::value, " " );
3729 static_assert (v5 == 1 , " " );
@@ -44,9 +36,6 @@ void integer_suffix() {
4436
4537 static constexpr auto v7 = 1ll ;
4638 // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'll', which is not uppercase
47- // CHECK-MESSAGES-NEXT: static constexpr auto v7 = 1ll;
48- // CHECK-MESSAGES-NEXT: ^~~
49- // CHECK-MESSAGES-NEXT: {{^ *| *}}LL{{$}}
5039 // CHECK-FIXES: static constexpr auto v7 = 1LL;
5140 static_assert (is_same<decltype (v7), const long long >::value, " " );
5241 static_assert (v7 == 1 , " " );
@@ -77,27 +66,18 @@ void integer_suffix() {
7766
7867 static constexpr auto v13 = 1lu;
7968 // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'lu', which is not uppercase
80- // CHECK-MESSAGES-NEXT: static constexpr auto v13 = 1lu;
81- // CHECK-MESSAGES-NEXT: ^~~
82- // CHECK-MESSAGES-NEXT: {{^ *| *}}LU{{$}}
8369 // CHECK-FIXES: static constexpr auto v13 = 1LU;
8470 static_assert (is_same<decltype (v13), const unsigned long >::value, " " );
8571 static_assert (v13 == 1 , " " );
8672
8773 static constexpr auto v14 = 1Lu;
8874 // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'Lu', which is not uppercase
89- // CHECK-MESSAGES-NEXT: static constexpr auto v14 = 1Lu;
90- // CHECK-MESSAGES-NEXT: ^~~
91- // CHECK-MESSAGES-NEXT: {{^ *| *}}LU{{$}}
9275 // CHECK-FIXES: static constexpr auto v14 = 1LU;
9376 static_assert (is_same<decltype (v14), const unsigned long >::value, " " );
9477 static_assert (v14 == 1 , " " );
9578
9679 static constexpr auto v15 = 1lU;
9780 // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'lU', which is not uppercase
98- // CHECK-MESSAGES-NEXT: static constexpr auto v15 = 1lU;
99- // CHECK-MESSAGES-NEXT: ^~~
100- // CHECK-MESSAGES-NEXT: {{^ *| *}}LU{{$}}
10181 // CHECK-FIXES: static constexpr auto v15 = 1LU;
10282 static_assert (is_same<decltype (v15), const unsigned long >::value, " " );
10383 static_assert (v15 == 1 , " " );
@@ -128,27 +108,18 @@ void integer_suffix() {
128108
129109 static constexpr auto v21 = 1llu;
130110 // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'llu', which is not uppercase
131- // CHECK-MESSAGES-NEXT: static constexpr auto v21 = 1llu;
132- // CHECK-MESSAGES-NEXT: ^~~~
133- // CHECK-MESSAGES-NEXT: {{^ *| *}}LLU{{$}}
134111 // CHECK-FIXES: static constexpr auto v21 = 1LLU;
135112 static_assert (is_same<decltype (v21), const unsigned long long >::value, " " );
136113 static_assert (v21 == 1 , " " );
137114
138115 static constexpr auto v22 = 1LLu;
139116 // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'LLu', which is not uppercase
140- // CHECK-MESSAGES-NEXT: static constexpr auto v22 = 1LLu;
141- // CHECK-MESSAGES-NEXT: ^~~~
142- // CHECK-MESSAGES-NEXT: {{^ *| *}}LLU{{$}}
143117 // CHECK-FIXES: static constexpr auto v22 = 1LLU;
144118 static_assert (is_same<decltype (v22), const unsigned long long >::value, " " );
145119 static_assert (v22 == 1 , " " );
146120
147121 static constexpr auto v23 = 1llU;
148122 // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'llU', which is not uppercase
149- // CHECK-MESSAGES-NEXT: static constexpr auto v23 = 1llU;
150- // CHECK-MESSAGES-NEXT: ^~~~
151- // CHECK-MESSAGES-NEXT: {{^ *| *}}LLU{{$}}
152123 // CHECK-FIXES: static constexpr auto v23 = 1LLU;
153124 static_assert (is_same<decltype (v23), const unsigned long long >::value, " " );
154125 static_assert (v23 == 1 , " " );
0 commit comments