This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Reject in-class defaulting of previously declared comparison operators
ClosedPublic

Authored by royjacobson on Jan 15 2023, 2:42 PM.

Details

Summary

Comparison operators are not allowed to be defaulted if they were previously declared outside the class.
Pretty low-impact, but it's nice to reject this without a linking error.
Fixes https://github.com/llvm/llvm-project/issues/51227.

Diff Detail

Event Timeline

royjacobson created this revision.Jan 15 2023, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 15 2023, 2:42 PM
royjacobson requested review of this revision.Jan 15 2023, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 15 2023, 2:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

rebase on main

ChuanqiXu accepted this revision.Jan 16 2023, 11:34 PM
ChuanqiXu added a subscriber: ChuanqiXu.

LGTM.

This revision is now accepted and ready to land.Jan 16 2023, 11:34 PM
shafik added a subscriber: shafik.Jan 17 2023, 8:42 AM

Interesting it looks like neither gcc nor MSVC diagnose this either but it looks correct to me.

This revision was landed with ongoing or failed builds.Jan 17 2023, 12:30 PM
This revision was automatically updated to reflect the committed changes.