diff options
| author | John McCall <rjmccall@apple.com> | 2010-03-18 06:42:38 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-03-18 06:42:38 +0000 |
| commit | 84f02673015ec3503395f4bf5b35f42a36f541be (patch) | |
| tree | fe37d3bc022c1bda9cc8c495fa20c6928ee33bc6 /clang/lib/Sema | |
| parent | 48ad2c92fcd2e913df1364fd75183a4ed0339695 (diff) | |
| download | bcm5719-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')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
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); |

