::free should not match the name of ::freedom::Id* S::blah(); (!)
https://godbolt.org/z/vEcY74h8M
namespace freedom {
class Id;
struct S { Id* blah(); };
}
void foo(freedom::S* s) {
s->blah();
s->blah();
}
$ clang-tidy --checks='bugprone-use-after-move' --config="{CheckOptions: {bugprone-use-after-move.InvalidationFunctions: '::free'}}"
<source>:7:3: warning: 's' used after it was invalidated [bugprone-use-after-move]
7 | s->blah();
| ^
<source>:6:6: note: invalidation occurred here
6 | s->blah();
| ^
Despite its name, apparently matchesAnyListedName treats its arguments as regexes rather than names, causing this issue.