microsoft / microsoft/DirectXShaderCompiler
[Feature Request] Compiler warning for ambiguities between intrinsics and user functions
Nobody has claimed this yet.
- 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.
Related to this issue: https://github.com/microsoft/DirectXShaderCompiler/issues/7971. It would be helpful if the compiler could emit warnings when an HLSL intrinsic potentially shadows a user-defined function or template. Currently, there is no way to detect these ambiguities automatically, which can lead to subtle bugs and reduce code clarity.
Describe the solution you'd like
The compiler should provide a warning when a user-defined symbol could be shadowed by an HLSL intrinsic, similar to how Clang warns about ambiguities between user-defined functions and standard library functions.
For comparison, in C++ a similar situation would produce a compilation error, as shown here: https://godbolt.org/z/536TPe9jr
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
No source file, test, or entry point is named. Start by reviewing related issue #7971 and the linked C++ comparison to define the ambiguity cases and expected warning behavior. Done means the compiler detects the specified intrinsic/user-symbol ambiguities and reports warnings with coverage for the agreed cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100