<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 --- - -fmodules causes failure of inclusion of STL headers"
   href="http://llvm.org/bugs/show_bug.cgi?id=21624">21624</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-fmodules causes failure of inclusion of STL headers
          </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>MacOS X
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>191919@gmail.com
          </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>clang version 3.6.0 (trunk 222503) failed to compile trivial code that includes
STL header when using -fmodule:

The code:

```
#include <vector>

int main() {}
```

Compile it with:


```
$ /opt/bin/clang++ -fmodules -c -o m mm.cpp    
```

clang gave the following error messages:

```
While building module 'std' imported from mm.cpp:1:
In file included from <module-includes>:4:
In file included from /usr/include/c++/v1/ccomplex:21:
In file included from /usr/include/c++/v1/complex:247:
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:140:
/usr/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);
                         ^
/usr/include/xlocale/_wchar.h:98:2: note: 'wcstoll_l' declared here
        wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
        ^
While building module 'std' imported from mm.cpp:1:
In file included from <module-includes>:4:
In file included from /usr/include/c++/v1/ccomplex:21:
In file included from /usr/include/c++/v1/complex:247:
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:140:
/usr/include/c++/v1/locale:873:36: error: cannot initialize a parameter of type
'const wchar_t *' with an lvalue of type 'const char *'
        long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
                                   ^~~
/usr/include/xlocale/_wchar.h:98:38: note: passing argument to parameter here
        wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
                                            ^
While building module 'std' imported from mm.cpp:1:
In file included from <module-includes>:4:
In file included from /usr/include/c++/v1/ccomplex:21:
In file included from /usr/include/c++/v1/complex:247:
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:140:
/usr/include/c++/v1/locale:913:35: error: use of undeclared identifier
'strtoull_l'; did you mean 'wcstoull_l'?
        unsigned long long __ll = strtoull_l(__a, &__p2, __base,
_LIBCPP_GET_C_LOCALE);
                                  ^
/usr/include/xlocale/_wchar.h:101:2: note: 'wcstoull_l' declared here
        wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
        ^
While building module 'std' imported from mm.cpp:1:
In file included from <module-includes>:4:
In file included from /usr/include/c++/v1/ccomplex:21:
In file included from /usr/include/c++/v1/complex:247:
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:140:
/usr/include/c++/v1/locale:913:46: error: cannot initialize a parameter of type
'const wchar_t *' with an lvalue of type 'const char *'
        unsigned long long __ll = strtoull_l(__a, &__p2, __base,
_LIBCPP_GET_C_LOCALE);
                                             ^~~
/usr/include/xlocale/_wchar.h:101:39: note: passing argument to parameter here
        wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
                                             ^
While building module 'std' imported from mm.cpp:1:
In file included from <module-includes>:4:
In file included from /usr/include/c++/v1/ccomplex:21:
In file included from /usr/include/c++/v1/complex:247:
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:140:
/usr/include/c++/v1/locale:943:28: error: use of undeclared identifier
'strtold_l'
        long double __ld = strtold_l(__a, &__p2, _LIBCPP_GET_C_LOCALE);
                           ^
mm.cpp:1:10: fatal error: could not build module 'std'
#include <vector>
 ~~~~~~~~^
6 errors generated.
```

Xcode's stock clang (Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM
3.5svn)) is ok with `-fmodules`.</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>