[clang] [APINotes] Do not crash for C++ operators (PR #101001)
Egor Zhdan via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 29 08:45:32 PDT 2024
================
@@ -1044,11 +1044,13 @@ void Sema::ProcessAPINotes(Decl *D) {
if (auto TagContext = dyn_cast<TagDecl>(D->getDeclContext())) {
if (auto CXXMethod = dyn_cast<CXXMethodDecl>(D)) {
- for (auto Reader : APINotes.findAPINotes(D->getLocation())) {
- if (auto Context = UnwindTagContext(TagContext, APINotes)) {
- auto Info =
- Reader->lookupCXXMethod(Context->id, CXXMethod->getName());
- ProcessVersionedAPINotes(*this, CXXMethod, Info);
+ if (CXXMethod->getIdentifier()) {
----------------
egorzhdan wrote:
`clang::CXXMethodDecl`s are always NamedDecls, right? But not all of them actually have a name that is convertible to a string.
https://github.com/llvm/llvm-project/pull/101001
More information about the cfe-commits
mailing list