Use operator""sv to ensure string_view are initialized correctly#321
Closed
janisozaur wants to merge 1 commit intomicrosoft:masterfrom
Closed
Use operator""sv to ensure string_view are initialized correctly#321janisozaur wants to merge 1 commit intomicrosoft:masterfrom
janisozaur wants to merge 1 commit intomicrosoft:masterfrom
Conversation
Addresses following warning raised by clang:
```
src/CalcManager/CEngine/scidisp.cpp:23:24: error: constexpr variable 'c_decPreSepStr' must be initialized by a constant expression
constexpr wstring_view c_decPreSepStr = L"[+-]?(\\d*)[";
^ ~~~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/char_traits.h:431:11: note: non-constexpr function 'wcslen' cannot be used in a constant expression
return wcslen(__s);
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/string_view:100:39: note: in call to 'length(&L"[+-]?(\\d*)["[0])'
: _M_len{__str == nullptr ? 0 : traits_type::length(__str)},
^
```
Contributor
Author
|
By using libc++ instead of libstdc++, I've isolated this to be an issue with the latter. I'll check what's the status in libstdc++ 9 and file a report if needed. |
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.
Addresses following warning raised by clang:
Description of the changes: