[clang-tools-extra] 40cee38 - Add tests which include brace initialization
Stephen Kelly via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 28 16:41:38 PST 2021
Author: Stephen Kelly
Date: 2021-03-01T00:34:58Z
New Revision: 40cee381c1779256e039d66ea5d01ad7d344efb7
URL: https://github.com/llvm/llvm-project/commit/40cee381c1779256e039d66ea5d01ad7d344efb7
DIFF: https://github.com/llvm/llvm-project/commit/40cee381c1779256e039d66ea5d01ad7d344efb7.diff
LOG: Add tests which include brace initialization
Added:
Modified:
clang-tools-extra/test/clang-tidy/checkers/bugprone-unused-raii.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone-unused-raii.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone-unused-raii.cpp
index d637806ba20a..3428d453c63d 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone-unused-raii.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone-unused-raii.cpp
@@ -64,6 +64,13 @@ void test() {
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
// CHECK-FIXES: FooBar give_me_a_name;
+ Foo{42};
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
+ // CHECK-FIXES: Foo give_me_a_name{42};
+ FooBar{};
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately after creation; did you mean to name the object?
+ // CHECK-FIXES: FooBar give_me_a_name;
+
templ<FooBar>();
templ<Bar>();
More information about the cfe-commits
mailing list