clang++相关内容
我把问题归结为下面的例子: int main() { try { throw false; } catch(bool x) { if(x) { return 0; } else { return 1; } } } a href =“http://coliru.stacked-crooked.com/a/adf42fbd79482935”
..
我有以下代码: #include #include #include 枚举ATYPE {Undefined = 0,typeA,typeB,typeC}; 模板 struct Object { Object(){counter ++; } static std ::
..
C ++ 11专家的几个问题。 我与SFINAE战斗,我遇到了一个奇怪的情况,其中g ++(4.9.2) ,和clang ++(3.5.0)的行为不同。 我准备了下面的示例代码。对不起,但我无法做得更简洁。 #include #include #include #include
..
以下代码在gcc 4.9.3和clang 3.7.1上编译和运行。 // std :: unique_ptr #include //模板模板参数的模板类 template struct Bar {}; //基类class template类XX>
..
有人曾经要求另一天某些东西编译clang,但不是与gcc。我直观地了解发生了什么,并能够帮助的人,但它让我想知道 - 根据标准,哪个编译器是正确的?下面是一个代码的缩写版本: #include #include class foo { public: foo(const std :: string& x): name(x) {
..
我有一个奇怪的问题,使SFML2应用程序。我使用Clang ++从存储库以及libc ++(两个更新今天)。 SFML2也从SVN仓库更新。我使用的是最新版本的Kubuntu。我也有同样的问题,当我上次尝试大约一个月前与当时最新的存储库。 我传递给编译器的参数c ++ 11和stdlib是:-std = c + + 11 -stdlib = libc ++ 这是我调用的完整版本:
..
关于此主题的以前的问题: 这是我最近询问的问题的后续: clang:no out of -line虚方法定义(纯抽象C ++类) ,并且标记为此问题的重复:。我不认为这回答了我的问题,所以这里我专注于那个困惑我的事情,还没有回答。 我的方案: 我试图使用Clang-3.5编译以下简单的C ++代码: test.h: class A { public: (
..
我想要关注本教程 regex在C ++ 11。当我尝试编译小代码示例时,我得到这些错误 clang ++ -std = c ++ 0x test.cpp -o test 在test.cpp中包含的文件中:3: 在/usr/include/c++/4.6/regex:55中包含的文件中: /usr/include/c++/4.6/bits /regex_constants.h:196:3
..
下面的代码不是在clang下编译,而是在gcc和VS下编译: template class foo { foo(){} template朋友类吧 }; } template class ba
..
我试图在Clora中编译Fedora 20上的简单hello world,并得到以下输出: d.cpp :1:10:致命错误:找不到“iostream”文件 #include p> 我不知道如何解决它。 方案 点3 解决了我的问题。 1。 有同样的问题,fedora 21 :: clang 3.5.0: clang ++ -std =
..
通过 clang 反对 libc ++ , libc ++ abi , compiler-rt : 要下载(和更新) llvm 和子档案,请按照下列步骤操作: svn co http://llvm.org/svn/llvm-project/llvm/ trunk llvm cd llvm / tools svn co http://llvm.org/svn/llvm-projec
..
这是一个使用valarrays的简单c ++程序: #include #include int main(){ using ratios_t = std :: valarray ratios_t a {0.5,1,2}; const auto& res(ratios_t :: value_type(256
..
据我所知,Visual Studio 2015是随附的。。首先我虽然这只是为Android和iOS应用程序,但根据这篇文章它应该也可以使用clang ++前端的Windows程序。但是,我找不到相应的选项。 所以,请你解释一下,我可以改变使用的编译器铛一个c + +项目(在VS2015 RC Community Edition)。 解决方案 从VS2015 Update 1开始,您可
..
有可能让Travis CI与Clang能够使用C ++ 11? (我想Clang,不是GCC,我已经有GCC 4.8在Travis CI工作。)看来,预安装的版本不是C ++ 11能力。我安装任何更新版本的所有尝试最终都会因此而失败: 在/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/中包含的文件c ++ / 4.8 / bits
..
有没有方法在C ++ 11或更高版本中创建用户定义的属性? 例如, [[noreturn]] void exit(); 是编译器定义的C ++ 11属性。 我想定义如下: [[sentsoon]] int function 是否有这种机制? 编辑:我应该提到我使用Clang。 解决方案 语言无法添加属性。
..
我想使用operator enum myenum:uint16_t { X = 0, }; int main() { std :: cout
..
我想实验将一个项目从gcc迁移到clang ++。我承认无知,我不知道为什么下面的代码 template
..
使用Clang 3.5,3.6或3.7,标志 std = c ++ 1y 下面的代码不能编译: #include auto foo(auto bar){return bar; } int main(){ std :: cout
..
代码如下: struct Foo { Foo(const char *); }; Foo :: Foo(const char * str = 0) { } VS 2013和gcc 4.8.0接受这样的代码, ,而clang 3.3拒绝这样的代码: 错误:在重新声明中添加默认参数会使此构造函数成为默认构造函数。 03和C
..
我试图编译一个程序,我发现在网络上使用Clang ++。 Makefile生成以下命令: clang ++ -c -arch x86_64 -msse3 -std = c ++ 11 -stdlib = libstdc ++ -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-non-
..