Clang++ - fmodules 错误使用 #include <cstdint>后的类型
Clang++ -fmodules errors using types after #include <cstdint>
以下简单的测试用例文件给了我一个编译时错误,当使用-fmodules
编译时,使用 Clang 的 github 镜像中的"master"提示,使用如下所示的命令。 我想知道这是否是 Clang 的新实验模块功能的错误——可能是标准库模块映射实现的问题——或者我是否做错了什么。 如果我向命令添加-fbuiltin-module-map
,则仍然会出现错误。 有趣的是,如果我用stdint.h
代替cstdint
,则不再出现错误。
#include <stdint.h>
uint64_t foo;
这是我的编译命令,带有错误消息:
anhall@leviathan: /Users/anhall/impersonal/code/llvm-reflexpr/install/bin/clang++ -o module-uint64_t-test.o -c module-uint64_t-test.cpp --std=c++1z -fmodules
module-uint64_t-test.cpp:3:1: error: missing '#include <_types/_uint64_t.h>'; declaration of 'uint64_t' must be imported from module 'Darwin.POSIX._types._uint64_t' before it is
required
uint64_t foo;
^
/usr/include/_types/_uint64_t.h:31:28: note: previous declaration is here
typedef unsigned long long uint64_t;
有关我正在使用的构建的信息:它来自 Matus Chochlik 的 github Clang 镜像分支;但我设置为与原始 clang git 镜像中(当时)"master"的头部相对应提交(换句话说,它不包括来自 Matus Chochlik 的功能"reflexpr"分支的提交):
anhall@leviathan: /Users/anhall/impersonal/code/llvm-reflexpr/install/bin/clang++ -v
clang version 4.0.0 (https://github.com/matus-chochlik/clang.git 1fa85026bfc23f5cda0b89598bd2056b817ae9d4) (https://github.com/llvm-mirror/llvm.git 069db88a3b2cae52023664fdd30378d3adc26566)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Users/anhall/impersonal/code/llvm-reflexpr/install/bin
(注意:怀疑这是一个错误,我也已将上述报告通过电子邮件发送给LLVM管理员,并打算在LLVM Bugzilla提交,如果他们回复并给我一个登录名。 但我想我也会在这里发布它,以防万一这是我弄错了,或者任何使用 Clang 的 C++1z+ 模块支持)的人都感兴趣。
编辑 1:
如果我将-v
添加到编译命令行,它表明它确实在搜索我的构建的include
目录,而不是另一个 Clang 构建的目录,例如:
#include "..." search starts here:
#include <...> search starts here:
/Users/anhall/impersonal/code/llvm-reflexpr/install/bin/../include/c++/v1
/usr/local/include
/Users/anhall/impersonal/code/llvm-reflexpr/install/bin/../lib/clang/4.0.0/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
我不知道问题是否可能是我的 Clang 构建的标头与/usr/local/include
和/usr/include
中的 OS X 系统标头之间的交互
这是我在 r287690 中修复的 libc++ 中的一个问题。如果您更新自定义 Clang/libc++ 安装,这些问题应该得到修复。
在过去的一个月里,我已经修复了将libc ++与模块一起使用的许多问题。从字面上看,我昨天只在启用模块的情况下通过了所有 libc++ 测试。
- EASTL矢量<向量<int>>连续的
- Android Studio 3.5.1 和 NDK 20.0 找不到 cstdint
- C - 创建矢量&lt; vector&lt; double&gt;&gt;矩阵具有分配而不是inizializ
- C 字符串比较“祝您好运”&gt;“再见”
- 为什么将此对向量&lt; map&lt; int,int&gt;&gt;中的地图进行更新.失败
- C :对矢量进行排序&lt; struct&gt;(结构有2个整数)基于结构的整数之一
- C 操作员&gt;&gt;与突变器过载
- 明确的专业化“ CheckIntmap&lt;&gt;”实例化
- 是否需要使用 - &gt;运算符在C 中调用成员函数时
- 什么是模板&lt;&gt;inline bla bla
- 编辑C Qlist&lt; object*&gt; gt;QML代码和一些QML警告中的模型
- eigen :: llt&lt;eigen :: matrixxd&gt;具有不完整的类型
- 错误,包括&lt; ctype&gt;在原子上使用C 11
- 错误c++visual studio c2227左侧'->;Init';必须指向类/结构/联合/泛型类型
- std::vector<;uint8_t>;当C++11/14启用时,手动复制而不是调用memcpy
- Visual Studio 14.0使用CSTDINT和STDINT.H给出编译错误
- ``这个''不能用this-&gt;指针变量
- 如何加入向量&lt; int&gt;到C 中的单个INT
- Clang++ - fmodules 错误使用 #include <cstdint>后的类型
- 是std :: set&lt; std :: future&gt;不可能存在