rsmith added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:1615
@@ -1614,2 +1614,3 @@
     IdResolver.RemoveDecl(D);
+    ShadowingDecls.erase(D);
   }
----------------
This'd be a good place to produce a -Wshadow-constructor or similar warning if 
D is still in the map.

================
Comment at: lib/Sema/SemaDecl.cpp:6483
@@ +6482,3 @@
+  const NamedDecl *D = DRE->getDecl();
+  auto I = ShadowingDecls.find(D);
+  if (I == ShadowingDecls.end())
----------------
Maybe map to the canonical decl before using the `Decl*` as a key? (This 
doesn't matter for now, but we'll likely want to extend this to other kinds of 
shadowing in the future.)

================
Comment at: lib/Sema/SemaDecl.cpp:6489-6490
@@ +6488,4 @@
+  ShadowedDeclKind Kind = computeShadowedDeclKind(ShadowedDecl, OldDC);
+  Diag(Loc, diag::warn_modifying_shadowing_decl) << D << Kind << OldDC;
+  Diag(ShadowedDecl->getLocation(), diag::note_previous_declaration);
+
----------------
Could be useful to also note the location of the shadowing decl.


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