This is an archive of the discontinued LLVM Phabricator instance.

[ODRHash][NFC] Add missing 'select' case for `ODRMismatchDecl`.
ClosedPublic

Authored by vsapsai on May 27 2022, 2:13 PM.

Details

Summary

No test changes because err_module_odr_violation_mismatch_decl_unknown
is a catch-all when custom diagnostic is missing. And missing custom
diagnostic we should fix by implementing it, not by improving the
general case. But if we pass enum value not covered by 'select', clang
can crash, so protect against that.

Diff Detail

Event Timeline

vsapsai created this revision.May 27 2022, 2:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2022, 2:13 PM
Herald added a subscriber: ributzka. · View Herald Transcript
vsapsai requested review of this revision.May 27 2022, 2:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2022, 2:13 PM
rsmith added a subscriber: rsmith.May 27 2022, 2:23 PM

We perhaps can't or don't want to add test coverage for the "unexpected decl" case here. Can we add coverage for the "function template" case?

To trigger "function template|different function template" diagnostic we need the entire "case FunctionTemplate" in "switch (FirstDiffType)" not to detect any mismatches. And I don't know any such cases.

rsmith accepted this revision.May 27 2022, 6:04 PM

OK, fair enough.

This revision is now accepted and ready to land.May 27 2022, 6:04 PM
This revision was landed with ongoing or failed builds.May 30 2022, 10:07 AM
This revision was automatically updated to reflect the committed changes.

Thanks for the review!