diff options
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 4330024e..8893bd2 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -739,18 +739,17 @@ getRequiredQualification(ASTContext &Context, const DeclContext *CurContext, // Filter out names reserved for the implementation if they come from a // system header. static bool shouldIgnoreDueToReservedName(const NamedDecl *ND, Sema &SemaRef) { - const IdentifierInfo *Id = ND->getIdentifier(); - if (!Id) - return false; - + ReservedIdentifierStatus Status = ND->isReserved(SemaRef.getLangOpts()); // Ignore reserved names for compiler provided decls. - if (Id->isReservedName() && ND->getLocation().isInvalid()) + if ((Status != ReservedIdentifierStatus::NotReserved) && + (Status != ReservedIdentifierStatus::StartsWithUnderscoreAtGlobalScope) && + ND->getLocation().isInvalid()) return true; // For system headers ignore only double-underscore names. // This allows for system headers providing private symbols with a single // underscore. - if (Id->isReservedName(/*doubleUnderscoreOnly=*/true) && + if (Status == ReservedIdentifierStatus::StartsWithDoubleUnderscore && SemaRef.SourceMgr.isInSystemHeader( SemaRef.SourceMgr.getSpellingLoc(ND->getLocation()))) return true; |