I suspect, Mac OS (more precisely, its linker) is the crucial part, not
libc++. clang+libc++ on Linux is relatively well tested (or at least
used to be, when Travis was more usable), but Mac OS is less tested
because of slow turnaround.
>> BOOST_SYMBOL_IMPORT doesn't need to expand to BOOST_SYMBOL_VISIBLE
>> when the marked symbols are only defined in the library, which is the
>> case normally. When the user consumes the library, no markup is needed
>> as the compiler will simply leave unresolved references to those
>> symbols, to be resolved by the linker.
>> Basically, BOOST_SYMBOL_IMPORT is only there for compatibility with
>> Windows.
> Agreed with the first part.
> But quite many are defined in headers, especially the exceptions, so
> there it is required.
For classes defined in a header, neither EXPORT nor IMPORT are needed.
Only VISIBLE is, if you need publicly visible RTTI.
> I suspect, Mac OS (more precisely, its linker) is the crucial part, not
> libc++. clang+libc++ on Linux is relatively well tested (or at least
used to be, when Travis was more usable), but Mac OS is less tested because
of slow turnaround.
Nope. libc++ on Linux also fails. Apparently, libstdc++ masks the error
because it uses strcmp (even for g++ 4.4 which is the earliest I test on
Travis.)
Am I correct that BOOST_PROGRAM_OPTIONS_DECL is defined to
BOOST_SYMBOL_IMPORT, which expands to nothing, and it breaks when
Boost.ProgramOptions library throws an exception marked with it?
I'm asking because I have a similar setup in Boost.Filesystem, and it is
tested with clang+libc++ on Linux, and the tests passed last time I checked.
One potential problem that I noticed is that if an exception is marked
with BOOST_*_DECL and static linking is enabled, BOOST_*_DECL is empty
and the exception RTTI is left hidden. This can be a problem if the user
links with Boost statically (e.g. wraps it into a library of his own)
and then the exception crosses the library boundary.