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

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 28 14:27:13 PDT 2015


On Tue, Aug 25, 2015 at 10:27 AM, Abramo Bagnara <abramo.bagnara at bugseng.com
> wrote:

> 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?


Why do you expect this semantic information to appear in the syntactic form
of the initializer?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150828/12e89e20/attachment.html>


More information about the cfe-commits mailing list