[include-fixer] Always ignore SFINAE contexts.

This could lead to spurious includes being added for identifiers that
are supposed to be not available.

llvm-svn: 269195
This commit is contained in:
Benjamin Kramer 2016-05-11 15:33:30 +00:00
parent 3246fba975
commit 79acc976ea
1 changed files with 8 additions and 0 deletions

View File

@ -94,6 +94,10 @@ public:
/// have the fully qualified name ready. Just query that.
bool MaybeDiagnoseMissingCompleteType(clang::SourceLocation Loc,
clang::QualType T) override {
// Ignore spurious callbacks from SFINAE contexts.
if (getCompilerInstance().getSema().isSFINAEContext())
return false;
clang::ASTContext &context = getCompilerInstance().getASTContext();
query(T.getUnqualifiedType().getAsString(context.getPrintingPolicy()), Loc);
return false;
@ -107,6 +111,10 @@ public:
DeclContext *MemberContext,
bool EnteringContext,
const ObjCObjectPointerType *OPT) override {
// Ignore spurious callbacks from SFINAE contexts.
if (getCompilerInstance().getSema().isSFINAEContext())
return clang::TypoCorrection();
/// If we have a scope specification, use that to get more precise results.
std::string QueryString;
if (SS && SS->getRange().isValid()) {