diff options
author | Richard Smith <richard@metafoo.co.uk> | 2021-10-06 14:11:32 -0700 |
---|---|---|
committer | Richard Smith <richard@metafoo.co.uk> | 2021-10-06 15:13:05 -0700 |
commit | 7063b76b02484f93104f1c79496ad216b9bf5b87 (patch) | |
tree | a55787ac69b2e5faedae78ce35a280655a36ea9e /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 7ebcb7ce78f6abb73c5a29e7c8b9dd360acb65bc (diff) | |
download | llvm-7063b76b02484f93104f1c79496ad216b9bf5b87.zip llvm-7063b76b02484f93104f1c79496ad216b9bf5b87.tar.gz llvm-7063b76b02484f93104f1c79496ad216b9bf5b87.tar.bz2 |
PR50644: Do not warn on a declaration of `operator"" _foo`.
Also do not warn on `#define _foo` or `#undef _foo`.
Only global scope names starting with _[a-z] are reserved, not the use
of such an identifier in any other context.
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 610c64d..2186eec 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -743,9 +743,7 @@ getRequiredQualification(ASTContext &Context, const DeclContext *CurContext, static bool shouldIgnoreDueToReservedName(const NamedDecl *ND, Sema &SemaRef) { ReservedIdentifierStatus Status = ND->isReserved(SemaRef.getLangOpts()); // Ignore reserved names for compiler provided decls. - if ((Status != ReservedIdentifierStatus::NotReserved) && - (Status != ReservedIdentifierStatus::StartsWithUnderscoreAtGlobalScope) && - ND->getLocation().isInvalid()) + if (isReservedInAllContexts(Status) && ND->getLocation().isInvalid()) return true; // For system headers ignore only double-underscore names. |