rsmith added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:6417-6425
@@ +6416,11 @@
+    if (isa<CXXConstructorDecl>(NewDC) && isa<ParmVarDecl>(D)) {
+      if (Diags.isIgnored(diag::warn_ctor_parm_shadows_field, R.getNameLoc())) 
{
+        D = D->getCanonicalDecl();
+        ShadowingDecls.insert({D, FD});
+      } else {
+        Diag(R.getNameLoc(), diag::warn_ctor_parm_shadows_field)
+            << D << FD << FD->getParent();
+        Diag(FD->getLocation(), diag::note_previous_declaration);
+      }
+      return;
+    }
----------------
I would prefer for us to produce the -Wshadow "modifying shadowed" warning 
where it applies, even when -Wshadow-all is enabled. The usual model is to act 
as if -W* flags are just a filter over the diagnostic output, and this diverges 
from that.
Is the goal to ensure that -Wshadow-field-in-constructor diagnoses all 
constructor parameter / field shadowing, even if -Wshadow is not enabled?


http://reviews.llvm.org/D18271



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

Reply via email to