weggli
weggli copied to clipboard
Incorrect cross-function match identified
Hello - when I run this query:
weggli -X '{
const _ $a = _;
std::move($a);
}' /tmp/x.cc
On this code:
MACRO
namespace {
void func() {
const auto g = f2();
}
void func2() {
auto g = f2();
std::move(g);
}
}
I get this:
/tmp/x.cc:1
MACRO
namespace {
void func() {
const auto g = f2();
}
void func2() {
auto g = f2();
std::move(g);
}
}
It seems weggli is unaware of the function boundary here. Both the macro and namespace are necessary for the bug.
Adding a ; after MACRO fixes it, but that's not something I can change in my codebase.
Thanks!