Skip to content

<xstring>: Suppress code analysis warning C6510 for basic_string - #5563

Merged
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
muellerj2:string-suppress-warning-c6510
Aug 8, 2025
Merged

<xstring>: Suppress code analysis warning C6510 for basic_string#5563
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
muellerj2:string-suppress-warning-c6510

Conversation

@muellerj2

Copy link
Copy Markdown

When instantiating basic_string with character types of class type, code analysis warning C6510 is produced. See here: https://gcc.godbolt.org/z/8dhaG8bd4

I noticed this while working on #995, when I tried to instantiate basic_regex (and hence basic_string) with a character type of class type to extend test coverage.

#3032 already resolved this issue for basic_string_view. This PR applies the same fix (warning suppression) to basic_string and extends the existing test coverage to basic_string. (Strictly speaking, the extended test isn't run in C++14 mode, but I think this is still good enough to validate a warning suppression applied unconditionally. And there will soon be positive indirect coverage in C++14 mode via the PRs for #995.)

Comment thread tests/std/tests/P0220R1_string_view/test.cpp
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 907f3e7 into microsoft:main Aug 8, 2025
39 checks passed
@github-project-automation github-project-automation Bot moved this from Merging to Done in STL Code Reviews Aug 8, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for extending this suppression! 🤫 🔇 🤐

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

Labels

bug Something isn't working

3 participants