[PATCH] D31235: Enhance -Wshadow to warn when shadowing typedefs or type aliases

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 30 17:46:56 PDT 2017


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

Looks good to me



================
Comment at: lib/Sema/SemaDecl.cpp:6710-6711
+    
+  // Return false if warning is ignored.
+  if (Diags.isIgnored(diag::warn_decl_shadow, R.getNameLoc()))
+    return false;
----------------
I would recommend reordering these checks. Examining our name lookup result is going to be way faster than asking the diagnostic machinery if a warning is enabled. That code is unfortunately quite slow.


https://reviews.llvm.org/D31235





More information about the cfe-commits mailing list