Clang 3.3 and C++14 support?

Clang 3.3 and C++14 support?

本文关键字:support and Clang C++14      更新时间:2023-10-16

Clang 3.3支持一些C++14特性,如成员初始化器和聚合。但是,即使使用-std=c++11开关,我也无法编译此代码。

struct A
{
   struct X { int a, b; };
   X x = { 1, 2 };
   int n;
};
A a = {{10}, 5};

我做错了什么?

Clang 3.3中的Post-C++11语言功能通过以下命令行开关启用:

-std=c++1y

查看此页面的底部http://clang.llvm.org/cxx_status.html以获取CCD_ 3中当前支持的C++11后功能的列表。

此外,您还可以在这里找到关于即将推出的C++14的讨论和使用示例:http://www.meetingcpp.com/index.php/br/items/a-look-at-cpp14-papers-part-1.html