[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 9 08:30:34 PDT 2024


================
@@ -1581,26 +1581,33 @@ class TemplateTemplateParmDecl final
       DefaultArgStorage<TemplateTemplateParmDecl, TemplateArgumentLoc *>;
   DefArgStorage DefaultArgument;
 
+  /// Whether this template template parameter was declaration with
+  /// the 'typename' keyword.
+  ///
+  /// If false, it was declared with the 'class' keyword.
+  bool Typename : 1;
----------------
erichkeane wrote:

I like the bitfield nature here, but would prefer we do an 'unsigned' for each, and just 'treat' them as a bool later (it is a bit of a convention here).

Additionally, `Typename` should have an enum value that it gets compared to, rather than true meaning typename, false meaning class.

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


More information about the cfe-commits mailing list