[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 11 09:51:38 PDT 2024


https://github.com/5chmidti commented:

> Side note, for future knowledge, what do you mean by
> 
> > it is technically not in the format of the RecursiveASTVisitor and may be confusing
> 
> ? Is there a guide that can point out what format Visit... should have?

My bad, it actually was named correct. But, the format is: `Traverse<Name>`, `WalkUpFrom<Name>` and `Visit<Name>`, where `<Name>` is replaced with AST nodes.
https://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html

However, https://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html says that
> These three method groups are tiered (Traverse* > WalkUpFrom* > Visit*). A method (e.g. Traverse*) may call methods from the same tier (e.g. other Traverse*) or one tier lower (e.g. WalkUpFrom*).

So, calling `Visit` from `Traverse` may result in some issues.

> Any updated feedback on this?

I reviewed the code again, but which of the two approaches to take is still in question. (ping for reviewers)

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


More information about the cfe-commits mailing list