[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 04:52:23 PDT 2024


AaronBallman wrote:

> Allow users to match all record instantiations by using <> as a wildcard.

I think this will change the behavior of existing matchers, consider:
```
template <typename Ty = int>
struct S {
  Ty Val;
  void Call();
};

int main() {
  S<> s;
  s.Call(); // Currently matches only this

  S<float> another;
  another.Call(); // Will now start to match this as well?
}
```
https://godbolt.org/z/Gr439c9v4

WDYT?

https://github.com/llvm/llvm-project/pull/100349


More information about the cfe-commits mailing list