This is an archive of the discontinued LLVM Phabricator instance.

[clang][Sema] Use enumerator instead of hard-coded constant
ClosedPublic

Authored by miyuki on Sep 23 2020, 9:51 AM.

Details

Summary

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.

Diff Detail

Event Timeline

miyuki created this revision.Sep 23 2020, 9:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2020, 9:51 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
miyuki requested review of this revision.Sep 23 2020, 9:51 AM
aaron.ballman accepted this revision.Sep 23 2020, 1:09 PM

Good catch, LGTM!

This revision is now accepted and ready to land.Sep 23 2020, 1:09 PM
This revision was landed with ongoing or failed builds.Sep 24 2020, 2:24 AM
This revision was automatically updated to reflect the committed changes.