[contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
Hello all,

Most of Boost.Contract regression test fail for toolset
clang-gnu-linux-5.0~c++1z~lc on platform
teeks99-02-dc5-1z-lc-Docker-64on64 because of the following error on
#include <ostream> done by Boost.Range (and sometimes by
Boost.IOStreams):

  "clang++-5.0" -c -x c++ -Wno-c99-extensions -std=c++1z
-stdlib=libc++ -isystem/usr/include/libcxxabi -O0 -g -fno-inline -Wall
-g -fPIC -m64  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTRACT_DISABLE_THREADS
-DBOOST_CONTRACT_DYN_LINK -DBOOST_SYSTEM_DYN_LINK=1 -I".."
-I"../libs/contract/test/function" -o
"/var/boost/run/results/boost/bin.v2/libs/contract/test/function-smoke.test/clang-gnu-linux-5.0~c++1z~lc/debug/threadapi-pthread/function/smoke.o"
"../libs/contract/test/function/smoke.cpp"

In file included from ../libs/contract/test/function/smoke.cpp:9:
In file included from
../libs/contract/test/function/../detail/oteststream.hpp:10:
In file included from ../boost/iostreams/tee.hpp:18:
In file included from ../boost/iostreams/detail/adapter/device_adapter.hpp:22:
In file included from ../boost/iostreams/detail/call_traits.hpp:15:
In file included from ../boost/iostreams/traits.hpp:38:
In file included from ../boost/range/iterator_range.hpp:14:
In file included from ../boost/range/iterator_range_io.hpp:32:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
/usr/include/c++/v1/string:1942:14: error: expected ';' at end of declaration
    _NOEXCEPT
             ^
/usr/include/c++/v1/string:1947:9: error: expected unqualified-id
        _NOEXCEPT
        ^
/usr/include/c++/v1/__config:368:21: note: expanded from macro '_NOEXCEPT'
#  define _NOEXCEPT noexcept
                    ^
2 errors generated.

Of course, Boost.Range and Boost.IOStreams show the same error on this
toolset/platform independently of Boost.Contract.

Any idea what the issue might be?

Thanks,
--Lorenzo

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
All,

On Sun, Nov 12, 2017 at 3:27 PM, Lorenzo Caminiti <[hidden email]> wrote:

>   "clang++-5.0" -c -x c++ -Wno-c99-extensions -std=c++1z
> -stdlib=libc++ -isystem/usr/include/libcxxabi -O0 -g -fno-inline -Wall
> -g -fPIC -m64  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTRACT_DISABLE_THREADS
> -DBOOST_CONTRACT_DYN_LINK -DBOOST_SYSTEM_DYN_LINK=1 -I".."
> -I"../libs/contract/test/function" -o
> "/var/boost/run/results/boost/bin.v2/libs/contract/test/function-smoke.test/clang-gnu-linux-5.0~c++1z~lc/debug/threadapi-pthread/function/smoke.o"
> "../libs/contract/test/function/smoke.cpp"
>
> In file included from ../libs/contract/test/function/smoke.cpp:9:
> In file included from
> ../libs/contract/test/function/../detail/oteststream.hpp:10:
> In file included from ../boost/iostreams/tee.hpp:18:
> In file included from ../boost/iostreams/detail/adapter/device_adapter.hpp:22:
> In file included from ../boost/iostreams/detail/call_traits.hpp:15:
> In file included from ../boost/iostreams/traits.hpp:38:
> In file included from ../boost/range/iterator_range.hpp:14:
> In file included from ../boost/range/iterator_range_io.hpp:32:
> In file included from /usr/include/c++/v1/ostream:138:
> In file included from /usr/include/c++/v1/ios:216:
> In file included from /usr/include/c++/v1/__locale:15:
> /usr/include/c++/v1/string:1942:14: error: expected ';' at end of declaration
>     _NOEXCEPT
>              ^
> /usr/include/c++/v1/string:1947:9: error: expected unqualified-id
>         _NOEXCEPT
>         ^
> /usr/include/c++/v1/__config:368:21: note: expanded from macro '_NOEXCEPT'
> #  define _NOEXCEPT noexcept
>                     ^
> 2 errors generated.

Any idea about this? I couldn't find any reference to it online...
Again, Boost.Range and Boost.IOStreams see the same errors for Clang
5.0 on Teeks.

Thanks,
--Lorenzo

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
On 11/15/17 20:19, Lorenzo Caminiti via Boost wrote:

