<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - googletest's gtest-all.cc doesn't build with modules"
   href="http://llvm.org/bugs/show_bug.cgi?id=21003">21003</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>googletest's gtest-all.cc doesn't build with modules
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Modules
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>