[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".
STL_MSFT abandoned this revision. STL_MSFT added a comment. Verified compiler fix. Abandoning this patch - nothing has been committed. https://reviews.llvm.org/D27555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".
STL_MSFT added a comment. Actually, the compiler bug was resolved as fixed earlier today. Verifying... https://reviews.llvm.org/D27555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".
STL_MSFT added a comment. Hmm, would a pragma guarded by _MSC_VER be better? I can easily do that. I've tried to avoid cluttering the test with VC-specific pragmas, but I understand your concern about initializing too much memory. https://reviews.llvm.org/D27555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".
EricWF accepted this revision. EricWF added a comment. This revision is now accepted and ready to land. I'm happy to work around this one issue but in general I dislike initializing memory to avoid compile-time warnings. Doing so prevents the sanitizers from catching actual uninitialized memory bugs. For this reason I think the warning is an actual compiler bug because it hinders sanitizer usage and possibly hides bugs. https://reviews.llvm.org/D27555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".
STL_MSFT added a comment. It was debatable to me whether this was actually a compiler bug, but I suppose that it can see size()'s definition and should be able to notice that the elements aren't accessed. I've filed VSO#300037 "Bogus warning C6001 "Using uninitialized memory" for array::size()". I'd still like to have this workaround upstreamed; I've made a note to myself to revert it when the compiler bug is fixed. (We're locking down for VS 2017 RTM, so that may not happen quickly, but fortunately only this one simple test is affected.) https://reviews.llvm.org/D27555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".
EricWF added a comment. Are you planning on fixing this in your compiler? https://reviews.llvm.org/D27555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".
STL_MSFT created this revision. STL_MSFT added reviewers: EricWF, mclow.lists. STL_MSFT added a subscriber: cfe-commits. [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory". /analyze sees array::size() being called on arrays with garbage-inited doubles, and complains. It doesn't know that size() doesn't actually care about the contents of the array. There's a simple way to sidestep this issue - just use std::string, which has a default constructor. https://reviews.llvm.org/D27555 Files: test/std/containers/sequences/array/array.cons/default.pass.cpp Index: test/std/containers/sequences/array/array.cons/default.pass.cpp === --- test/std/containers/sequences/array/array.cons/default.pass.cpp +++ test/std/containers/sequences/array/array.cons/default.pass.cpp @@ -12,18 +12,19 @@ // array(); #include +#include #include int main() { { -typedef double T; +typedef std::string T; typedef std::array C; C c; assert(c.size() == 3); } { -typedef double T; +typedef std::string T; typedef std::array C; C c; assert(c.size() == 0); Index: test/std/containers/sequences/array/array.cons/default.pass.cpp === --- test/std/containers/sequences/array/array.cons/default.pass.cpp +++ test/std/containers/sequences/array/array.cons/default.pass.cpp @@ -12,18 +12,19 @@ // array(); #include +#include #include int main() { { -typedef double T; +typedef std::string T; typedef std::array C; C c; assert(c.size() == 3); } { -typedef double T; +typedef std::string T; typedef std::array C; C c; assert(c.size() == 0); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits