[clang] [clang] Improved isSimpleTypeSpecifier (PR #79037)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 26 18:55:43 PST 2024


================
@@ -156,24 +161,19 @@ bool Sema::isSimpleTypeSpecifier(tok::TokenKind Kind) const {
 #define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) case tok::kw___##Trait:
 #include "clang/Basic/TransformTypeTraits.def"
   case tok::kw___auto_type:
-    return true;
-
-  case tok::annot_typename:
+  case tok::kw__Bool:
   case tok::kw_char16_t:
   case tok::kw_char32_t:
   case tok::kw_typeof:
-  case tok::annot_decltype:
   case tok::kw_decltype:
-    return getLangOpts().CPlusPlus;
-
   case tok::kw_char8_t:
-    return getLangOpts().Char8;
+    if (!Tok.hasIdentifierInfo())
+      return false;
+    return Tok.getIdentifierInfo()->isKeyword(LangOpts);
----------------
owenca wrote:

```suggestion
    return Tok.getIdentifierInfo()->isKeyword(getLangOpts());
```

https://github.com/llvm/llvm-project/pull/79037


More information about the cfe-commits mailing list