Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress invalid-unevaluated-string for AppleClang 16 #4744

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

wkgcass
Copy link
Contributor

@wkgcass wkgcass commented Jan 16, 2025

Description

On x64 macOS 15.1.1 and Xcode 16.2, I have Apple Clang 16.0.0 insalled:

# clang --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: x86_64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

When compiling msquic, I can see errors produced by -Winvalid-unevaluated-string, just like the following one:

msquic/src/core/quicdef.h:243:66: error: encoding prefix 'L' on an unevaluated string literal has no effect [-Werror,-Winvalid-unevaluated-string]
  243 | CXPLAT_STATIC_ASSERT(IS_POWER_OF_TWO(QUIC_MAX_RANGE_ALLOC_SIZE), L"Must be power of two");
      |                                                                  ^

The xcode 16 release note says that:

The following C++26 features have been implemented:
...
Unevaluated strings (P2361R6)

It seems that from this version the invalid-unevaluated-string warning began to appear.

Testing

I can compile without any error with this patch.

No further tests required I think.

Documentation

None.

Accroding to xcode 16 release notes:
https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes
XCode 16 supports `Unevaluated strings`

We need to suppress this warning when compiling with AppleClang >= 16
@wkgcass wkgcass requested a review from a team as a code owner January 16, 2025 08:46
@nibanks nibanks enabled auto-merge (squash) January 16, 2025 11:43
@nibanks nibanks merged commit 5482269 into microsoft:main Jan 16, 2025
476 of 486 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants