aaron.ballman added inline comments.

================
Comment at: clang-tidy/abseil/AnonymousEnclosedAliasesCheck.cpp:41
+    // to the vector containing all candidate using declarations.
+    if (AnonymousNamespaceDecl) {
+               diag(MatchedUsingDecl->getLocation(),
----------------
Naysh wrote:
> aaron.ballman wrote:
> > I don't think this logic works in practice because there's no way to 
> > determine that the anonymous namespace is even a candidate for putting the 
> > using declaration into it. Consider a common scenario where there's an 
> > anonymous namespace declared in a header file (like an STL header outside 
> > of the user's control), and a using declaration inside of an implementation 
> > file. Just because the STL declared an anonymous namespace doesn't mean 
> > that the user could have put their using declaration in it.
> If we altered the check to only apply to anonymous namespaces and using 
> declarations at namespace scope (that is, we only suggest aliases be moved to 
> anonymous namespaces when the unnamed namespace and alias are themselves 
> inside some other namespace), would this issue be resolved? 
If they're inside the same namespace, then I think that could work, but if the 
namespaces are different I don't know that you can be sure the alias can be 
moved into the anonymous namespace.


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

https://reviews.llvm.org/D55409



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

Reply via email to