[PATCH] D21584: [libcxx] [test] Fix an operator precedence mistake in valarray.unary/not.pass.cpp.
Stephan T. Lavavej via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 21 17:56:37 PDT 2016
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
Fix an operator precedence mistake in valarray.unary/not.pass.cpp. This one was sneaky - the test happened to be passing, but totally by accident.
You can thank MSVC warning C4805 "'==': unsafe mix of type 'bool' and type 'T' in operation" for this one.
http://reviews.llvm.org/D21584
Files:
test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp
Index: test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp
===================================================================
--- test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp
+++ test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp
@@ -36,6 +36,6 @@
std::valarray<bool> v2 = !(v + v);
assert(v2.size() == v.size());
for (int i = 0; i < v2.size(); ++i)
- assert(v2[i] == !2*v[i]);
+ assert(v2[i] == !(2 * v[i]));
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21584.61477.patch
Type: text/x-patch
Size: 541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160622/b677a84f/attachment.bin>
More information about the cfe-commits
mailing list