Closed
Description
A recent PR to prevent leaving out
parameters uninitialized in function calls (#5047) seems to have escaped its cage and is now also disallowing uninitialized arguments into functions with out
paramameters. See for example this (IMO totally valid) Interlocked*
invocation:
uint original;
buffer.InterlockedAdd(offset, value, original);
return original;
bindless.hlsl:110:46: error: variable 'original' is uninitialized when used here [-Werror,-Wuninitialized]
buffer.InterlockedAdd(offset, value, original);
^~~~~~~~
bindless.hlsl:109:22: note: initialize the variable 'original' to silence this warning
uint original;
^
= 0
(Compiler from 667fb77)
I thought the whole point of out
parameters and by extension this diagnostic is to know and force that the function will initialize original
here, and it should thus not need to be pre-initialized by the caller.
Originally posted by @MarijnS95 in #5047 (comment), cc @llvm-beanz
Metadata
Metadata
Assignees
Labels
No labels