LGTM with a couple of minor changes.

================
Comment at: lib/Sema/SemaInit.cpp:5768-5769
@@ +5767,4 @@
+      InitExpr = MTE->GetTemporaryExpr()->IgnoreImpCasts();
+      while (const CXXConstructExpr *CCE =
+                 dyn_cast<CXXConstructExpr>(InitExpr)) {
+        if (CCE->getNumArgs() != 1)
----------------
If `CCE` is a `CXXTemporaryObjectExpr` (which derives from `CXXConstructExpr`), 
you shouldn't step through it here -- `CXXTemporaryObjectExpr` is always 
modeling explicit syntax.

================
Comment at: lib/Sema/SemaInit.cpp:5770
@@ +5769,3 @@
+                 dyn_cast<CXXConstructExpr>(InitExpr)) {
+        if (CCE->getNumArgs() != 1)
+          return;
----------------
It would be marginally better to check

    CCE->getNumArgs() == 0 ||
    (CCE->getNumArgs() > 1 && !isa<CXXDefaultArgExpr>(CCE->getArg(1)))

in case the constructor has a default argument.

http://reviews.llvm.org/D7633

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to