> All,
>
> On Sun, Nov 12, 2017 at 3:27 PM, Lorenzo Caminiti <[hidden email]> wrote:
>>    "clang++-5.0" -c -x c++ -Wno-c99-extensions -std=c++1z
>> -stdlib=libc++ -isystem/usr/include/libcxxabi -O0 -g -fno-inline -Wall
>> -g -fPIC -m64  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTRACT_DISABLE_THREADS
>> -DBOOST_CONTRACT_DYN_LINK -DBOOST_SYSTEM_DYN_LINK=1 -I".."
>> -I"../libs/contract/test/function" -o
>> "/var/boost/run/results/boost/bin.v2/libs/contract/test/function-smoke.test/clang-gnu-linux-5.0~c++1z~lc/debug/threadapi-pthread/function/smoke.o"
>> "../libs/contract/test/function/smoke.cpp"
>>
>> In file included from ../libs/contract/test/function/smoke.cpp:9:
>> In file included from
>> ../libs/contract/test/function/../detail/oteststream.hpp:10:
>> In file included from ../boost/iostreams/tee.hpp:18:
>> In file included from ../boost/iostreams/detail/adapter/device_adapter.hpp:22:
>> In file included from ../boost/iostreams/detail/call_traits.hpp:15:
>> In file included from ../boost/iostreams/traits.hpp:38:
>> In file included from ../boost/range/iterator_range.hpp:14:
>> In file included from ../boost/range/iterator_range_io.hpp:32:
>> In file included from /usr/include/c++/v1/ostream:138:
>> In file included from /usr/include/c++/v1/ios:216:
>> In file included from /usr/include/c++/v1/__locale:15:
>> /usr/include/c++/v1/string:1942:14: error: expected ';' at end of declaration
>>      _NOEXCEPT
>>               ^
>> /usr/include/c++/v1/string:1947:9: error: expected unqualified-id
>>          _NOEXCEPT
>>          ^
>> /usr/include/c++/v1/__config:368:21: note: expanded from macro '_NOEXCEPT'
>> #  define _NOEXCEPT noexcept
>>                      ^
>> 2 errors generated.
>
> Any idea about this? I couldn't find any reference to it online...
> Again, Boost.Range and Boost.IOStreams see the same errors for Clang
> 5.0 on Teeks.

Looks like a libc++ bug, like a missing semicolon.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On Sun, Nov 12, 2017 at 4:27 PM, Lorenzo Caminiti via Boost <
[hidden email]> wrote:

> Hello all,
>
> Most of Boost.Contract regression test fail for toolset
> clang-gnu-linux-5.0~c++1z~lc on platform
> teeks99-02-dc5-1z-lc-Docker-64on64 because of the following error on
> #include <ostream> done by Boost.Range (and sometimes by
> Boost.IOStreams):
>
>   "clang++-5.0" -c -x c++ -Wno-c99-extensions -std=c++1z
> -stdlib=libc++ -isystem/usr/include/libcxxabi -O0 -g -fno-inline -Wall
> -g -fPIC -m64  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTRACT_DISABLE_THREADS
> -DBOOST_CONTRACT_DYN_LINK -DBOOST_SYSTEM_DYN_LINK=1 -I".."
> -I"../libs/contract/test/function" -o
> "/var/boost/run/results/boost/bin.v2/libs/contract/test/
> function-smoke.test/clang-gnu-linux-5.0~c++1z~lc/debug/
> threadapi-pthread/function/smoke.o"
> "../libs/contract/test/function/smoke.cpp"
>
> In file included from ../libs/contract/test/function/smoke.cpp:9:
> In file included from
> ../libs/contract/test/function/../detail/oteststream.hpp:10:
> In file included from ../boost/iostreams/tee.hpp:18:
> In file included from ../boost/iostreams/detail/
> adapter/device_adapter.hpp:22:
> In file included from ../boost/iostreams/detail/call_traits.hpp:15:
> In file included from ../boost/iostreams/traits.hpp:38:
> In file included from ../boost/range/iterator_range.hpp:14:
> In file included from ../boost/range/iterator_range_io.hpp:32:
> In file included from /usr/include/c++/v1/ostream:138:
> In file included from /usr/include/c++/v1/ios:216:
> In file included from /usr/include/c++/v1/__locale:15:
> /usr/include/c++/v1/string:1942:14: error: expected ';' at end of
> declaration
>     _NOEXCEPT
>              ^
> /usr/include/c++/v1/string:1947:9: error: expected unqualified-id
>         _NOEXCEPT
>         ^
> /usr/include/c++/v1/__config:368:21: note: expanded from macro '_NOEXCEPT'
> #  define _NOEXCEPT noexcept
>                     ^
> 2 errors generated.
>
>
I think I need more context for this.
Looking at the 5.0 libc++ sources, I see this:

