You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Clang] FunctionEffects: properly extract the type of a bound member member function from a CallExpr. (llvm#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 <[email protected]>
Co-authored-by: Sirraide <[email protected]>
0 commit comments