| Issue |
55502
|
| Summary |
[USR] USR of template instantiation involving lambda( type)s unique together
|
| Labels |
clang:frontend,
libclang
|
| Assignees |
|
| Reporter |
whisperity
|
Given
```cpp
template <class Lambda>
auto call(Lambda &&L) {
return L();
}
void lambdaCallerTest() {
auto L1 = [] { return 1; };
auto L2 = [] { return 2; };
auto Take1 = call(L1);
call(L1);
auto Take2 = call(L2);
auto Take2b = call(L2);
call(L2);
}
```
```
|-FunctionTemplateDecl <line:1:1, line:4:1> line:2:6 call
| |-FunctionDecl <line:2:1, line:4:1> line:2:6 call 'auto (Lambda &&)'
| |-FunctionDecl <line:2:1, line:4:1> line:2:6 used call 'int ((lambda at line:6:13) &)'
| `-FunctionDecl <line:2:1, line:4:1> line:2:6 used call 'int ((lambda at line:7:13) &)'
```
generating the USR for the callees of the call expressions `call(L1)` and `call(L2)`, while two distinct `FunctionDecl*`s, generates the same USR:
```
c:main.cpp@F@call<#&$@F@lambdaCallerTest#@Sa>#S0_#
```
Unfortunately, I found no user-facing tool that can generate deep USRs (`clang-extdef-mapping` only warns for **explicit** symbols). The issue appeared during the development of [`D124448`](http://reviews.llvm.org/D124448).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs