[clang] Fix a bug with the hasAncestor AST matcher when a node has several parents without pointer identity (PR #118511)

2024-12-03 Thread Loïc Joly via cfe-commits
https://github.com/loic-joly-sonarsource created https://github.com/llvm/llvm-project/pull/118511 Before the change, getMemoizationData is used as a key to stop visiting the parents, but if a node has no identity, this is nullptr, which means that the visit will stop as soon as a second node w

[clang] Fix a bug with the hasAncestor AST matcher when a node has several parents without pointer identity (PR #118511)

2024-12-03 Thread Loïc Joly via cfe-commits
https://github.com/loic-joly-sonarsource updated https://github.com/llvm/llvm-project/pull/118511 From 8c6882a360d0f810346dd89f20d8af0ddf0bdfb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Joly?= Date: Tue, 3 Dec 2024 17:20:18 +0100 Subject: [PATCH] Fix a bug with the hasAncestor AST ma

[clang] Fix a bug with the hasAncestor AST matcher when a node has several parents without pointer identity (PR #118511)

2024-12-03 Thread Loïc Joly via cfe-commits
@@ -1237,7 +1237,8 @@ class MatchASTVisitor : public RecursiveASTVisitor, // Make sure we do not visit the same node twice. // Otherwise, we'll visit the common ancestors as often as there // are splits on the way down. - if (Visited.inse

[clang] Fix a bug with the hasAncestor AST matcher when a node has several parents without pointer identity (PR #118511)

2024-12-09 Thread Loïc Joly via cfe-commits
loic-joly-sonarsource wrote: Hi there. I do not have commit access, but this PR had one approval. Could someone with commit access merge it? https://github.com/llvm/llvm-project/pull/118511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] Fix a bug with the hasAncestor AST matcher when a node has several parents without pointer identity (PR #118511)

2024-12-03 Thread Loïc Joly via cfe-commits
https://github.com/loic-joly-sonarsource updated https://github.com/llvm/llvm-project/pull/118511 From 8c6882a360d0f810346dd89f20d8af0ddf0bdfb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Joly?= Date: Tue, 3 Dec 2024 17:20:18 +0100 Subject: [PATCH 1/2] Fix a bug with the hasAncestor AS