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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 14 10:02:44 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaOverload.cpp:13800
 
         ExprResult R = MaybeBindToTemporary(TheCall);
         if (R.isInvalid())
----------------
erichkeane wrote:
> Wonder if as a 'while we're here' we should make this the same as the others? Does `CheckForImmediateInvocation` handle an invalid result without the extra check like we have here?
`CheckForImmediateInvocation` handles invalid results (I checked), so we could remove the isInvalid() lines below if we wanted (that's really an NFC cleanup).


================
Comment at: clang/lib/Sema/SemaOverload.cpp:14290
 
     return MaybeBindToTemporary(call);
   }
----------------
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.


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