kimgr added a comment.

@aaron.ballman Thanks for the valuable feedback!

> Assuming that the `to_lvalue_ref(A{})` case should diagnose, then yes, I 
> agree, I think the `ret_a()` portion should as well.

My primary focus is not to make sure Clang follows the standard closely for 
`consteval`, but rather to make sure it's self-consistent and doesn't provoke 
undefined behavior for `consteval` inputs.

So another way to think about it is that `to_lvalue_ref` and `ret_a` might both 
diagnose, or not, but absence of diagnostics should not be a result of 
misinterpreting the AST the way we do now.

I'm preparing a different patch to do the short-circuiting in 
`skipImplicitTemporary`, so we can more easily compare and contrast.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117391

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

Reply via email to