aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2022-08-03 07:14:11 -0700
committerErich Keane <erich.keane@intel.com>2022-08-03 07:15:30 -0700
commitbf6db18e52815475baebff2c330763fedac6b5e4 (patch)
tree064e010597f0e034255fa13ce54f7f4dcfec0dd4 /clang/lib/Basic/IdentifierTable.cpp
parent96faef0f6ea168cdcc570c0b8080c3ac69b99b31 (diff)
downloadllvm-bf6db18e52815475baebff2c330763fedac6b5e4.zip
llvm-bf6db18e52815475baebff2c330763fedac6b5e4.tar.gz
llvm-bf6db18e52815475baebff2c330763fedac6b5e4.tar.bz2
Fix char8_t in C mode regression from fb65b179
When doing that NFC refactor, I'd messed up how char8_t was reported, which resulted in it being considered a 'future' keyword, without the corresponding diagnostic, which lead to an assert. This patch corrects the char8_t to ONLY be future in C++ mode.
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 4bf9e12..06f0850 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -179,7 +179,8 @@ static KeywordStatus getKeywordStatusHelper(const LangOptions &LangOpts,
case CHAR8SUPPORT:
if (LangOpts.Char8) return KS_Enabled;
if (LangOpts.CPlusPlus20) return KS_Unknown;
- return KS_Future;
+ if (LangOpts.CPlusPlus) return KS_Future;
+ return KS_Unknown;
case KEYOBJC:
// We treat bridge casts as objective-C keywords so we can warn on them
// in non-arc mode.