diff options
| author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-06 01:14:43 +0000 |
|---|---|---|
| committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-06 01:14:43 +0000 |
| commit | f41847c401789d8f4a6fce0827579c7e3cfc47d6 (patch) | |
| tree | b2d14321309b409cb09e5806ec813ca195cb4689 /libcxx/test/std/utilities/optional | |
| parent | baa547b99670a3652b8a1b0b47e853d58ee18093 (diff) | |
| download | bcm5719-llvm-f41847c401789d8f4a6fce0827579c7e3cfc47d6.tar.gz bcm5719-llvm-f41847c401789d8f4a6fce0827579c7e3cfc47d6.zip | |
[libcxx] [test] D27268: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 2/4.
Use static_cast<int> when storing size_t in int (or passing size_t to int).
Also, remove a spurious semicolon in test/support/archetypes.hpp.
test/support/count_new.hpp
Additionally, change data members (and parameters) to size_t.
llvm-svn: 288752
Diffstat (limited to 'libcxx/test/std/utilities/optional')
| -rw-r--r-- | libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp b/libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp index f17f5820d20..e6ed0129ddc 100644 --- a/libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp @@ -23,9 +23,9 @@ struct TestT { int x; int size; - constexpr TestT(std::initializer_list<int> il) : x(*il.begin()), size(il.size()) {} + constexpr TestT(std::initializer_list<int> il) : x(*il.begin()), size(static_cast<int>(il.size())) {} constexpr TestT(std::initializer_list<int> il, const int*) - : x(*il.begin()), size(il.size()) {} + : x(*il.begin()), size(static_cast<int>(il.size())) {} }; int main() |

