================
@@ -0,0 +1,181 @@
+// RUN: %check_clang_tidy %s misc-scope-reduction %t -- --
+
+// Test case 1: Variable can be moved to smaller scope (if-block)
+void test_if_scope() {
+ int x = 42; // CHECK-MESSAGES: :[[@LINE]]:7: warning: variable 'x' can be
declared in a smaller scope
----------------
zeyi2 wrote:
Can we put the `// CHECK-MESSAGES` on a new line?
```suggestion
int x = 42;
// CHECK-MESSAGES: :[[@LINE]]:7: warning: variable 'x' can be declared in a
smaller scope
```
Same as below.
https://github.com/llvm/llvm-project/pull/175429
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits