<xstring>: Suppress code analysis warning C6510 for basic_string#5563
Merged
StephanTLavavej merged 3 commits intomicrosoft:mainfrom Aug 8, 2025
Merged
Conversation
StephanTLavavej
approved these changes
Aug 7, 2025
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for extending this suppression! 🤫 🔇 🤐 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When instantiating
basic_stringwith character types of class type, code analysis warning C6510 is produced. See here: https://gcc.godbolt.org/z/8dhaG8bd4I noticed this while working on #995, when I tried to instantiate
basic_regex(and hencebasic_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) tobasic_stringand extends the existing test coverage tobasic_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.)