Skip to content

Emit an error when attempting add a user-defined conversion function#8206

Merged
damyanp merged 9 commits intomicrosoft:mainfrom
damyanp:copilot/fix-issue-5103-tests
Apr 14, 2026
Merged

Emit an error when attempting add a user-defined conversion function#8206
damyanp merged 9 commits intomicrosoft:mainfrom
damyanp:copilot/fix-issue-5103-tests

Conversation

@damyanp
Copy link
Copy Markdown
Member

@damyanp damyanp commented Feb 26, 2026

Previously, user-defined conversion functions were silently ignored. This change reports an error if one is defined.

Fixes #5103

Copilot AI and others added 5 commits February 21, 2026 00:26
…soft#5103)

Add err_hlsl_unsupported_conversion_operator diagnostic and check in
CheckConversionDeclarator to reject conversion operators in HLSL.
Previously these were silently ignored, misleading users into thinking
their cast operator overloads were being used.

Co-authored-by: damyanp <8118402+damyanp@users.noreply.github.com>
…oad is not allowed'

Co-authored-by: damyanp <8118402+damyanp@users.noreply.github.com>
Co-authored-by: damyanp <8118402+damyanp@users.noreply.github.com>
Co-authored-by: damyanp <8118402+damyanp@users.noreply.github.com>
@damyanp damyanp marked this pull request as ready for review February 27, 2026 00:14
Comment thread tools/clang/test/SemaHLSL/conversion-operator-errors.hlsl
Copilot AI and others added 3 commits March 11, 2026 01:19
Co-authored-by: damyanp <8118402+damyanp@users.noreply.github.com>
…103-tests

# Conflicts:
#	docs/ReleaseNotes.md
@damyanp damyanp merged commit b13e386 into microsoft:main Apr 14, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Apr 14, 2026
@devshgraphicsprogramming
Copy link
Copy Markdown

We actually used .operator T() in our code, this change breaks things for us

CC: @AnastaZIuk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Should emit error on unsupported cast operator overloading that's silently ignored

6 participants