microsoft / microsoft/DirectXShaderCompiler
Passing string literal to templated function causes validation errors when optimizations are disabled
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
Passing string literal to templated function causes validation errors when optimizations are disabled (using -Od) but works fine with optimizations enabled.
Steps to Reproduce
Minimal reproducible example: godbolt
I am not sure what is expected behavior, should the dxc reject or accept the code but it should behave the same despite different optimization flags.
Environment
- DXC version 1.7.2207, 1.7.2308
- Windows 21H2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal reproducible example linked on Godbolt and compare validation with optimizations enabled and with -Od using the reported DXC versions. Trace the compiler path responsible for validation and establish whether the templated string-literal case should be accepted or rejected; done means both optimization modes behave consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100