Skip to content

fix(span): avoid clang-cl C++17 constexpr warning#7

Merged
jpnurmi merged 1 commit into
getsentryfrom
jpnurmi/fix/cxx17
Jul 27, 2026
Merged

fix(span): avoid clang-cl C++17 constexpr warning#7
jpnurmi merged 1 commit into
getsentryfrom
jpnurmi/fix/cxx17

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Fix C++17 build with ClangCL and [-Werror,-Wdeprecated-redundant-constexpr-static-def] for:

2026-07-24T17:36:37.9268717Z   In file included from D:\a\sentry-native\sentry-native\src\backends\sentry_backend_crashpad.cpp:60:
2026-07-24T17:36:37.9270072Z   In file included from D:\a\sentry-native\sentry-native\external\crashpad\client/crashpad_client.h:26:
2026-07-24T17:36:37.9453990Z D:\a\sentry-native\sentry-native\external\crashpad\third_party\mini_chromium\mini_chromium\base/containers/span.h(363,52): error : out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Werror,-Wdeprecated-redundant-constexpr-static-def] [C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\cmake1\sentry.vcxproj]
2026-07-24T17:36:38.3245295Z FAILED

sentry-native builds Crashpad with clang-cl and treats warnings as errors.
Crashpad PR #157 added WriteAttachment() and AppendAttachment() APIs that use
base::span<const uint8_t>, making client/crashpad_client.h include span.h
directly. sentry_backend_crashpad.cpp includes crashpad_client.h, so this
mini_chromium header now gets compiled in sentry-native's clang-cl warning
policy.

clang-cl diagnoses the out-of-class definition of the static constexpr
span::extent member as redundant in C++17. Guard the definition to pre-C++17
language modes. The in-class declaration is sufficient in C++17 and later,
while older language modes still need the separate definition.
@jpnurmi
jpnurmi merged commit bcc80d6 into getsentry Jul 27, 2026
11 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/cxx17 branch July 27, 2026 09:19
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.

2 participants