From 971996b397711016d47fe961890d7001338c6f23 Mon Sep 17 00:00:00 2001 From: wij Date: Tue, 14 Jan 2025 13:07:16 -0500 Subject: [PATCH] Fix #5354, change diagnostic definition error message and expect output in test (#6067) Co-authored-by: Yong He --- source/slang/slang-diagnostic-defs.h | 2 +- tests/diagnostics/missing-return.slang.expected | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/slang/slang-diagnostic-defs.h b/source/slang/slang-diagnostic-defs.h index 821a895bc7..1d09189cce 100644 --- a/source/slang/slang-diagnostic-defs.h +++ b/source/slang/slang-diagnostic-defs.h @@ -2060,7 +2060,7 @@ DIAGNOSTIC( DIAGNOSTIC(41000, Warning, unreachableCode, "unreachable code detected") DIAGNOSTIC(41001, Error, recursiveType, "type '$0' contains cyclic reference to itself.") -DIAGNOSTIC(41010, Warning, missingReturn, "control flow may reach end of non-'void' function") +DIAGNOSTIC(41010, Warning, missingReturn, "non-void function does not return in all cases") DIAGNOSTIC( 41011, Error, diff --git a/tests/diagnostics/missing-return.slang.expected b/tests/diagnostics/missing-return.slang.expected index e41e756ff4..7626665241 100644 --- a/tests/diagnostics/missing-return.slang.expected +++ b/tests/diagnostics/missing-return.slang.expected @@ -1,9 +1,9 @@ result code = 0 standard error = { -tests/diagnostics/missing-return.slang(7): warning 41010: control flow may reach end of non-'void' function +tests/diagnostics/missing-return.slang(7): warning 41010: non-void function does not return in all cases int bad(int a, int b) ^~~ -tests/diagnostics/missing-return.slang(14): warning 41010: control flow may reach end of non-'void' function +tests/diagnostics/missing-return.slang(14): warning 41010: non-void function does not return in all cases int alsoBad(int a, int b) ^~~~~~~ }