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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user