Skip to content

Commit 6576467

Browse files
committed
Normalize -Wreturn-mismatch diagnostic name for iwyu on macOS
macOS iwyu uses -Wreturn-mismatch instead of -Wreturn-type. Add replacement for this variant in addition to the clang-diagnostic- variant.
1 parent cde8ac9 commit 6576467

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_hooks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,10 @@ def run_shell_cmd(cmd_name, files, args, _, target_output, target_retcode):
553553
actual = actual.rstrip(b"\n") + b"\n"
554554
if target_output and target_output.strip():
555555
target_output = target_output.rstrip(b"\n") + b"\n"
556-
# Windows clang uses return-mismatch instead of return-type
556+
# Windows/macOS clang uses return-mismatch instead of return-type
557557
if cmd_name in ["clang-tidy", "include-what-you-use"]:
558558
actual = actual.replace(b"clang-diagnostic-return-mismatch", b"clang-diagnostic-return-type")
559+
actual = actual.replace(b"-Wreturn-mismatch", b"-Wreturn-type")
559560
# Filter iwyu suggestions for implementation detail headers on macOS
560561
if cmd_name == "include-what-you-use" and sys.platform == "darwin":
561562
# Check if output only suggests adding implementation detail headers (starting with __)

0 commit comments

Comments
 (0)