From 6e7c726658c775e97578e7a9dd99d23b819870bd Mon Sep 17 00:00:00 2001 From: venkataram-nv Date: Thu, 18 Jul 2024 17:43:19 -0700 Subject: Warnings for uninitialized fields in constructors (#4680) * Detect uninitialized fields in constructors * Reachability check for early returns * Specialized warnings for synthesized default initializers * Handling quirks with constructors * Addressing review comments * Ignore synthesized constructors if they are not used --- tests/compute/struct-default-init.slang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/compute/struct-default-init.slang') diff --git a/tests/compute/struct-default-init.slang b/tests/compute/struct-default-init.slang index 50933ae84..dc0e0218a 100644 --- a/tests/compute/struct-default-init.slang +++ b/tests/compute/struct-default-init.slang @@ -3,9 +3,9 @@ struct Test { - int a; + int a = 0; int b = 1; - int c; + int c = 0; int d = 1 + 1; } @@ -37,4 +37,4 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) int outVal = test(inVal); outputBuffer[tid] = outVal; -} \ No newline at end of file +} -- cgit v1.2.3