aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-diff/lib/DifferenceEngine.cpp
diff options
context:
space:
mode:
authorDoug Wyatt <doug@sonosphere.com>2025-11-03 12:26:49 -0800
committerGitHub <noreply@github.com>2025-11-03 12:26:49 -0800
commitccc473254fd2d0da01921e8402fbd4f678ff46f1 (patch)
treed94230b8ea0dd78968e0486930e041810a1cddfd /llvm/tools/llvm-diff/lib/DifferenceEngine.cpp
parentf02b661054547b423177c9498cdb554f5036a3e0 (diff)
downloadllvm-ccc473254fd2d0da01921e8402fbd4f678ff46f1.zip
llvm-ccc473254fd2d0da01921e8402fbd4f678ff46f1.tar.gz
llvm-ccc473254fd2d0da01921e8402fbd4f678ff46f1.tar.bz2
[Clang] FunctionEffects: properly extract the type of a bound member member function from a CallExpr. (#166101)
There's a bug illustrated by this example: ``` template <typename T> struct Holder { T value; T& operator*() { return value; } }; struct X { using Dispatch = float (X::*)() [[clang::nonblocking]]; void fails(Holder<Dispatch>& holder) [[clang::nonblocking]] { (this->*(*holder))(); <<< the expression is incorrectly determined not to be nonblocking } void succeeds(Holder<Dispatch>& holder) [[clang::nonblocking]] { auto func = *holder; (this->*func)(); } }; ``` In both cases we have a `CXXMemberCallExpr`. In `succeeds`, the expression refers to a `Decl` (`func`) and gets a useful PTMF type. In `fails`, the expression does not refer to a `Decl` and its type is special, printed as `bound member function`. `Expr` provides a method for extracting the true type so we can use that in this situation. --------- Co-authored-by: Doug Wyatt <dwyatt@apple.com> Co-authored-by: Sirraide <aeternalmail@gmail.com>
Diffstat (limited to 'llvm/tools/llvm-diff/lib/DifferenceEngine.cpp')
0 files changed, 0 insertions, 0 deletions