diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2018-04-12 23:56:07 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2018-04-12 23:56:07 +0000 |
commit | 0f66190aefa0c53648d549738a2bb312a309c2d9 (patch) | |
tree | ba28a5d5102d812710c0dccc6844a90a6b284dd1 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 0c8ee891a75dfdc1c3420e36389d6ea7c680d1fb (diff) | |
download | bcm5719-llvm-0f66190aefa0c53648d549738a2bb312a309c2d9.tar.gz bcm5719-llvm-0f66190aefa0c53648d549738a2bb312a309c2d9.zip |
[libcxx] [test] Avoid MSVC truncation warnings.
MSVC emits "warning C4244: 'initializing': conversion from 'int'
to 'short', possible loss of data" when it sees pair<Whatever, short>
constructed from (whatever, 4), because int is being truncated to
short within pair's constructor. (The compiler doesn't take into
account the fact that 4 is a literal at the callsite; it generates
this warning when the constructor is instantiated, because it might
be called with a runtime-valued int that would actually truncate.)
Instead of static_cast<short>, we can simply change short to int
in these tests, without affecting the pair operations that they're
trying to test: move assignment, convert copy construction, and
convert move construction.
Fixes D45016.
llvm-svn: 329973
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions