[cfe-dev] How do I try out C++ modules with clang?

Sean Silva chisophugis at gmail.com
Mon Oct 27 20:11:59 PDT 2014


On Mon, Oct 27, 2014 at 3:43 PM, Nico Weber <thakis at chromium.org> wrote:

> Any idea what's going wrong?
>>
>> $ clang++ -E -fmodules test.cpp
>> # 1 "test.cpp"
>> # 1 "<built-in>" 1
>> # 1 "<built-in>" 3
>> # 325 "<built-in>" 3
>> # 1 "<command line>" 1
>> # 1 "<built-in>" 2
>> # 1 "test.cpp" 2
>> While building module 'std' imported from test.cpp:6:
>> In file included from <module-includes>:4:
>> In file included from
>> /Users/ske/dev/prefix/bin/../include/c++/v1/ccomplex:21:
>> In file included from
>> /Users/ske/dev/prefix/bin/../include/c++/v1/complex:247:
>> In file included from
>> /Users/ske/dev/prefix/bin/../include/c++/v1/sstream:174:
>> In file included from
>> /Users/ske/dev/prefix/bin/../include/c++/v1/ostream:140:
>> /Users/ske/dev/prefix/bin/../include/c++/v1/locale:873:26: error: use of
>> undeclared identifier 'strtoll_l'; did you mean 'wcstoll_l'?
>>         long long __ll = strtoll_l(__a, &__p2, __base,
>> _LIBCPP_GET_C_LOCALE);
>>
>
> I ran into this too ( http://llvm.org/bugs/show_bug.cgi?id=21003 ). It
> went away for me when building with -fno-exceptions. Maybe you can post the
> number of the rdar you filed on that bug? With -fno-exceptions and
> http://llvm.org/viewvc/llvm-project?rev=218372 (or -std=c++11), I was
> able to use modules on OS X for a small program (ninja) 4 weeks ago.
>
> (I didn't read the whole thread, sorry if this is redundant information.)
>

To summarize the root cause of the issue upthread, it was that <xlocale.h>
does some nasty non-modular things, which are intrinsically broken by
modules (basically, it makes sure that the _l functions are exported if
user code has included or will include <stdlib.h> et al.). I can't imagine
how building with -fno-exceptions would change this, so maybe the issues
are unrelated.

-- Sean Silva


>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141027/e8eb6db6/attachment.html>


More information about the cfe-dev mailing list