1490: template <class _CharT, class _Traits, class _Allocator>
1491: inline _LIBCPP_INLINE_VISIBILITY
1492: basic_string<_CharT, _Traits, _Allocator>::basic_string()
1493:
 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
1494: {
1495: #if _LIBCPP_DEBUG_LEVEL >= 2
1496:     __get_db()->__insert_c(this);
1497: #endif
1498:     __zero();
1499: }
1500:
1501: template <class _CharT, class _Traits, class _Allocator>
1502: inline _LIBCPP_INLINE_VISIBILITY
1503: basic_string<_CharT, _Traits, _Allocator>::basic_string(const
allocator_type& __a)
1504: #if _LIBCPP_STD_VER <= 14
1505:
 _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
1506: #else
1507:         _NOEXCEPT
1508: #endif


Which doesn't match what you're reporting.

-- Marshall

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
Lorenzo Caminiti wrote:

> > In file included from /usr/include/c++/v1/ostream:138:
> > In file included from /usr/include/c++/v1/ios:216:
> > In file included from /usr/include/c++/v1/__locale:15:
> > /usr/include/c++/v1/string:1942:14: error: expected ';' at end of
> > declaration
> >     _NOEXCEPT
> >              ^
> > /usr/include/c++/v1/string:1947:9: error: expected unqualified-id
> >         _NOEXCEPT
> >         ^
> > /usr/include/c++/v1/__config:368:21: note: expanded from macro
> > '_NOEXCEPT'
> > #  define _NOEXCEPT noexcept
>                     ^
> > 2 errors generated.
>
> Any idea about this? I couldn't find any reference to it online...

Something is wrong with that libc++ install as clang is 5.0, but <__config>
line 368 only has this content at release_37:

https://github.com/llvm-mirror/libcxx/blob/release_37/include/__config#L368

and I can't a version of <string> that corresponds to the above lines 1942
and 1947.


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
Hello all,

On Wed, Nov 15, 2017 at 12:20 PM, Andrey Semashev via Boost
<[hidden email]> wrote:
>> On Sun, Nov 12, 2017 at 3:27 PM, Lorenzo Caminiti <[hidden email]>
>>
>> Any idea about this? I couldn't find any reference to it online...
>> Again, Boost.Range and Boost.IOStreams see the same errors for Clang
>> 5.0 on Teeks.
>
> Looks like a libc++ bug, like a missing semicolon.

Looks like this was already marked as a Clang/Libc++ bug by Boost.RegEx:

https://svn.boost.org/trac10/ticket/7872

I'll go with that conclusion.

Thanks.
--Lorenzo

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
On Wed, Nov 15, 2017 at 8:37 PM, Lorenzo Caminiti via Boost <
[hidden email]> wrote:

> Hello all,
>
> On Wed, Nov 15, 2017 at 12:20 PM, Andrey Semashev via Boost
> <[hidden email]> wrote:
> >> On Sun, Nov 12, 2017 at 3:27 PM, Lorenzo Caminiti <
> [hidden email]>
> >>
> >> Any idea about this? I couldn't find any reference to it online...
> >> Again, Boost.Range and Boost.IOStreams see the same errors for Clang
> >> 5.0 on Teeks.
> >
> > Looks like a libc++ bug, like a missing semicolon.
>
> Looks like this was already marked as a Clang/Libc++ bug by Boost.RegEx:
>
> https://svn.boost.org/trac10/ticket/7872
>
> I'll go with that conclusion.
>
>
This was marked (by me!) as a clang bug - that was fixed in clang trunk in
January 2013.
I find it hard to believe that you're running a clang built from those
sources.

-- Marshall

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
On Thu, Nov 16, 2017 at 10:03 AM, Marshall Clow <[hidden email]>
wrote:

> On Wed, Nov 15, 2017 at 8:37 PM, Lorenzo Caminiti via Boost <
> [hidden email]> wrote:
>
>> Hello all,
>>
>> On Wed, Nov 15, 2017 at 12:20 PM, Andrey Semashev via Boost
>> <[hidden email]> wrote:
>> >> On Sun, Nov 12, 2017 at 3:27 PM, Lorenzo Caminiti <
>> [hidden email]>
>> >>
>> >> Any idea about this? I couldn't find any reference to it online...
>> >> Again, Boost.Range and Boost.IOStreams see the same errors for Clang
>> >> 5.0 on Teeks.
>> >
>> > Looks like a libc++ bug, like a missing semicolon.
>>
>> Looks like this was already marked as a Clang/Libc++ bug by Boost.RegEx:
>>
>> https://svn.boost.org/trac10/ticket/7872
>>
>> I'll go with that conclusion.
>>
>>
> This was marked (by me!) as a clang bug - that was fixed in clang trunk in
> January 2013.
> I find it hard to believe that you're running a clang built from those
> sources.
>
>
Or rather, from a set of sources from before then.

