DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

[Feature Request] Clearer error output when you pass a temporary object into an inout parameter

Open nipunG314 opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. I have created an intentionally broken program here. https://godbolt.org/z/1MxWvPP6E

This problem is easy to run into if you pass a temporary object into a inout parameter. I wish the compiler output was a bit clearer about what has gone wrong. If we remove the -spirv flag, it becomes clearer:

<source>:14:23: error: cannot compile this l-value expression yet
    counter.histogram(1);
                      ^
Compiler returned: 5

Describe the solution you'd like

It would be great if the output with the flag was also clear.

nipunG314 avatar May 07 '24 17:05 nipunG314

I'm marking this as both dxil and spriv because both messages are bad and not particularly useful. This should be failing overload resolution and providing a reasonable explanation as to why.

llvm-beanz avatar May 07 '24 17:05 llvm-beanz