[clang-tools-extra] [clang-tidy] Add fix-its to `avoid-return-with-void-value` check (PR #81420)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 08:14:21 PST 2024


================
@@ -66,4 +74,6 @@ VOID f13() {
     return f12();
     // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: return statement within a void function should not have a specified return value [readability-avoid-return-with-void-value]
     // CHECK-MESSAGES-LENIENT: :[[@LINE-2]]:5: warning: return statement within a void function should not have a specified return value [readability-avoid-return-with-void-value]
+    // CHECK-FIXES: f12(); return;
+    // CHECK-FIXES-LENIENT: f12(); return;
 }
----------------
PiotrZSL wrote:

Add tests with:
- `return /*comment*/ f1() /*comment*/;`
- `return/*comment*/f1()/*comment*/;`

https://github.com/llvm/llvm-project/pull/81420


More information about the cfe-commits mailing list