Skip to content

sema: fix int enum implicit cast to float. - #6977

Merged
Nathan Gauër (Keenuts) merged 2 commits into
microsoft:mainfrom
Keenuts:fix-6884
Dec 3, 2024
Merged

Nathan Gauër (Keenuts) merged 2 commits into
microsoft:mainfrom
Keenuts:fix-6884

Conversation

@Keenuts

Copy link
Copy Markdown
Collaborator

An implicit cast from int enum to a float should be a Floating_Integral cast, not an Integral_Conversion.

Fixes #6884

@Keenuts

Copy link
Copy Markdown
Collaborator Author

Chris B (@llvm-beanz) : is something holding this review?

@Keenuts

Copy link
Copy Markdown
Collaborator Author

Damyan Pepper (@damyanp) since I'm changing common sema I'd prefer to have MS take a look

@llvm-beanz Chris B (llvm-beanz) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also impacts DXIL, can you add a DXIL test too?

An implicit cast from int enum to a float should be a Floating_Integral
cast, not an Integral_Conversion.

Fixes microsoft#6884

Signed-off-by: Nathan Gauër <[email protected]>
Signed-off-by: Nathan Gauër <[email protected]>
@Keenuts

Copy link
Copy Markdown
Collaborator Author

Chris B (@llvm-beanz) PTAL

1 similar comment
@Keenuts

Copy link
Copy Markdown
Collaborator Author

Chris B (@llvm-beanz) PTAL

@Keenuts
Nathan Gauër (Keenuts) enabled auto-merge (squash) November 20, 2024 16:21
@Keenuts

Copy link
Copy Markdown
Collaborator Author

Chris B (@llvm-beanz) friendly ping

2 similar comments
@Keenuts

Copy link
Copy Markdown
Collaborator Author

Chris B (@llvm-beanz) friendly ping

@Keenuts

Copy link
Copy Markdown
Collaborator Author

Chris B (@llvm-beanz) friendly ping

@tex3d Tex Riddell (tex3d) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@Keenuts
Nathan Gauër (Keenuts) merged commit eb1223e into microsoft:main Dec 3, 2024
@Keenuts
Nathan Gauër (Keenuts) deleted the fix-6884 branch December 3, 2024 10:36
Mxr (SjMxr233) pushed a commit to ShaderHelper/DirectXShaderCompiler that referenced this pull request Jul 24, 2025
An implicit cast from int enum to a float should be a Floating_Integral
cast, not an Integral_Conversion.

Fixes microsoft#6884

---------

Signed-off-by: Nathan Gauër <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project
Status: Triaged

Development

Successfully merging this pull request may close these issues.

[SPIR-V] Typed Enum Implicit Conversions Fail

4 participants