aaron.ballman added a comment.

In D129488#3758449 <https://reviews.llvm.org/D129488#3758449>, @jyknight wrote:

> I'm confused about this new strategy of special-casing 
> `source_location::current()`. Isn't it wrong to eagerly evaluate _other_ 
> calls in default args, as well? ISTM that source_location is simply 
> _exposing_ the bug in where we evaluate these expressions, but that it's 
> actually a more general problem?

+1 -- special casing things by name is almost always a red flag in the frontend 
(we do it from time to time when trying to add compatibility hacks for broken 
3rd party headers though, which is reasonable). I don't think there's supposed 
to be anything special about `std::source_location::current()` evaluation. 
Default arguments are always evaluated at the site of the call, not the callee, 
so eager evaluation seems like the root cause of the problem.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129488

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to