aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-20 17:58:49 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-20 17:58:49 +0000
commitcb8f951deacd251d9b3a73dc65f341477e039de1 (patch)
treeb2f127630073333a8c1f2aa13658e54eb9611360 /lib/Sema/SemaDecl.cpp
parentf89bc0500c74a590ff9e99aab75bcc22d05bc760 (diff)
There's no point in marking a declaration invalid just because it
shadows a template parameter. Complain about the shadowing (or not, under -fms-extensions), but don't invalidate the declaration. Merely forget about the template parameter declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142596 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index bccb63eede..eff21cb12b 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3347,9 +3347,8 @@ Decl *Sema::HandleDeclarator(Scope *S, Declarator &D,
Previous.getFoundDecl()->isTemplateParameter()) {
// Maybe we will complain about the shadowed template parameter.
if (!D.isInvalidType())
- if (DiagnoseTemplateParameterShadow(D.getIdentifierLoc(),
- Previous.getFoundDecl()))
- D.setInvalidType();
+ DiagnoseTemplateParameterShadow(D.getIdentifierLoc(),
+ Previous.getFoundDecl());
// Just pretend that we didn't see the previous declaration.
Previous.clear();