rsmith added a comment.

The direction here looks fine to me.


================
Comment at: lib/Sema/SemaInit.cpp:369
@@ +368,3 @@
+       ND = dyn_cast<NamespaceDecl>(ND->getParent())) {
+    if (S.getStdNamespace()->InEnclosingNamespaceSetOf(ND))
+      return true;
----------------
I wonder if this recursion through non-inline namespaces is really warranted; 
can we replace the call to this function with `R->isInStdNamespace()`?

================
Comment at: lib/Sema/SemaInit.cpp:434-435
@@ -424,10 +433,4 @@
         SemaRef.SourceMgr.isInSystemHeader(CtorDecl->getLocation())) {
-      bool IsInStd = false;
-      for (NamespaceDecl *ND = dyn_cast<NamespaceDecl>(R->getDeclContext());
-           ND && !IsInStd; ND = dyn_cast<NamespaceDecl>(ND->getParent())) {
-        if (SemaRef.getStdNamespace()->InEnclosingNamespaceSetOf(ND))
-          IsInStd = true;
-      }
-
-      if (IsInStd && llvm::StringSwitch<bool>(R->getName()) 
+      if (IsContainedInNamespaceStd(SemaRef, R) &&
+          llvm::StringSwitch<bool>(R->getName())
               .Cases("basic_string", "deque", "forward_list", true)
----------------
(Please commit this separately if you still want to make this change.)


http://reviews.llvm.org/D16552



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

Reply via email to