[PATCH] D111817: Fix a rejects-valid with consteval on overloaded operators

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 14 10:12:58 PDT 2021


erichkeane accepted this revision.
erichkeane added inline comments.


================
Comment at: clang/lib/Sema/SemaOverload.cpp:14290
 
     return MaybeBindToTemporary(call);
   }
----------------
rsmith wrote:
> aaron.ballman wrote:
> > erichkeane wrote:
> > > Was this one missed too?
> > I couldn't devise a test case that was failing with member function call expressions, so I left this one alone. We have a bunch of existing test coverage for calling a consteval member function, so I'm assuming this is correct, but if someone finds a test case that fails here, it's easy enough to fix.
> This code is only reachable for a call through a pointer-to-member. We don't need to worry about `consteval` member function pointers because they can't escape constant-evaluated contexts anyway. Eg, `(p->*&Class::consteval_fn)()` is ill-formed outside of a constant-evaluated context -- we should make sure we have a test for that.
I can't come up with one either, I think we're fine for now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111817/new/

https://reviews.llvm.org/D111817



More information about the cfe-commits mailing list