Skip to content

Commit 40cee38

Browse files
committed
Add tests which include brace initialization
1 parent 5de09ef commit 40cee38

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang-tools-extra/test/clang-tidy/checkers/bugprone-unused-raii.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ void test() {
6464
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
6565
// CHECK-FIXES: FooBar give_me_a_name;
6666

67+
Foo{42};
68+
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
69+
// CHECK-FIXES: Foo give_me_a_name{42};
70+
FooBar{};
71+
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
72+
// CHECK-FIXES: FooBar give_me_a_name;
73+
6774
templ<FooBar>();
6875
templ<Bar>();
6976

0 commit comments

Comments
 (0)