Skip to content

Commit 8b99092

Browse files
committed
Add template test
1 parent 91bf1b6 commit 8b99092

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

clang-tools-extra/test/clang-tidy/checkers/modernize/use-designated-initializers.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,14 @@ struct S4 {
4646

4747
S4 s41 {2.2};
4848
// CHECK-MESSAGES-SINGLE-ELEMENT: :[[@LINE-1]]:8: warning: use designated initializer list [modernize-use-designated-initializers]
49+
50+
S4 s42 = {{}};
51+
// CHECK-MESSAGES-SINGLE-ELEMENT: :[[@LINE-1]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
52+
53+
template<typename S> S template1() { return {10, 11}; }
54+
55+
S2 s26 = template1<S2>();
56+
57+
template<typename S> S template2() { return {}; }
58+
59+
S2 s27 = template2<S2>();

0 commit comments

Comments
 (0)