Survive and signal non-unique lookup results.
This commit is contained in:
parent
04d0d17f3e
commit
8b60eaf361
@ -189,7 +189,7 @@ namespace utils {
|
||||
///\param[in] Name - The name we are looking up.
|
||||
///\param[in] Within - The context within the lookup is done. If 0 the
|
||||
/// TranslationUnitDecl is used.
|
||||
///\returns the found result (if single) or 0.
|
||||
///\returns the found NamespaceDecl or 0.
|
||||
///
|
||||
clang::NamespaceDecl* Namespace(clang::Sema* S,
|
||||
const char* Name,
|
||||
@ -202,7 +202,7 @@ namespace utils {
|
||||
///\param[in] Name - The name we are looking up.
|
||||
///\param[in] Within - The context within the lookup is done. If 0 the
|
||||
/// TranslationUnitDecl is used.
|
||||
///\returns the found result (if single) or 0.
|
||||
///\returns the found result if single, -1 if multiple or 0 if not found.
|
||||
///
|
||||
clang::NamedDecl* Named(clang::Sema* S,
|
||||
const char* Name,
|
||||
@ -216,7 +216,7 @@ namespace utils {
|
||||
/// DeclarationName.h (faster at runtime).
|
||||
///\param[in] Within - The context within the lookup is done. If 0 the
|
||||
/// TranslationUnitDecl is used.
|
||||
///\returns the found result (if single) or 0.
|
||||
///\returns the found result if single, -1 if multiple or 0 if not found.
|
||||
///
|
||||
clang::NamedDecl* Named(clang::Sema* S,
|
||||
const clang::DeclarationName& Name,
|
||||
|
@ -1180,8 +1180,9 @@ namespace utils {
|
||||
|
||||
R.resolveKind();
|
||||
|
||||
return R.getFoundDecl();
|
||||
|
||||
if (R.isSingleResult())
|
||||
return R.getFoundDecl();
|
||||
return (clang::NamedDecl*)-1;
|
||||
}
|
||||
|
||||
static NestedNameSpecifier*
|
||||
|
Loading…
x
Reference in New Issue
Block a user