https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117046

--- Comment #7 from Carlos Galvez <carlosgalvezp at gmail dot com> ---
Actually in the patch that would address this issue for Clang
(https://reviews.llvm.org/D53860), they mentioned 2277:

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0968r0.html#2227

With emphasis:

> The destructor for each element of class type is potentially invoked (15.4 
> [class.dtor]) from the context where the aggregate initialization occurs. 

Some more comments from the patch:

> I've checked the minutes, and we did indeed discuss that when resolving C++ 
> DR 2227, and decided that the context for the access check should be the 
> context of the aggregate initialization, not the context of the class 
> definition.

This makes sense with my very limited knowledge, but I'd like to hear your
opinion on 2277. It does feel like a separate issue than 2244.

Reply via email to