[cfe-dev] Impending initialization rewrite

Sebastian Redl sebastian.redl at getdesigned.at
Sat Dec 5 09:57:59 PST 2009


Douglas Gregor wrote:
> Essentially, we're trying to capture everything in an 
> InitializationSequence, whose initialization corresponds to 
> initialization (har har) that can then be diagnosed (to emit any 
> delayed diagnostics) or performed (to produce a complete initializer 
> AST). If you've ever looked at ImplicitConversionSequence, it's like 
> that... but provides much more information when there is a failure, is 
> better encapsulated, and will subsume more of the initialization rules.
It looks very nice. I like the approach.
What about zero-initialization? Does it still exist in C++0x?
>
> My plan is to switch one simple client of reference-initialization 
> (AddInitializerToDecl when the VarDecl is a reference) over to this 
> initialization logic and write tests to exercise all of the new code 
> paths, tweak the diagnostics until I'm happy, etc. Then, I'll move all 
> of the CheckReferenceInit callers over to this scheme, and so on.
I suppose that makes sense. Alternatively you could try to move 
AddInitializerToDecl over completely, step by step, and then follow with 
the other places that do initialization. But I think your approach is 
better.

Sebastian



More information about the cfe-dev mailing list