[system] Clang CI builds broken because of constexpr

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

[system] Clang CI builds broken because of constexpr

Boost - Dev mailing list
Hi,

I'm seeing these errors in Travis CI builds with Clang 3.8, 3.9, 4.0 and
5.0:

./boost/system/error_code.hpp:232:41: error: constexpr constructor never
produces a constant expression [-Winvalid-constexpr]
         BOOST_SYSTEM_CONSTEXPR explicit std_category(
boost::system::error_category const * pc ): pc_( pc )
                                         ^
./boost/system/error_code.hpp:232:41: note: non-constexpr constructor
'error_category' cannot be used in a constant expression
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/system_error:69:5:
note: declared here
     error_category() noexcept;
     ^

I'm assuming this is because the compiler uses libstdc++ from gcc 4.8,
in which error_category() is not marked constexpr. Can this be fixed
somehow?

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

Re: [system] Clang CI builds broken because of constexpr

Boost - Dev mailing list
Andrey Semashev wrote:

> Hi,
>
> I'm seeing these errors in Travis CI builds with Clang 3.8, 3.9, 4.0 and
> 5.0:
>
> ./boost/system/error_code.hpp:232:41: error: constexpr constructor never
> produces a constant expression [-Winvalid-constexpr]
>          BOOST_SYSTEM_CONSTEXPR explicit std_category(
> boost::system::error_category const * pc ): pc_( pc )
>                                          ^
> ./boost/system/error_code.hpp:232:41: note: non-constexpr constructor
> 'error_category' cannot be used in a constant expression
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/system_error:69:5:
> note: declared here
>      error_category() noexcept;
>      ^
>
> I'm assuming this is because the compiler uses libstdc++ from gcc 4.8, in
> which error_category() is not marked constexpr. Can this be fixed somehow?

This should be fixed now in develop; will merge to master if Marshall gives
me permission.

(As a side note, Clang 3.8/3.9 don't quite work with libstdc++ 4.8 because
of the missing ::gets in C++14 mode, but boost/config.hpp contains a
workaround for that, as long as you include it before f.ex. <string>.)


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

Re: [system] Clang CI builds broken because of constexpr

Boost - Dev mailing list
On 07/20/18 14:16, Peter Dimov via Boost wrote:

> Andrey Semashev wrote:
>> Hi,
>>
>> I'm seeing these errors in Travis CI builds with Clang 3.8, 3.9, 4.0
>> and 5.0:
>>
>> ./boost/system/error_code.hpp:232:41: error: constexpr constructor
>> never produces a constant expression [-Winvalid-constexpr]
>>          BOOST_SYSTEM_CONSTEXPR explicit std_category(
>> boost::system::error_category const * pc ): pc_( pc )
>>                                          ^
>> ./boost/system/error_code.hpp:232:41: note: non-constexpr constructor
>> 'error_category' cannot be used in a constant expression
>> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/system_error:69:5:
>> note: declared here
>>      error_category() noexcept;
>>      ^
>>
>> I'm assuming this is because the compiler uses libstdc++ from gcc 4.8,
>> in which error_category() is not marked constexpr. Can this be fixed
>> somehow?
>
> This should be fixed now in develop; will merge to master if Marshall
> gives me permission.

Thanks, Peter. Will re-run my CI builds.

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