[PATCH] D31235: Enhance -Wshadow to warn when shadowing typedefs or type aliases
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 22 11:20:40 PDT 2017
arphaman added inline comments.
================
Comment at: lib/Sema/SemaDecl.cpp:6753
// the constructor initializes the field with the parameter.
- if (isa<CXXConstructorDecl>(NewDC) && isa<ParmVarDecl>(D)) {
- // Remember that this was shadowed so we can either warn about its
- // modification or its existence depending on warning settings.
- D = D->getCanonicalDecl();
- ShadowingDecls.insert({D, FD});
- return;
- }
+ if (isa<CXXConstructorDecl>(NewDC))
+ if (ParmVarDecl* PVD = dyn_cast<ParmVarDecl>(D)) {
----------------
Why is the change to this `if` necessary? It doesn't seem that related to the main change.
https://reviews.llvm.org/D31235
More information about the cfe-commits
mailing list