This patch allows pointer to const& member functions on rvalues for C++20, and as an extension for prior versions. This is P0704r1.
Details
Diff Detail
Event Timeline
Thanks!
include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
4091 | I would be inclined to use an Extension rather than an ExtWarn for this. (I really don't see why we didn't move this as a DR -- it seems to be obviously a defect rather than an extension to me.) | |
4092 | Hmm, this seems hard to express clearly and concisely. How about something like: "invoking a pointer to a 'const &' member function on an rvalue is a C++2a extension" | |
4093 | Please mark this as SFINAEFailure too; if we're going to reject under -pedantic-errors, we should also treat it as SFINAEable. |
Oh, and you'll need an accompanying test case before this can be committed (look at the existing tests in test/SemaCXX for ideas).
Thanks, will you need someone to commit this for you?
include/clang/Basic/DiagnosticGroups.td | ||
---|---|---|
794 ↗ | (On Diff #111602) | We've historically avoided using precise year numbers until a standard is finalized. I would call this CXX2a for now, and only provide the c++2a-extensions spelling, just in case the next standard ships a year late (or early). |
include/clang/Basic/DiagnosticSemaKinds.td | ||
4095–4096 | Please also update this to match the prior diagnostic's text. | |
4097 | This should now be in a CXXPre2aCompatPedantic group, because the corresponding extension is a pedantic warning. |
I would be inclined to use an Extension rather than an ExtWarn for this. (I really don't see why we didn't move this as a DR -- it seems to be obviously a defect rather than an extension to me.)