[libcxx-commits] [libcxx] 2d8f23f - [libc++] Explicitly mark basic_string<...>::npos with default

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 16 08:18:48 PST 2020


Hi,

Yes, adding _LIBCPP_FUNC_VIS on line 788 in libcxx/include/string helps, 
for both msvc and mingw mode. I haven't tested linking code that 
references npos against that dll though but it builds at least.

// Martin

On Thu, 16 Jan 2020, Eric Fiselier wrote:

> I'll take a look at D69505 shortly.
> Can you confirm that adding _LIBCPP_FUNC_VIS to the initial
> in-class declaration for npos fixes the Windows build?
> 
> On Thu, Jan 16, 2020 at 10:42 AM Martin Storsjö
> <martin at martin.st> wrote:
>       Ok,
>
>       And thanks for confirming re buildbots; I was a
>       bit surprised to see the
>       amount of failing tests in libc++ on windows when
>       I finally got a setup to
>       run them (regarding
>       https://reviews.llvm.org/D69505, where I'd like
>       an ack
>       from you or someone else of the libcxx
>       maintainers before proceeding, in
>       addition to Reid's approval).
>
>       // Martin
>
>       On Thu, 16 Jan 2020, Eric Fiselier wrote:
>
>       > Sorry about the breakage Martin. I'll commit a
>       speculative
>       > fix shortly.
>       > There are currently no real Windows buildbots
>       for libc++. I
>       > was attempting to
>       > use Appveyor
>       >
>       (https://ci.appveyor.com/project/llvm-mirror/libcxx),
>       but
>       > that's
>       > been unmaintained and red for a long time now.
>       >
>       > On Thu, Jan 16, 2020 at 3:40 AM Martin Storsjö
>       > <martin at martin.st> wrote:
>       >       On Wed, 15 Jan 2020, Eric Fiselier via
>       >       libcxx-commits wrote:
>       >
>       >       >
>       >       > Author: Eric Fiselier
>       >       > Date: 2020-01-15T17:02:17-05:00
>       >       > New Revision:
>       >       2d8f23f571635c1fb983b40c4c2548716a5b65b6
>       >       >
>       >       >URL:https://github.com/llvm/llvm-project/commit/2d8f23f57163
>       5c1f
>       >       b983b40c4c2548716a5b65b6
>       >       >DIFF:https://github.com/llvm/llvm-project/commit/2d8f23f5716
>       35c1f
>       >       b983b40c4c2548716a5b65b6.diff
>       >       >
>       >       > LOG: [libc++] Explicitly mark
>       >       basic_string<...>::npos with default
>       >       > visibility.
>       >
>       >       This breaks shared builds for windows
>       (both with
>       >       clang-cl and in mingw
>       >       mode):
>       >
>       >       In file included from
>       ..\src\thread.cpp:12:
>       >       In file included from
>       ..\include\thread:92:
>       >       In file included from
>       >       ..\include\system_error:149:
>       >       ..\include\string(4241,59): error:
>       redeclaration
>       >       of 'std::__1::basic_string::npos' cannot
>       add
>       >       'dllexport' attribute
>       >                       basic_string<_CharT,
>       _Traits,
>       >       _Allocator>::npos;
>       >                                                
>              
>       >                ^
>       >       ..\include\string(788,28): note: previous
>       >       declaration is here
>       >            static const size_type npos = -1;
>       >                                   ^
>       >
>       >       (Relatedly, is there any buildbot set up
>       for
>       >       libcxx on windows?)
>       >
>       >       // Martin
>       >
>       >
>       >
> 
> 
>


More information about the libcxx-commits mailing list