[cfe-dev] Narrowing in initalizer lists

Christopher Jefferson chris at bubblescope.net
Fri Oct 14 06:08:48 PDT 2011

I just wanted to quickly check this bug (which occurs in boost).

clang -std=c++0x forbids:

int f();
unsigned int vals[] = {f(),f()};

As in initalizer lists, int cannot be narrowed to int.

Just wanted to double check, is clang definitely in the right here?

for those keeping track I run the 'minion-' boost testers, which are checking clang both without 0x and with libc++ with and without 0x (0x without libc++ fails for many reasons inside libstdc++, for non-interesting reasons).

For people who want to look at reasons for libc++ and 0x failures, feel free. I may try to categorise them. Some of them look easy (missing std:: or boost:: quanlifications). The problems in icl are due to bugs in that library, that don't seem to be getting fixed.

I am already investigating one issue (floating point parsing of terms like 0x0).


More information about the cfe-dev mailing list