Files
clang-p2996/lldb/test/API/lang/cpp/preferred_name/main.cpp
Michael Buch 9ca707b69b [lldb][test] Add tests for clang::PreferredNameAttr formatting
Add some tests to make sure we're formatting structures
with preferred names correctly.

Differential Revision: https://reviews.llvm.org/D145832
2023-04-07 01:37:36 +01:00

27 lines
634 B
C++

template <typename T> struct Foo;
typedef Foo<int> BarInt;
typedef Foo<double> BarDouble;
template <typename T> using Bar = Foo<T>;
template <typename T>
struct [[clang::preferred_name(BarInt), clang::preferred_name(BarDouble),
clang::preferred_name(Bar<short>), clang::preferred_name(Bar<short>),
clang::preferred_name(Bar<double>),
clang::preferred_name(Bar<char>)]] Foo{};
int main() {
BarInt barInt;
BarDouble barDouble;
Bar<short> barShort;
Bar<char> barChar;
Foo<int> varInt;
Foo<double> varDouble;
Foo<short> varShort;
Foo<char> varChar;
Foo<Foo<int>> varFooInt;
return 0;
}