Cleanups: Test options#3527
Merged
StephanTLavavej merged 3 commits intomicrosoft:mainfrom Mar 7, 2023
Merged
Conversation
This is implied by /permissive- (and therefore /std:c++20), so we have extensive coverage.
C:\Temp>type meow.cpp
#include <iostream>
int main() {
char* ptr = "Goodbye, deprecated world!\n";
std::cout << ptr;
}
C:\Temp>cl /EHsc /nologo /W4 meow.cpp && meow
meow.cpp
Goodbye, deprecated world!
C:\Temp>cl /EHsc /nologo /W4 /Zc:strictStrings meow.cpp && meow
meow.cpp
meow.cpp(4): error C2440: 'initializing': cannot convert from 'const char [28]' to 'char *'
meow.cpp(4): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
C:\Temp>cl /EHsc /nologo /W4 /permissive- meow.cpp && meow
meow.cpp
meow.cpp(4): error C2440: 'initializing': cannot convert from 'const char [28]' to 'char *'
meow.cpp(4): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
C:\Temp>cl /EHsc /nologo /W4 /std:c++20 meow.cpp && meow
meow.cpp
meow.cpp(4): error C2440: 'initializing': cannot convert from 'const char [28]' to 'char *'
meow.cpp(4): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
strega-nil-ms
approved these changes
Mar 6, 2023
Member
Author
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
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.
_ITERATOR_DEBUG_LEVEL", fixed in VS 2022 17.5./fno-sanitize-address-vcasan-libbeing the workaround. Now that ASan has stopped using the STL internally, we can drop this workaround option.-Xclangbefore-Wno-deprecated-declarationsand-Wno-self-assign.clang-clreally insisted on taking only MSVC-compatible options, and needed-Xclangbefore any Clang-specific options.) This is clearly no longer necessary, and we can directly pass the Clang warning suppression options, as we're already doing for-Wno-unqualified-std-cast-call./Zc:strictStringsin the universal options anymore./permissive-(and therefore/std:c++20), so we have extensive coverage.