[LLVMdev] Designated Initializers work in clang++
Andrey Valyaev
dron at osrc.info
Thu Jan 13 13:33:30 PST 2011
di.cpp:
------
#include <iostream>
using namespace std;
struct foo {
int a;
int b;
};
int main(int, char **)
{
const foo f = { .a = 10, .b = 11 };
cout << f.a << ' ' << f.b << endl;
return 0;
}
-----
$ clang++ -Wall -Wextra -Weffc++ -o di di.cpp
$ ./di
10 11
It is a standard C99!
Or am I wrong?
$ clang++ --version
clang version 2.8 (branches/release_28)
Target: i386-pc-linux-gnu
Thread model: posix
--
http://mdf-i.blogspot.com
Andrey Valyaev
More information about the llvm-dev
mailing list