diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-04-15 22:33:43 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-04-15 22:33:43 +0000 |
| commit | b2ccf010fb5e4b382bad7c4ea906ac88509ced47 (patch) | |
| tree | 9341de299319338ee4f3d92284e3bd317d0c3e8c /clang/lib/Sema/SemaDeclCXX.cpp | |
| parent | f7f97b4bbdf0cff78d95886953851aa17b64eb7b (diff) | |
| download | bcm5719-llvm-b2ccf010fb5e4b382bad7c4ea906ac88509ced47.tar.gz bcm5719-llvm-b2ccf010fb5e4b382bad7c4ea906ac88509ced47.zip | |
Feed proper source-location information into Sema::LookupSingleResult,
in case it ends up doing something that might trigger diagnostics
(template instantiation, ambiguity reporting, access
reporting). Noticed while working on PR6831.
llvm-svn: 101412
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 72f38b43cd2..ca4dc6f11d4 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -3018,7 +3018,7 @@ Sema::DeclPtrTy Sema::ActOnStartNamespaceDef(Scope *NamespcScope, // in that declarative region, it is treated as an original-namespace-name. NamedDecl *PrevDecl - = LookupSingleName(DeclRegionScope, II, LookupOrdinaryName, + = LookupSingleName(DeclRegionScope, II, IdentLoc, LookupOrdinaryName, ForRedeclaration); if (NamespaceDecl *OrigNS = dyn_cast_or_null<NamespaceDecl>(PrevDecl)) { @@ -3842,7 +3842,8 @@ Sema::DeclPtrTy Sema::ActOnNamespaceAliasDef(Scope *S, // Check if we have a previous declaration with the same name. if (NamedDecl *PrevDecl - = LookupSingleName(S, Alias, LookupOrdinaryName, ForRedeclaration)) { + = LookupSingleName(S, Alias, AliasLoc, LookupOrdinaryName, + ForRedeclaration)) { if (NamespaceAliasDecl *AD = dyn_cast<NamespaceAliasDecl>(PrevDecl)) { // We already have an alias with the same name that points to the same // namespace, so don't create a new one. @@ -4935,7 +4936,8 @@ Sema::DeclPtrTy Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) { bool Invalid = D.isInvalidType(); IdentifierInfo *II = D.getIdentifier(); - if (NamedDecl *PrevDecl = LookupSingleName(S, II, LookupOrdinaryName)) { + if (NamedDecl *PrevDecl = LookupSingleName(S, II, D.getIdentifierLoc(), + LookupOrdinaryName)) { // The scope should be freshly made just for us. There is just no way // it contains any previous declaration. assert(!S->isDeclScope(DeclPtrTy::make(PrevDecl))); |

