New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault in clangd after a638648 #56620
Comments
I'll take a look at it, thanks for the report! |
Looks like we're matching the wrong expression here, probably due to the fact that passing |
AST looks quite weird in this case to be honest:
call to here's a self contained reproducer: struct Foo {};
void foo(Foo s, int x);
template <typename... _Args>
void bar(_Args ...__args) {
foo(__args...);
}
void foo() {
bar(Foo{}, 3);
} |
Yes, my assumption in the code was that a pack expansion expression is always expanded completely, i.e. after I found the start of the expanded pack, I know what (and how many) the subsequent arguments are. Adding such a check (checking the last entry of the pack as well as the first entry?) seems like a good approach to prevent this. |
Should be fixed by https://reviews.llvm.org/D130259 |
This could crash when our heuristic picks the wrong function. Make sure there is enough parameters in the candidate to prevent those crashes. Also special case copy/move constructors to make the heuristic work in presence of those. Fixes llvm/llvm-project#56620 Differential Revision: https://reviews.llvm.org/D130260
This could crash when our heuristic picks the wrong function. Make sure there is enough parameters in the candidate to prevent those crashes. Also special case copy/move constructors to make the heuristic work in presence of those. Fixes llvm/llvm-project#56620 Differential Revision: https://reviews.llvm.org/D130260
@upsj since a638648 I get a segmentation fault on some code, I reduced it to:
Is anyone able to confirm?
The text was updated successfully, but these errors were encountered: