summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-13 15:14:38 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-13 15:14:38 +0000
commit712a351c42d5378ce02532802b51c5fb60e868af (patch)
treee0c6d6feda8ea0b24961f667bd19f2045872d923 /clang/lib/Sema/SemaDecl.cpp
parent092b8b6fdb36700f07b3097c13090ee99583a401 (diff)
downloadbcm5719-llvm-712a351c42d5378ce02532802b51c5fb60e868af.tar.gz
bcm5719-llvm-712a351c42d5378ce02532802b51c5fb60e868af.zip
Make the selection of type declarations in Sema::getTypeName
deterministic when faced with an ambiguity. This eliminates the annoying test/SemaCXX/using-directive.cpp failure. llvm-svn: 68952
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 7d276178916..018f74816a4 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -85,8 +85,10 @@ Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
for (LookupResult::iterator Res = Result.begin(), ResEnd = Result.end();
Res != ResEnd; ++Res) {
if (isa<TypeDecl>(*Res) || isa<ObjCInterfaceDecl>(*Res)) {
- IIDecl = *Res;
- break;
+ if (!IIDecl ||
+ (*Res)->getLocation().getRawEncoding() <
+ IIDecl->getLocation().getRawEncoding())
+ IIDecl = *Res;
}
}
OpenPOWER on IntegriCloud