From cdfea42f1b28c6ec7b13500a64be823f67bf8e0a Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Fri, 7 Jul 2023 03:52:00 +0800 Subject: Fix erroneous error claiming variable is being used before its declaration (#2958) * Simplify type of diagnoseImpl * Show source line for Note diagnostics, opting out of this where appropriate * Make declared after use diagnostic clearer * Fix erroneous error claiming variable is being used before its declaration Closes https://github.com/shader-slang/slang/issues/2936 * Fix build on msvc --------- Co-authored-by: jsmall-nvidia --- tests/preprocessor/include-multiple.slang.expected | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/preprocessor/include-multiple.slang.expected') diff --git a/tests/preprocessor/include-multiple.slang.expected b/tests/preprocessor/include-multiple.slang.expected index f254ecf2f..f9facb349 100644 --- a/tests/preprocessor/include-multiple.slang.expected +++ b/tests/preprocessor/include-multiple.slang.expected @@ -4,10 +4,14 @@ tests/preprocessor/include-a.slang.h(3): error 30201: function 'bar' already has int bar() { return foo(); } ^~~ tests/preprocessor/include-a.slang.h(3): note: see previous definition of 'bar' +int bar() { return foo(); } + ^~~ tests/preprocessor/include-a.slang.h(3): error 30201: function 'bar' already has a body int bar() { return foo(); } ^~~ tests/preprocessor/include-a.slang.h(3): note: see previous definition of 'bar' +int bar() { return foo(); } + ^~~ } standard output = { } -- cgit v1.2.3