[PATCH] D18271: Avoid -Wshadow warnings about constructor parameters named after fields

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 14:51:27 PDT 2016


rsmith accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: include/clang/Basic/DiagnosticGroups.td:341-342
@@ +340,4 @@
+
+def ShadowFieldInConstructor : DiagGroup<"shadow-field-in-constructor">;
+def ShadowFieldInConstructorModified : DiagGroup<"shadow-field-in-constructor-modified">;
+
----------------
Should `ShadowFieldInConstructorModified` be a subgroup of `ShadowFieldInConstructor`? I'd expect `-Wshadow-field-in-constructor` to enable both.

================
Comment at: lib/Sema/SemaDecl.cpp:6444
@@ +6443,3 @@
+      // Remember that this was shadowed so we can either warn about its
+      // modification or its existance depending on warning settings.
+      D = D->getCanonicalDecl();
----------------
existance -> existence


http://reviews.llvm.org/D18271





More information about the cfe-commits mailing list