IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
struct C {
// C is implicitly declared here as a synonym for the class name.
};
C::C c; // same as "C c;"
In this example clang will inject another declaration to provide the name C
within the record decl. For unknown reason it is added to the redecl chain.
When we revert a class decl we must make sure that the implicitly injected name
in the chain is gone.
Two things first the iterator wasn't considered to be empty.
Second the loop written such assumes chances to the collection
within the loop which is not the case.
The lookup table is highly optimized: a single data member can be a single decl
or a vector with decls. In the regular case when clang only adds declarations
the single decl gets promoted to a vector.
The decl reverter doesn't bother to demote the vector into a single decl (for now)
Insted if we see the vector is empty we remove the lookup entry from the map and
thus we make the compareState happy.
In the past we used that routine as sanity check whether we are reverting in
the correct order. Now we have store/compare state.
Moreover this is wrong because the the template specializations create a mess
in the order, because the pattern is being added to the context but not the
underlying declarations. This breaks the logic of the visitor as it needs to have
two completely different code paths for templates and the rest of the decls only
because we wanted to keep this logic.
Now is a lot simpler. Remove the decl if it was in the context, without providing
any sanity checks what so ever.
The key idea is that the decl that is being detached from the redecl chain can
be in registered in the lookup tables. In this case we need to check if there
is another decl in the chain and update the lookup table so that the existing
decls in the chain could be accessible.