-- Marshall

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On Thu, Nov 16, 2017 at 12:03 PM, Marshall Clow via Boost <
[hidden email]> wrote:

> On Wed, Nov 15, 2017 at 8:37 PM, Lorenzo Caminiti via Boost <
> [hidden email]> wrote:
>
> > Hello all,
> >
> > On Wed, Nov 15, 2017 at 12:20 PM, Andrey Semashev via Boost
> > <[hidden email]> wrote:
> > >> On Sun, Nov 12, 2017 at 3:27 PM, Lorenzo Caminiti <
> > [hidden email]>
> > >>
> > >> Any idea about this? I couldn't find any reference to it online...
> > >> Again, Boost.Range and Boost.IOStreams see the same errors for Clang
> > >> 5.0 on Teeks.
> > >
> > > Looks like a libc++ bug, like a missing semicolon.
> >
> > Looks like this was already marked as a Clang/Libc++ bug by Boost.RegEx:
> >
> > https://svn.boost.org/trac10/ticket/7872
> >
> > I'll go with that conclusion.
> >
> >
> This was marked (by me!) as a clang bug - that was fixed in clang trunk in
> January 2013.
> I find it hard to believe that you're running a clang built from those
> sources.
>
> -- Marshall
>

So I looked into this a bit more this weekend. The
teeks99-[d|m]c5-1z-lc-Docker-64on64 build was using ubuntu's standard
version of libc++, 3.7.0. In theory, that should work with any compiler
version, including clang 5.0....but looking at the large number of
compilation errors against that specific runner (the identical clang build
that uses libstdc++, the default, instead has none of these issues),
something is obviously not working correctly.

So on friday I updated that docker image[1] to use a ubuntu ppa with a
supposedly updated version (V5.0.0, from 2017-09-11) of libc++[2]. However
in the subsequent run with that version, I'm still seeing the same issue.

I'm guessing it might be some issue with my config? Is there some minimal
source file that produces the same error I can try running to investigate
further?

If anyone wants to look for themselves, you can pull my docker image:
docker pull teeks99/boost-cpp-docker:clang-5

There's a boost build user-config.jam file[3] in the root of that image,
the toolset that build is using is "clang-5.0~c++1z~lc".

Tom

[1]
https://github.com/teeks99/boost-cpp-docker/blob/master/clang-5/Dockerfile
[2]
https://launchpad.net/~anthony-justsoftwaresolutions/+archive/ubuntu/libcxx/+packages
[3]
https://github.com/teeks99/boost-cpp-docker/blob/master/clang-5/user-config.jam

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
On Sun, Nov 19, 2017 at 6:22 AM, Tom Kent via Boost
<[hidden email]> wrote:
> Is there some minimal
> source file that produces the same error I can try running to investigate
> further?

I can't be sure but from what I saw in the error message it seems the
error is raised as soon as <ostream> is included so I'd expect the
following to reproduce the error already:

#include <ostream>

int main() {
    return 0;
}

--Lorenzo

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [contract] _NOEXCEPT errors in <ostream> for Clang 5.0 C++1z on Teeks Linux

Boost - Dev mailing list
Hello Tom,

On Tue, Nov 21, 2017 at 7:16 PM, Tom Kent <[hidden email]> wrote:

> On Mon, Nov 20, 2017 at 9:06 PM, Tom Kent <[hidden email]> wrote:
>>
>> I was able to get to the bottom of this, I hope the libc++ builds start
>> cycling normally now.
>>
>> > This was marked (by me!) as a clang bug - that was fixed in clang trunk
>> > in January 2013.
>> > I find it hard to believe that you're running a clang built from those
>> > sources.
>> >
>> > -- Marshall
>>
>> It turns out I had put in a script patch the broken ubuntu header:
>>
>> https://github.com/teeks99/boost-cpp-docker/blob/11e6d31ca8d28dee8bbb5536f287cc27710a4ff5/clang-5/fix_string.py
>>
>> This was a very brittle patch, and when ubuntu fixed it upstream (just two
>> months ago!) it caused some kind of conflict. I've removed the patch from my
>> teeks99/boost-cpp-docker images, so the clang-3.9, -4, -5, and -6 images
>> should be able to use libc++ correctly now.
>>
>> Thanks for all who helped me straighten this out!
>>
>
> There was a further issue with the need for a `-lc++abi` linker option, it
> has been added and the results look better now.

Yes, Boost.Contract regression tests now pass on this
compiler/platform. The issue was fixed.

Thanks a lot.
--Lorenzo

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost