Add some tests to make sure we're formatting structures with preferred names correctly. Differential Revision: https://reviews.llvm.org/D145832
27 lines
634 B
C++
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;
|
|
}
|