Re: [PATCH] D46964: Implement class deduction guides for `std::array`
Hi Marshall, ARM and AArch64 libcxx buildbots are broken since that commits, logs are available at: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv7-linux/builds/107/steps/test.libcxx/logs/FAIL%3A%20libc%2B%2B%3A%3Adeduct.pass.cpp Thanks Yvan On 18 May 2018 at 23:05, Marshall Clow via Phabricator via cfe-commits wrote: > mclow.lists closed this revision. > mclow.lists added a comment. > > Committed as revision 332768 > > > https://reviews.llvm.org/D46964 > > > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46964: Implement class deduction guides for `std::array`
mclow.lists closed this revision. mclow.lists added a comment. Committed as revision 332768 https://reviews.llvm.org/D46964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46964: Implement class deduction guides for `std::array`
mclow.lists added inline comments. Comment at: include/array:75 + template +array(T, U...) -> array; EricWF wrote: > Don't we normally comment `// C++17` or similar for new features in the > synopsis? we do. Comment at: include/array:361 +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template && ...), void>::type EricWF wrote: > The `is same` clause is a requirement, not a SFINAE constraint. Should this > be a hard error? Should we really SFINAE it? If we SFINAE it, then we'll get a hard error; because there are no other deduction guides. Comment at: test/std/containers/sequences/array/array.cons/deduct.fail.cpp:12 +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + EricWF wrote: > This should be `UNSUPPORTED`. We don't expect this test to ever pass without > deduction guides. OK https://reviews.llvm.org/D46964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46964: Implement class deduction guides for `std::array`
EricWF accepted this revision. EricWF added inline comments. This revision is now accepted and ready to land. Comment at: include/array:75 + template +array(T, U...) -> array; Don't we normally comment `// C++17` or similar for new features in the synopsis? Comment at: include/array:361 +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template && ...), void>::type The `is same` clause is a requirement, not a SFINAE constraint. Should this be a hard error? Should we really SFINAE it? Comment at: test/std/containers/sequences/array/array.cons/deduct.fail.cpp:12 +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + This should be `UNSUPPORTED`. We don't expect this test to ever pass without deduction guides. Comment at: test/std/containers/sequences/array/array.cons/deduct.pass.cpp:12 +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + `UNSUPPORTED` https://reviews.llvm.org/D46964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46964: Implement class deduction guides for `std::array`
mclow.lists created this revision. mclow.lists added a reviewer: EricWF. According to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html Once this is reviewed, I'll do the rest of the sequence containers. https://reviews.llvm.org/D46964 Files: include/array test/std/containers/sequences/array/array.cons/deduct.fail.cpp test/std/containers/sequences/array/array.cons/deduct.pass.cpp Index: test/std/containers/sequences/array/array.cons/deduct.pass.cpp === --- test/std/containers/sequences/array/array.cons/deduct.pass.cpp +++ test/std/containers/sequences/array/array.cons/deduct.pass.cpp @@ -0,0 +1,45 @@ +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + + +// template +// array(T, U...) -> array; +// +// Requires: (is_same_v && ...) is true. Otherwise the program is ill-formed. + + +#include +#include +#include + +#include "test_macros.h" + +int main() +{ +{ +std::array arr{1,2,3}; +static_assert(std::is_same_v>, ""); +assert(arr[0] == 1); +assert(arr[1] == 2); +assert(arr[2] == 3); +} + +{ +std::array arr{1L, 4L, 9L, 16L}; +static_assert(std::is_same_v, ""); +static_assert(arr.size() == 4, ""); +assert(arr[0] == 1); +assert(arr[1] == 4); +assert(arr[2] == 9); +} +} Index: test/std/containers/sequences/array/array.cons/deduct.fail.cpp === --- test/std/containers/sequences/array/array.cons/deduct.fail.cpp +++ test/std/containers/sequences/array/array.cons/deduct.fail.cpp @@ -0,0 +1,32 @@ +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + + +// template +// array(T, U...) -> array; +// +// Requires: (is_same_v && ...) is true. Otherwise the program is ill-formed. + + +#include +#include +#include + +#include "test_macros.h" + +int main() +{ +{ +std::array arr{1,2,3L}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'array'}} +} +} Index: include/array === --- include/array +++ include/array @@ -72,6 +72,9 @@ const T* data() const noexcept; }; + template +array(T, U...) -> array; + template bool operator==(const array& x, const array& y); template @@ -354,6 +357,14 @@ }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template && ...), void>::type + > +array(_Tp, _Args...) + -> array<_Tp, 1 + sizeof...(_Args)>; +#endif + template inline _LIBCPP_INLINE_VISIBILITY bool ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits