Skip to content

Conversation

@hnrklssn
Copy link
Member

  • Explanation:
    C/C++ integer literal expressions with types that are not of type int are printed with a suffix to indicate the type (e.g. 123U or 456L for unsigned and long). This is not valid syntax for integer literals in Swift, so until we fully translate the count expr syntax to Swift we need to avoid importing these count expressions.
  • Scope:
    This patch skips attaching a macro in cases where it would previously cause a compilation error, which practically corresponds when an integer literal (or constant folded integer expression) has a type that isn't int - e.g. char, short, unsigned, long etc.
  • Issues:
    rdar://154141719
  • Original PRs:
    [Swiftify] Don't import counted_by with suffixed integer literals #82469
  • Risk:
    Low
  • Testing:
    Added regression tests
  • Reviewers:
    @Xazax-hun
    @j-hui

…iftlang#82469)

Integer literal expressions with types that are not of type `int` are
printed with a suffix to indicate the type (e.g. `123U` or `456L` for
`unsigned` and `long`). This is not valid syntax for integer literals in
Swift, so until we fully translate the count expr syntax to Swift we
need to avoid importing these count expressions.

Also fixes some -Werror related stuff in test cases.

rdar://154141719
(cherry picked from commit 374658a)
@hnrklssn hnrklssn requested a review from a team as a code owner June 28, 2025 02:05
@hnrklssn
Copy link
Member Author

@swift-ci please test

@hnrklssn
Copy link
Member Author

@swift-ci please test macos

1 similar comment
@hnrklssn
Copy link
Member Author

@swift-ci please test macos

@hnrklssn hnrklssn merged commit 8db1ad6 into swiftlang:release/6.2 Jun 30, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants