Skip to content

Commit af97ade

Browse files
committed
fixup! [clang-tidy] Improved readability redundant casting with enums
Code Review & Removed non-portable test
1 parent a786f62 commit af97ade

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ Changes in existing checks
224224

225225
- Improved :doc:`readability-redundant-casting
226226
<clang-tidy/checks/readability/redundant-casting>` check by fixing
227-
false negatives related to ``enum`` when setting ``IgnoreTypeAliases``
228-
to true.
227+
false negatives related to ``enum`` when setting `IgnoreTypeAliases`
228+
to `true`.
229229

230230

231231
- Improved :doc:`readability-redundant-smartptr-get

clang-tools-extra/test/clang-tidy/checkers/readability/redundant-casting.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,13 @@ void testRedundantDependentNTTPCasting() {
224224

225225
enum E1 : char {};
226226
enum class E2 : char {};
227-
enum E3 {};
228227

229-
void testEnum(E1 e1, E2 e2, E3 e3){
228+
void testEnum(E1 e1, E2 e2){
230229
char a = static_cast<char>(e1);
231230
// CHECK-MESSAGES-ALIASES: :[[@LINE-1]]:12: warning: redundant explicit casting to the same type 'char' as the sub-expression, remove this casting [readability-redundant-casting]
232231
// CHECK-MESSAGES-ALIASES: :[[@LINE-3]]:18: note: source type originates from referencing this parameter
233232
// CHECK-FIXES-ALIASES: {{^}} char a = e1;
234233

235-
unsigned int d = static_cast<unsigned int>(e3);
236-
// CHECK-MESSAGES-ALIASES: :[[@LINE-1]]:20: warning: redundant explicit casting to the same type 'unsigned int' as the sub-expression, remove this casting [readability-redundant-casting]
237-
// CHECK-MESSAGES-ALIASES: :[[@LINE-8]]:32: note: source type originates from referencing this parameter
238-
// CHECK-FIXES-ALIASES: {{^}} unsigned int d = e3;
239-
240234
char b = static_cast<char>(e2);
241-
char c = static_cast<char>(e3);
242235
E1 e = static_cast<E1>('0');
243236
}

0 commit comments

Comments
 (0)