[LLVMbugs] [Bug 21003] New: googletest's gtest-all.cc doesn't build with modules

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 19 10:41:36 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21003

            Bug ID: 21003
           Summary: googletest's gtest-all.cc doesn't build with modules
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

1.) Acquire googletest from somewhere.
2.) 

path/to/llvm-build/Release+Asserts/bin/clang++ -Ipath/to/gtest
-Ipath/to/gtest/include -isysroot $(xcrun -show-sdk-path) -fmodules
-fcxx-modules -Rmodule-build -std=c++11 -c path/to/gtest/src/gtest-all.cc -o
build/gtest-all.o



While building module 'std' imported from
../chrome/src/testing/gtest/include/gtest/gtest.h:54:
In file included from <module-includes>:5:
In file included from
/Users/thakis/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ccomplex:21:
In file included from
/Users/thakis/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/complex:247:
In file included from
/Users/thakis/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/sstream:174:
In file included from
/Users/thakis/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/ostream:133:
/Users/thakis/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/locale:867: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);
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/xlocale/_wchar.h:98:2:
note: 'wcstoll_l' declared here
        wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
        ^



Works fine without the module flags. (Possibly a bug in gtest headers, not
clear. The diagnostic isn't very helpful.)

Adding

     #include <stdlib.h>
     #include <limits.h>
     #include <xlocale.h>

to the top of <limits> (that's what `man strtoll_l` tells me to do) doesn't
help.

strtoll_l is declared in $(xcrun --show-sdk-path)/usr/include/xlocale/_stdlib.h

That file is included by $(xcrun --show-sdk-path)/usr/include/xlocale.h.
xlocale.h is listed as neither included nor excluded in $(xcrun
--show-sdk-path)/usr/include/module.map -- so this is probably a bug in the
system header's module.map file?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140919/289fbb58/attachment.html>


More information about the llvm-bugs mailing list