[cfe-dev] Impending initialization rewrite

Douglas Gregor dgregor at apple.com
Sun Dec 6 11:11:06 PST 2009

On Dec 5, 2009, at 9:57 AM, Sebastian Redl wrote:

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

It happens as part of value initialization for non-class and POD types; I don't think it's ever directly "invoked" by anywhere else in the language.

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

I want to try to get nicer diagnostics than "candidate function here" for overload-resolution failures. I *think* I have the right interface for that, but I want to try it first with a very narrow application area (reference initialization) before I commit to this interface.

	- Doug

More information about the cfe-dev mailing list