aaron.ballman added a comment.

On the whole, this approach looks reasonable to me. Just a few minor nits for 
clarity.



================
Comment at: lib/Sema/SemaExprCXX.cpp:1286-1293
+    if (ListInitialization)
+      // FIXME: CXXUnresolvedConstructExpr does not model list-initialization
+      // directly. We work around this by dropping the locations of the braces.
+      return CXXUnresolvedConstructExpr::Create(
+          Context, TInfo, SourceLocation(), Exprs, SourceLocation());
+    else
+      return CXXUnresolvedConstructExpr::Create(
----------------
I think this could be changed to reduce the number of returns:
```
SourceLocation Open, Close; // Or use a range and get rid of the funky 
std::tie() calls
// FIXME: <blah>
if (!ListInitialization)
  std::tie(Open, Close) = std::tie(LParenOrBraceLoc, RParenOrBraceLoc);
return  CXXUnresolvedConstructExpr::Create(Context, TInfo, Open, Exprs, Close);
```


================
Comment at: lib/Sema/SemaExprCXX.cpp:1380
     QualType ResultType = Result.get()->getType();
-    Result = CXXFunctionalCastExpr::Create(
-        Context, ResultType, Expr::getValueKindForType(Ty), TInfo,
-        CK_NoOp, Result.get(), /*Path=*/nullptr, LParenLoc, RParenLoc);
+    if (ListInitialization)
+      Result = CXXFunctionalCastExpr::Create(
----------------
Can use the same trick here.


https://reviews.llvm.org/D41921



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

Reply via email to