This patch implemed the change proposed in [P2002R1] to 11.11.1 [class.compare.default] paragraph 1.
A defaulted compariosn operator function must be non-volatile and must either have no ref-qualifier or the ref-qualifier &.
Differential D148924
[clang] Show error if defaulted comparions operator function is volatile or has ref-qualifier &&. massberg on Apr 21 2023, 7:43 AM. Authored by
Details
This patch implemed the change proposed in [P2002R1] to 11.11.1 [class.compare.default] paragraph 1. A defaulted compariosn operator function must be non-volatile and must either have no ref-qualifier or the ref-qualifier &.
Diff Detail
Event TimelineComment Actions Thanks! I believe we should also recover in the similar manner we do for missing const, see corresponding comment. Extra NITs:
Also adding @clang-language-wg in case someone else wants to chime in.
Comment Actions Basically looking good to me now, but the changes need a release note and I does this mean we can change cxx_status.html to claim full support for P2002R1 now or is there more left to be done for that? (If there's more left to do, adding those details to the cxx_status page would be appropriate.)
Comment Actions Did you verify that the rest of P2002R1 was implemented correctly? There are a lot more changes in that paper than just this tiny bit, so if we're not certain this finishes things, we shouldn't mark the status as complete (but if we're figuring out what's missing, we should capture those details somewhere so we know what's left to do) https://github.com/llvm/llvm-project/commit/b74a381296eef048911bb22dc4eb2d3598460470 is what marked the status as partial, but there's no explanation as to why it was partial. Perhaps @rsmith remembers what was left to be done there. Comment Actions I have checked the paper P2002R1 and as far as I can tell it is fully implemented when this patch has landed. Comment Actions So I read the paper but since the paper does not have examples for each change nor does it have any links to DRs it is not obvious without spending some time to verify that we support each section. Changes like these really should come with examples in the paper to demonstrate behavior before and after. I searched in the code and found that @rsmith labelled P2002R0 changes with comments and so a cursory look at those changes side by side with the paper seems to indicate that we probably covered most of the cases but I am not 100% sure. There is test coverage added with those changes as well but again relating each test to specific paper section is not trivial, at least for me. The paper also uses the term constexpr compatible which has been replaced with constexpr suitable and not sure if that has any practical effect here. Comment Actions They seem to be different terms, constexpr-suitable does not actually replace constexpr-compatible. The former refers to more basic checks (i.e. "not a coroutine", "not a ctor or dtor for a class with virtual bases"), the latter only pops up in context of defaulted functions. Comment Actions @massberg did we figure out if there is anything else left from P2002R1? Are there blockers to landing this? Comment Actions The only thing I came across was https://reviews.llvm.org/D151200 (error out when parameters of defaulted comparison operator aren't as expected), but this is already submitted. So I'm not aware of any blockers. Comment Actions Since there are no remaining blockers, LGTM from my side. @shafik, @aaron.ballman, @rsmith please let us know if you want to make another run through the paper to do extra checking. Comment Actions LGTM aside from a minor issue with the status page (we use unreleased until the current version is released).
|
NIT: for consistency with wording of notes above.