[libcxx-commits] [libcxx] fdc41e1 - [libc++] Implement LWG1203

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 22 23:24:40 PDT 2020


On Tue, 22 Sep 2020, Louis Dionne via libcxx-commits wrote:

>
> Author: Louis Dionne
> Date: 2020-09-22T17:15:31-04:00
> New Revision: fdc41e11f9687a50c97e2a59663bf2d541ff5489
>
> URL: https://github.com/llvm/llvm-project/commit/fdc41e11f9687a50c97e2a59663bf2d541ff5489
> DIFF: https://github.com/llvm/llvm-project/commit/fdc41e11f9687a50c97e2a59663bf2d541ff5489.diff
>
> LOG: [libc++] Implement LWG1203
>
> Libc++ had an issue where nonsensical code like
>
>  decltype(std::stringstream{} << std::vector<int>{});
>
> would compile, as long as you kept the expression inside decltype in
> an unevaluated operand. This turned out to be that we didn't implement
> LWG1203, which clarifies what we should do in that case.

This broke use of headers in C++11 mode, it seems. Just including e.g. 
<ostream> on its own breaks, e.g. like this:

$ clang++ -target i686-w64-mingw32 -include ostream -std=c++11 -c -x c++ - < /dev/null
In file included from <built-in>:1:
/home/martin/clang-nightly/i686-w64-mingw32/include/c++/v1/ostream:1038:45: 
error: no template named 'enable_if_t'; did you mean 'enable_if'?
template <class _Stream, class _Tp, class = enable_if_t<
                                             ^
/home/martin/clang-nightly/i686-w64-mingw32/include/c++/v1/type_traits:538:63: 
note: 'enable_if' declared here
template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if 
{};
                                                               ^
1 error generated.


The same also occurs in the <istream> header.

// Martin



More information about the libcxx-commits mailing list