[clang-tools-extra] [NFC] Remove a wrong comment in ProTypeMemberInitCheck (PR #205477)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 23 21:28:26 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tools-extra

Author: flovent

<details>
<summary>Changes</summary>

`getAsCXXRecordDecl` will return nullptr for any dependent types.

It's introduced by #<!-- -->192786,  see https://github.com/llvm/llvm-project/pull/192786#issuecomment-4785223372 in original PR.

---
Full diff: https://github.com/llvm/llvm-project/pull/205477.diff


1 Files Affected:

- (modified) clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp (-2) 


``````````diff
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
index 74cd62cd869f8..7dd5b0b6ea108 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
@@ -572,8 +572,6 @@ void ProTypeMemberInitCheck::checkMissingBaseClassInitializer(
 
     for (const CXXCtorInitializer *Init : Ctor->inits())
       if (Init->isBaseInitializer() && Init->isWritten()) {
-        // In template AST BaseInitializer could be generated too even if it's
-        // not target to base class.
         if (const CXXRecordDecl *CRD =
                 Init->getBaseClass()->getAsCXXRecordDecl())
           BasesToInit.erase(CRD->getCanonicalDecl());

``````````

</details>


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


More information about the cfe-commits mailing list