user1368198
user1368198

Reputation:

Clang 3.3 and C++14 support?

Clang 3.3 supports some C++14 features, like member initializers and aggregates. However, I am unable to compile this code even with -std=c++11 switch.

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

A a = {{10}, 5};

What am I doing wrong?

Upvotes: 17

Views: 6355

Answers (1)

Sergey K.
Sergey K.

Reputation: 25386

Post-C++11 language features in Clang 3.3 are enabled with this command-line switch:

-std=c++1y

Check out the bottom of this page http://clang.llvm.org/cxx_status.html for the list of currently supported post-C++11 features in Clang 3.3.

Also, here you will find discussions on the upcoming C++14 and usage examples: http://www.meetingcpp.com/index.php/br/items/a-look-at-cpp14-papers-part-1.html

Upvotes: 30

Related Questions