Skip to content

Commit 8cc842a

Browse files
committed
[clang][Sema] Use enumerator instead of hard-coded constant
Sema::DiagnoseSwiftName uses the constant 12 instead of the corresponding enumerator ExpectedFunctionWithProtoType. This is fragile and will fail if a new value gets added in the middle of the enum. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D88164
1 parent 4035cb7 commit 8cc842a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5868,7 +5868,7 @@ bool Sema::DiagnoseSwiftName(Decl *D, StringRef Name, SourceLocation Loc,
58685868

58695869
if (!F->hasWrittenPrototype()) {
58705870
Diag(Loc, diag::warn_attribute_wrong_decl_type) << AL
5871-
<< /* non-K&R-style functions */12;
5871+
<< ExpectedFunctionWithProtoType;
58725872
return false;
58735873
}
58745874
}

0 commit comments

Comments
 (0)