diff options
| author | Ben Craig <ben.craig@ni.com> | 2017-07-12 01:45:13 +0000 |
|---|---|---|
| committer | Ben Craig <ben.craig@ni.com> | 2017-07-12 01:45:13 +0000 |
| commit | 7e17e52b879fc54a407aadeec17575a7d9f5546b (patch) | |
| tree | e883a22350bfa0a5c04a043e8cd9be0a37878178 /libcxx/include/string | |
| parent | 106179a2577fff66ecc163fbe0684475b5370acb (diff) | |
| download | bcm5719-llvm-7e17e52b879fc54a407aadeec17575a7d9f5546b.tar.gz bcm5719-llvm-7e17e52b879fc54a407aadeec17575a7d9f5546b.zip | |
Fix unrepresentable enum for clang-cl unstable ABI
When using LIBCXX_ABI_UNSTABLE=YES, clang-cl gave the following warning:
P:\llvm_master\src\llvm\projects\libcxx\include\string(683,51):
warning: enumerator value is not representable in the underlying type
'int' [-Wmicrosoft-enum-value]
Fixed by switching from enums to static const size_type.
https://reviews.llvm.org/D35174
llvm-svn: 307751
Diffstat (limited to 'libcxx/include/string')
| -rw-r--r-- | libcxx/include/string | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libcxx/include/string b/libcxx/include/string index d1a3a1f8e6c..010a4c7816e 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -676,11 +676,11 @@ private: }; #if _LIBCPP_BIG_ENDIAN - enum {__short_mask = 0x01}; - enum {__long_mask = 0x1ul}; + static const size_type __short_mask = 0x01; + static const size_type __long_mask = 0x1ul; #else // _LIBCPP_BIG_ENDIAN - enum {__short_mask = 0x80}; - enum {__long_mask = ~(size_type(~0) >> 1)}; + static const size_type __short_mask = 0x80; + static const size_type __long_mask = ~(size_type(~0) >> 1); #endif // _LIBCPP_BIG_ENDIAN enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ? @@ -706,11 +706,11 @@ private: }; #if _LIBCPP_BIG_ENDIAN - enum {__short_mask = 0x80}; - enum {__long_mask = ~(size_type(~0) >> 1)}; + static const size_type __short_mask = 0x80; + static const size_type __long_mask = ~(size_type(~0) >> 1); #else // _LIBCPP_BIG_ENDIAN - enum {__short_mask = 0x01}; - enum {__long_mask = 0x1ul}; + static const size_type __short_mask = 0x01; + static const size_type __long_mask = 0x1ul; #endif // _LIBCPP_BIG_ENDIAN enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ? |

