[clang] [clang] Fix elaborated keyword canonicalization (PR #135916)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 16 06:42:22 PDT 2025


================
@@ -2838,6 +2838,18 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
   /// immediately following this class.
   template <typename T> const T *getAs() const;
 
+  /// Look through sugar for an instance of TemplateSpecializationType which
+  /// is not a type alias.
+  const TemplateSpecializationType *
+  getAsNonAliasTemplateSpecializationType() const;
+
+  const TemplateSpecializationType *
+  castAsNonAliasTemplateSpecializationType() const {
+    auto TST = getAsNonAliasTemplateSpecializationType();
----------------
erichkeane wrote:

As an interface, I question these two functions looking like/working like a getAs/castAs.  I would expect us to be able to do a `normal` `getAs` on these (perhaps with a specialization), and have it be right, but the not-type-alias part is a little different/jarring.  

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


More information about the cfe-commits mailing list