Skip to content

[Feature Request] Compiler warning for ambiguities between intrinsics and user functions #7972

@Przemog1

Description

@Przemog1

Is your feature request related to a problem? Please describe.
Related to this issue: #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions