microsoft / microsoft/DirectXShaderCompiler

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

Open
#6,594 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

diagnostic dxil enhancement spirv
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the intentionally broken program from the Godbolt link, comparing compiler output with and without the -spirv flag. Start from the diagnostic for counter.histogram(1) and determine how the SPIR-V path reports the temporary-object/inout-parameter error; done means the flagged invocation produces an equally clear diagnostic.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.