[cfe-commits] r80446 - in /cfe/trunk: lib/AST/DeclCXX.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaTemplate/instantiate-member-initializers.cpp

Fariborz Jahanian fjahanian at apple.com
Sat Aug 29 17:35:00 PDT 2009


On Aug 29, 2009, at 4:00 PM, Eli Friedman wrote:

> On Sat, Aug 29, 2009 at 3:53 PM, Fariborz  
> Jahanian<fjahanian at apple.com> wrote:
>> Not knowing enough about instantiation, I assume that at  
>> instantiation time,
>> the base initializer list is rescanned with actual types and the  
>> AST for the
>> initializer
>> list is built from scratch. So, I am wondering why this change was
>> necessary? Unless it
>> caused a crash and this patch is avoiding it!
>
> The issue was that the initializer was getting dropped.

Sorry, I wasn't clear. We are building BaseOrMemberInitializers AST  
for the
CXXConstructorDecl node. Can't we just punt altogether if there is a  
dependent base
(or field) to be initialized by constructor's initializer list. I  
assume BaseOrMemberInitializers will (can) be
rebuilt from scratch when we instantiate the class template. Unless  
instantiation assumes the existence
of BaseOrMemberInitializers (which  was incomplete without your  
patch).  My point is like a CFG discussion
a while back. Why do we build something for templates which must be  
rebuilt for each instantiation?

- Fariborz

>
>
> -Eli




More information about the cfe-commits mailing list