- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
当使用 -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 的功能“refflexpr”分支的提交):
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+ 模块支持的任何人都感兴趣)
如果我添加 -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 构建 header 与 /usr/local/include
中的 OS X 系统 header 之间的交互和 /usr/include
最佳答案
这是我在 r287690 中修复的 libc++ 中的一个问题.如果您更新您的自定义 Clang/libc++ 安装,这些问题应该得到解决。
在过去的一个月里,我解决了一些使用带有模块的 libc++ 的问题。我真的只是昨天在启用模块的情况下通过了所有 libc++ 测试。
关于c++ - 在#include <cstdint> 之后使用类型的 Clang++ -fmodules 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41028251/
我知道的引用资料在这里: http://clang.llvm.org/docs/ClangCommandLineReference.html http://clang.llvm.org/docs/Di
这两个工具似乎有一些共同的目标,而 documentation of clang-tidy对其功能非常明确,clang-check's有点稀疏。 如果我只能运行这些工具中的一个,同时进行相同的检查,那
我不清楚 clang 使用的汇编器。 AFAIK native 又名 GNU 汇编器和链接器被使用(与 gcc 一起提供)。 clang -v main.c clang version 3.4.2 T
在哪里可以找到 Clang 标志的完整列表? 还有一些,例如 -include-pch,甚至没有在手册页中列出。 :( 我知道 GCC 使用一些相同的标志,但它不包含诸如 -Os 之类的文档,我相信这
大多数成熟的编译器似乎对堆栈变量破坏有很好的支持。 海湾合作委员会:-fstack-protector xlC: -qstackprotect 英特尔:-fstackprotector window
我的命令: /usr/bin/c++ -fPIC -I/Users/me/project/include -I/usr/local/include/opencv \ -I/usr/local/incl
我正在研究 CLang 3.5。我正在尝试获取有关在 C++ 项目中声明的变量的信息。 如何获取 clang::VarDecl 中变量的数据类型或限定类名, clang::FieldDecl或 cla
我正在尝试构建 LLVM 编译器,以便我可以在 Apple M1 上启用 OpenMP。 我正在使用 LLVM 开发树,(因为我最近看到一些 OpenMP 运行时对此进行了处理)。 我已经结束了这个脚
背景: 在 Windows 10 PC 上,我有一个 C++ 代码库。使用 CMAKE 我生成了一个 Mingw-w64 项目(使用 Eclipse IDE)和一个 Visual Studio 201
下面是我想做的。 我想通过使用 cmake 的正确程序检测 clang 来使用 clang/clang++ 进行编译。 请告诉我可以解决我将描述的问题的正确程序。 test environment:
基本问题 我有以下代码 #include #include using namespace std; int main () { int32_t spam; spam=5; cout
当我在xcode中编译.c文件时,出现错误提示: clang error: argument unused during compilation: '-fno-objc-exceptions' [-W
Clang has several kinds of diagnostics ,其中三种主要是错误、警告和注释。 注释通常伴随着某些警告和错误,例如重复定义: error: conflicting t
我正在调整 Clang 工具模板(如 here 所述)以在我的代码中搜索特定的方法调用。为了稍后重写该调用,我想获取调用该方法的参数的类型,以及调用该方法的对象的类型。 我设法找到了一个可以回调以下内
我必须通过在它之前添加一个语句来检测 clang 中的某些语句。我有一个指向 Expr 对象的指针,我需要在包含它的语句之前插入另一个语句。现在我正在使用一种hacky方法,它只是将 SourceLo
类 clang::ASTContext 有一个方法: DynTypedNodeList getParents(const NodeT &Node) 它返回给定 AST 节点的父节点列表。 通常 AST
我想修改代码分析器程序clang-tidy的检查正在做,但是好像是配置文件.clang-tidy的内容正在被忽视。 我通过调用 clang-tidy 创建文件带旗-dump-config并将输出重定向
有没有办法用clang创建一个可以合理地适合页面的调用图? 即给出: #include using namespace std; int main() { int a; cin>>a;
我正在编写一个 Clang 工具,并且试图弄清楚如何在访问程序 AST 的情况下评估字符串文字。给定以下程序: class DHolder { public: DHolder(std::strin
我想在 Clang 中尝试一些新功能,有人提到我 Clang TOT . 现在这可能是一个明显的问题,到底是什么Clang TOT . TOT 一定是一些我不熟悉的首字母缩写词。 任何人都可以启发我吗
我是一名优秀的程序员,十分优秀!