Fix char8_t in C mode regression from fb65b179
authorErich Keane <erich.keane@intel.com>
Wed, 3 Aug 2022 14:14:11 +0000 (07:14 -0700)
committerErich Keane <erich.keane@intel.com>
Wed, 3 Aug 2022 14:15:30 +0000 (07:15 -0700)
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.

clang/lib/Basic/IdentifierTable.cpp

index 4bf9e12..06f0850 100644 (file)
@@ -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.