diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/llvm/twine-local.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/llvm/twine-local.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/llvm/twine-local.cpp b/clang-tools-extra/test/clang-tidy/checkers/llvm/twine-local.cpp index 05c9971..be64029 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/llvm/twine-local.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/llvm/twine-local.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy --match-partial-fixes %s llvm-twine-local %t +// RUN: %check_clang_tidy %s llvm-twine-local %t namespace llvm { class Twine { @@ -24,7 +24,7 @@ int main() { const Twine t = Twine("a") + "b" + Twine(42); // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes -// CHECK-FIXES: std::string t = (Twine("a") + "b" + Twine(42)).str(); +// CHECK-FIXES: const std::string t = (Twine("a") + "b" + Twine(42)).str(); foo(Twine("a") + "b"); Twine Prefix = false ? "__INT_FAST" : "__UINT_FAST"; @@ -35,31 +35,31 @@ int main() { const Twine t2 = Twine(); // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes -// CHECK-FIXES: std::string t2 = (Twine()).str(); +// CHECK-FIXES: const std::string t2 = (Twine()).str(); foo(Twine() + "b"); const Twine t3 = Twine(42); // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes -// CHECK-FIXES: std::string t3 = (Twine(42)).str(); +// CHECK-FIXES: const std::string t3 = (Twine(42)).str(); const Twine t4 = Twine(42) + "b"; // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes -// CHECK-FIXES: std::string t4 = (Twine(42) + "b").str(); +// CHECK-FIXES: const std::string t4 = (Twine(42) + "b").str(); const Twine t5 = Twine() + "b"; // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes -// CHECK-FIXES: std::string t5 = (Twine() + "b").str(); +// CHECK-FIXES: const std::string t5 = (Twine() + "b").str(); const Twine t6 = true ? Twine() : Twine(42); // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes -// CHECK-FIXES: std::string t6 = (true ? Twine() : Twine(42)).str(); +// CHECK-FIXES: const std::string t6 = (true ? Twine() : Twine(42)).str(); const Twine t7 = false ? Twine() : Twine("b"); // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: twine variables are prone to use-after-free bugs // CHECK-MESSAGES: note: FIX-IT applied suggested code changes -// CHECK-FIXES: std::string t7 = (false ? Twine() : Twine("b")).str(); +// CHECK-FIXES: const std::string t7 = (false ? Twine() : Twine("b")).str(); } |