================
@@ -597,6 +592,15 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID,
SourceLocation Loc,
return Result;
}
+DiagnosticIDs::Class DiagnosticIDs::getDiagClass(unsigned DiagID) const {
+ if (IsCustomDiag(DiagID))
+ return Class(CustomDiagInfo->getDescription(DiagID).GetClass());
+
+ if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID))
+ return Class(Info->Class);
+ return Class(~0U);
----------------
AaronBallman wrote:
This is UB because it's outside the range of representable values for the
`Class` enum; maybe make it an enum member instead?
https://github.com/llvm/llvm-project/pull/70976
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits