5chmidti wrote:

> but now templates seem to be skipped completely

Template instantiations are skipped, not their definition. The matchers no 
longer work, because the types you are working with are no longer necessarily 
concrete types, but instead they can be dependent. And so can be expressions. 

In addition to the matchers for non-dependent code, you need to add matchers 
for the dependent case. See godbolt link I had linked: 
https://godbolt.org/z/GrfMTxeGa
and the included matcher (example, not full matcher):

```
callExpr(                            // no longer a CXXMemberCallExpr
    callee(
        cxxDependentScopeMemberExpr( // the callee is now a dependent member
            hasMemberName("subspan"),
            hasObjectExpression(
                hasType(             // this part is effectively HasSpanType 
but for a dependent type of `std::span<T>`
                    elaboratedType(
                        namesType(
                            qualType(
                                hasCanonicalType(
                                    qualType(
                                        hasDeclaration(
                                            namedDecl(hasName("::std::span"))
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )
)
```

https://github.com/llvm/llvm-project/pull/118074
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to