Skip to content

[202x] Fix invalid conforming literals warning - #9002

Open
Chris B (llvm-beanz) wants to merge 2 commits into
microsoft:mainfrom
llvm-beanz:7864
Open

Chris B (llvm-beanz) wants to merge 2 commits into
microsoft:mainfrom
llvm-beanz:7864

Conversation

@llvm-beanz

@llvm-beanz Chris B (llvm-beanz) commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

The warning for legacy literals changing signedness was firing even on explicitly suffixed unsigned literals. This change fixes the invalid warning by not issuing it if the literal is explicitly unsigned.

Fixes #7864

The warning for legacy literals changing signedness was firing even on
explicitly suffixed unsigned literals. This change fixes the invalid
warning by not issuing it if the literal is explicitly unsigned.

Fixes microsoft#7864
../tools/clang/test/SemaHLSL/v202x/conforming-literals/valid-literals.hl
sl
Copilot AI balanced review requested due to automatic review settings October 5, 2026 18:23

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

It leaves the issue’s explicit-cast cases unresolved and needs legacy-path coverage and a release note.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Suppresses invalid legacy-literal signedness warnings for explicitly unsigned literals.

Changes:

  • Checks Literal.isUnsigned before emitting warnings.
  • Adds regression coverage for unsigned suffixes and casts.
File Description
tools/​clang/​lib/​Sema/​SemaExpr.cpp Suppresses warnings for unsigned-suffixed literals.
tools/​clang/​test/​SemaHLSL/​v202x/​conforming-literals/​valid-literals.hlsl Adds diagnostic regression cases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/clang/lib/Sema/SemaExpr.cpp
../tools/clang/test/SemaHLSL/v202x/conforming-literals/valid-literals.hl
sl
Copilot AI balanced review requested due to automatic review settings October 5, 2026 19:46

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The focused implementation is correct, tested across relevant language modes, and documented.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (2)

@hekota Helena Kotas (hekota) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

This branch has not been deployed

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

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Whlsl-legacy-literal triggers for literals with explicit signedness

3 participants