Implict casts disappeared from syntactic init list expressions in C++

Abramo Bagnara via cfe-commits cfe-commits at
Tue Aug 25 10:27:17 PDT 2015

Comparing the result of InitListExpr::getSyntacticForm between r224986
and r245836 I've discovered that integer to char implicit cast for
integer literal 3 is no longer added to AST for C++ (while it is present
in C).

This is the source used to test:

char v[10] = { 3 };

Taken in account that:

- implicit cast (and other conversions, constructor calls, etc.) are
very important also for who need to visit the syntactic form (obvious in
*both* C and C++)

- to generate that for the syntactic form permit to increase the
efficiency and the sharing when using designated range extensions (as
the conversion chain don't need to be replicated for each entry)

I think it is a regression. Am I missing something?

Abramo Bagnara

mailto:abramo.bagnara at

More information about the cfe-commits mailing list