Skip to content

Commit

Permalink
Fix #5354, change diagnostic definition error message and expect outp…
Browse files Browse the repository at this point in the history
…ut in test (#6067)

Co-authored-by: Yong He <yonghe@outlook.com>
  • Loading branch information
wijiler and csyonghe authored Jan 14, 2025
1 parent d98e3f3 commit 971996b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/slang/slang-diagnostic-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tests/diagnostics/missing-return.slang.expected
Original file line number Diff line number Diff line change
@@ -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)
^~~~~~~
}
Expand Down

0 comments on commit 971996b

Please sign in to comment.