summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-18 06:42:38 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-18 06:42:38 +0000
commit84f02673015ec3503395f4bf5b35f42a36f541be (patch)
treefe37d3bc022c1bda9cc8c495fa20c6928ee33bc6 /clang/lib/Sema/SemaDecl.cpp
parent48ad2c92fcd2e913df1364fd75183a4ed0339695 (diff)
downloadbcm5719-llvm-84f02673015ec3503395f4bf5b35f42a36f541be.tar.gz
bcm5719-llvm-84f02673015ec3503395f4bf5b35f42a36f541be.zip
Redeclaration lookups for parameter names should be flagged as redeclaration lookups
so they don't trigger diagnostics like (say) access control. llvm-svn: 98806
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 19885ba9cf6..2e69108617e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3950,7 +3950,11 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
// Check for redeclaration of parameters, e.g. int foo(int x, int x);
IdentifierInfo *II = D.getIdentifier();
if (II) {
- if (NamedDecl *PrevDecl = LookupSingleName(S, II, LookupOrdinaryName)) {
+ LookupResult R(*this, II, D.getIdentifierLoc(), LookupOrdinaryName,
+ ForRedeclaration);
+ LookupName(R, S);
+ if (R.isSingleResult()) {
+ NamedDecl *PrevDecl = R.getFoundDecl();
if (PrevDecl->isTemplateParameter()) {
// Maybe we will complain about the shadowed template parameter.
DiagnoseTemplateParameterShadow(D.getIdentifierLoc(), PrevDecl);
OpenPOWER on IntegriCloud