Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Implicit Destructor Names (AST)

Hi

Since CDT 7.0 (I think), in code statements like 'X x;' (where X is a
type containing a constructor declaration) the declarator x contains an
implicit name which refers to X's constructor. This is a very useful and
also necessary feature!

However, when considering the following code 
{
  X x;
}
one misses, beside the reference to the constructor of X, also a
reference to X's destructor, which, for completeness, should also be
part of the AST.

The question which arises here, is, where this name should best be
contained.
 - The simples, but also a bit incorrect option is to put the name into
the declarator x. This is not really the place where the destructor is
called, but it is the origin which causes the destructor to be called at
the end of the enclosing compound statement
 - The more precise place to place the name is the end of the end of the
enclosing compound statement (which would mean to let the interface
IASTCompoundStatement extend IASTImpliciteNameOwner).

What is your opinion on this matter?


Best regards
Lukas Felber



Back to the top