On Feb 3, 2011, at 1:05 PM, Douglas Gregor wrote:
> Second, just setting the initializer with VD->setInit() is going to cause 
> huge problems down the line, because the initializer needs to be checked and 
> converted by Sema. At the very least, we'd need a call to 
> Sema::AddInitializerToDecl. However, this happens too late in semantic 
> analysis (after Sema::ActOnUnitializedDecl is called) for this to actually 
> work. For example, we will already have complained if the variable has 
> reference type or has no valid default constructor.

I would add that this concern about the parser doing semantic analysis is 
exactly why the parser isn't supposed to #include anything from AST, so any 
patch that finds itself adding such an #include is generally wrong.

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to