Description
Consider (https://godbolt.org/z/aa475YbW6):
struct X{};
template <typename T = void>
struct A {
auto Error(this auto&& This) -> T {
return T();
}
};
struct B : A<X> {
bool f();
};
bool B::f() {
return Error();
}
Obviously, X
isn’t convertible to bool
, so we print an error, but the error is missing a source location:
error: no viable conversion from returned value of type 'X' to function return type 'bool'
If I remove the explicit object parameter, we instead print
<source>:15:12: error: no viable conversion from returned value of type 'X' to function return type 'bool'
15 | return Error();
| ^~~~~~~
This appears to be a regression since the source location is present in Clang 19.