Closed
Description
Bugzilla Link | 46510 |
Version | unspecified |
OS | Linux |
CC | @EugeneZelenko,@fberger,@irishrover |
Extended Description
Running
clang-tidy -checks='performance-unnecessary-value-param' bug.cc
on the following code results in a segfault:
struct Foo {
Foo(const Foo&) {}
};
template
bool recur(unsigned x, T&& val) {
if (x == 0) {
return false;
}
return recur(x / 2, val);
}
void bar(Foo entry) {
recur(0, entry);
}
Both clang 10.0.0 and current trunk (clang 11) segfault (see https://godbolt.org/z/gzVMqr).