| Issue |
118799
|
| Summary |
[Clang][AST] How to dump qualified name with more information
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
lifengxiang1025
|
For example:
```
template<typename T>
class A{
public:
T t;
A(T t) : t(t) {}
};
template<typename T>
auto foo(T t) {
return [tt = t](){return tt;};
}
int bar(int a, int b, int c) {
auto lambda1 = [](int a, int b) {
return a + b;
};
auto lambda2 = [&]() {
return a + b + c;
};
A<decltype(foo(lambda1))> a1(foo(lambda1));
A<decltype(foo(lambda2))> a2(foo(lambda2));
return a1.t()(a, b) + a2.t()();
}
int main() {
return bar(1, 2, 3);
}
```
When I dump the qualified name by `QualifiedName(clang::TypeName::getFullyQualifiedName(ctx_->getRecordType(decl), *ctx_, ctx_->getPrintingPolicy(), true))`, there are two same qualified name:
```
::A<(lambda at test3.cpp:10:12)>
::A<(lambda at test3.cpp:10:12)>
```
correspond to:
```
A<decltype(foo(lambda1))> a1(foo(lambda1));
A<decltype(foo(lambda2))> a2(foo(lambda2));
```
How can I dump more information about lambda1 and lambda2? I initially want to use `QualifiedName` to represent one struct type until I met this situation.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs