[libcxx patch] Let module.modulemap require cxx_atomics for the atomics module

Richard Smith richard at metafoo.co.uk
Tue Sep 23 21:36:26 PDT 2014


Yep. We should figure out how best to add tests for libc++'s module map in
the near future, but this LGTM for now.
On 23 Sep 2014 16:12, "Nico Weber" <thakis at chromium.org> wrote:

> On Tue, Sep 23, 2014 at 3:49 PM, Richard Smith <richard at metafoo.co.uk>
> wrote:
>
>> On Fri, Sep 19, 2014 at 6:35 PM, Nico Weber <thakis at chromium.org> wrote:
>>
>>> Hi,
>>>
>>> when using modules in c++98, libc++ currently fails to build:
>>>
>>> While building module 'std' imported from src/disk_interface.h:18:
>>> In file included from <module-includes>:3:
>>> /Users/thakis/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/atomic:539:2:
>>> error: <atomic> is not implemented
>>> #error <atomic> is not implemented
>>>  ^
>>> In file included from src/disk_interface.cc:15:
>>> src/disk_interface.h:18:10: fatal error: could not build module 'std'
>>> #include <map>
>>>  ~~~~~~~~^
>>>
>>> The attached patch fixes this by making atomic depend on cxx_atomics.
>>> Fixes PR21002.
>>>
>>
>> Doesn't this just make the atomic submodule always unavailable? We don't
>> have a cxx_atomics feature, as far as I can see. And cxx_atomic (the
>> corresponding __has_feature flag) wouldn't work either: module features are
>> not the same as __has_feature features (see the relevant documentation
>> here: http://clang.llvm.org/docs/Modules.html#requires-declaration).
>> cplusplus11 is the best check we have for this.
>>
>
> Aw, bummer. Is the patch ok with s/cxx_atomics/cplusplus11/?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140923/21479d0f/attachment.html>


More information about the cfe-commits mailing list