-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of CD3DX12_CPU_DESCRIPTOR_HANDLE in an array can result in static analysis warning #6
Comments
Since these assignment operators take I don't know if there's a good way to indicate to analysis that the |
Paging @walbourn for an opinion on this. |
The If you choose to use an array of It also doesn't happen if you use Frankly this looks more like a bug in You should submit this repro as a bug to the VS team since I don't see any reason it should emit the warning. |
Does this warning still happen with the latest VS 2019? |
I see it still happens. This is definitely a compiler bug. Please report it to VS and then close this issue with the link. |
@EpicChrisWaters Did this get reported to the VS site yet? |
Please see this godbolt output https://godbolt.org/z/ozYG6e
If you create an uninitialized array of CD3DX12_CPU_DESCRIPTOR_HANDLE and then initializing the array in a loop with objects of type D3D12_CPU_DESCRIPTOR_HANDLE, it results in a static analysis error on the usage of the uninitialized array. This does not happen with a non-array.
It actually looks like changing just the custom assignment operator can fix this, if you "= default" the "=" operator, the warning goes away. For context, this warning looks like it was introduced when all the constructors were changed from "{}" (empty implementations) to "= default".
The text was updated successfully, but these errors were encountered: