aaronpuchert added a comment.

Again, I'm not sure if it helps to use `getDecltypeForParenthesizedExpr` where 
we don't actually have the `decltype` of a parenthesized expression.

It's probably not entirely coincidental, but things aren't defined this way.



================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:5845
+  if (!To->isRValue()) {
+    QualType T = Self.Context.getDecltypeForParenthesizedExpr(To);
     InitializedEntity Entity = InitializedEntity::InitializeTemporary(T);
----------------
mizvekov wrote:
> aaronpuchert wrote:
> > The quote doesn't reference parenthesized expressions, isn't this just 
> > coincidentally the same thing?
> It's fundamentally the same thing. The `getDecltypeForParenthesizedExpr` name 
> is what I tried to keep, I don't have better ideas there.
What this is doing is pointwise equal to `getDecltypeForParenthesizedExpr`, but 
there is no parenthesized expression, and no `decltype`. There is a quote from 
the standard that defines this separately (by now this seems to be 
[[http://eel.is/c++draft/expr.cond#4|expr.cond#4]]), and there are some 
differences especially in the prvalue case. So I'm not sure this helps.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100713

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

Reply via email to