[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:27:50 PDT 2026
https://github.com/flovent created https://github.com/llvm/llvm-project/pull/205477
`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.
>From 020a2c8d97c045d19cb4dad1ef3faaea6731919d Mon Sep 17 00:00:00 2001
From: flovent <flbven at protonmail.com>
Date: Wed, 24 Jun 2026 12:24:44 +0800
Subject: [PATCH] [NFC] Remove wrong comment in ProTypeMemberInitCheck
`getAsCXXRecordDecl` will return nullptr for any dependent types.
---
.../clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp | 2 --
1 file changed, 2 deletions(-)
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());
More information about the cfe-commits
mailing list