[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 10:06:17 PDT 2024


================
@@ -309,35 +309,35 @@ bool TemplateDecl::isTypeAlias() const {
 void RedeclarableTemplateDecl::anchor() {}
 
 RedeclarableTemplateDecl::CommonBase *RedeclarableTemplateDecl::getCommonPtr() const {
-  if (Common)
-    return Common;
+  if (CommonBase *C = Common.getPointer())
----------------
erichkeane wrote:

Looks like we should have a function on `RedeclarableTemplateDecl` to do this... its a shame that `getCommonPtr` is taken, but perhaps a private helper here would be nice.  Something like `getCommonPtrInternal` or something?  With a comment that makes it clear what it is doing.

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


More information about the cfe-commits mailing list