================
@@ -222,3 +222,33 @@ void call_templates() {
template_loop(10L);
template_loop(10U);
}
+
+void dont_delete_lines_before_return_statement() {
+ do {} while (0);
+#ifdef FOO
+#endif
+ return;
+}
+// CHECK-MESSAGES: :[[@LINE-2]]:3: warning: redundant return statement
+// CHECK-FIXES: void dont_delete_lines_before_return_statement() {
+// CHECK-FIXES-NEXT: do {} while (0);
+// CHECK-FIXES-NEXT: #ifdef FOO
+// CHECK-FIXES-NEXT: #endif
+// CHECK-FIXES-NEXT: }
+
+void dont_delete_lines_before_continue_statement() {
+ for (;;) {
+ do {} while (0);
+#ifdef BAR
+#endif
+ continue;
----------------
EugeneZelenko wrote:
Will be good idea to add tests where semicolon is separated with spaces and
located on other line.
https://github.com/llvm/llvm-project/pull/171287
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits