[PATCH] D36855: Fixed pointer to const& member function on rvalues, P0704r1

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 17 18:06:24 PDT 2017


rsmith added a comment.

Thanks!



================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:4091
   "%select{rvalue|lvalue}1">;
+def ext_pointer_to_const_ref_member_on_rvalue : ExtWarn<
+  "pointer-to-member to const& function on an rvalue is a C++2a extension">,
----------------
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.)


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:4092
+def ext_pointer_to_const_ref_member_on_rvalue : ExtWarn<
+  "pointer-to-member to const& function on an rvalue is a C++2a extension">,
+  InGroup<CXX20>;
----------------
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"


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:4093
+  "pointer-to-member to const& function on an rvalue is a C++2a extension">,
+  InGroup<CXX20>;
+def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
----------------
Please mark this as `SFINAEFailure` too; if we're going to reject under `-pedantic-errors`, we should also treat it as SFINAEable.


https://reviews.llvm.org/D36855





More information about the cfe-commits mailing list