Boost logo

Boost :

Subject: Re: [boost] Clang 600 and BOOST_SYSTEM_CONSTEXPR causes error_code.hpp compile failure.
From: John Maddock (jz.maddock_at_[hidden])
Date: 2018-07-08 16:13:20


On 08/07/2018 15:42, Peter Dimov via Boost wrote:
>> John Maddock wrote:
>>
>> > 1>C:\Program Files (x86)\Microsoft Visual Studio >
>> 14.0\VC\include\system_error(168,18):  note: declared here
>> > 1>        /* constexpr */ error_category() _NOEXCEPT      //
>> TRANSITION
>>
>> This commented-out constexpr (in the 2015 headers) is the problem,
>> thanks. Now how do we work around it...
>
> The problem here is that Clang can pick up and use any MSVC headers it
> finds depending on who knows what search algorithm, and to work around
> the commented-out constexpr I need to detect that it uses the 2015 STL
> (because the 2017 STL would presumably have the constexpr, although I
> haven't checked all of its flavors.)

I preprocessed the source and it's picking up the latest headers for me:
m:\\compilers\\vc2017\\vc\\tools\\msvc\\14.13.26128\\include\\system_error

and I still see:

class error_category
 Â Â Â  {    // categorize an error
public:
 Â Â Â  /* constexpr */ error_category() _NOEXCEPT    // TRANSITION
 Â Â Â      {    // default constructor
 Â Â Â      _Addr = reinterpret_cast<uintptr_t>(this);
 Â Â Â      }

In that header.

Defines wise we have:

Clang version 6.0.0 (tags/RELEASE_600/final)
 Â Â Â  _CPPUNWIND                              =1
 Â Â Â  __cplusplus                             =201402L
 Â Â Â  _WIN32                                  =1
 Â Â Â  _WIN64                                  =1
 Â Â Â  _CPPRTTI                                =1
 Â Â Â  _CPPUNWIND                              =1
 Â Â Â  _DLL                                    =1
 Â Â Â  _M_AMD64                                =100
 Â Â Â  _M_X64                                  =100
 Â Â Â  _MSC_BUILD                              =1
 Â Â Â  _MSC_EXTENSIONS                         =1
 Â Â Â  _MSC_VER                                =1900
 Â Â Â  _MSC_FULL_VER                           =190000000
 Â Â Â  _MSVC_LANG                              =201402L
 Â Â Â  _MT                                     =1
 Â Â Â  _NATIVE_WCHAR_T_DEFINED                 =1
 Â Â Â  __VERSION__                             ="4.2.1 Compatible Clang
6.0.0 (tags/RELEASE_600/final)"

Dinkumware standard library version 650
 Â Â Â  _CPPLIB_VER                             =650
 Â Â Â  _GLOBAL_USING                           =1
 Â Â Â  _HAS_EXCEPTIONS                         =1
 Â Â Â  _HAS_CXX17                              =0
 Â Â Â  _HAS_AUTO_PTR_ETC                       =1
 Â Â Â  _HAS_OLD_IOSTREAMS_MEMBERS              =1
 Â Â Â  _HAS_FUNCTION_ASSIGN                    =1
 Â Â Â  _HAS_TR1_NAMESPACE                      =1
 Â Â Â  _HAS_IDENTITY_STRUCT                    =1
 Â Â Â  _ITERATOR_DEBUG_LEVEL                   =2
 Â Â Â  _HAS_ITERATOR_DEBUGGING                 =1
 Â Â Â  _ITERATOR_DEBUG_ARRAY_OVERLOADS         =1

Not sure if this helps, John.

---
This email has been checked for viruses by AVG.
https://www.avg.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk