ahatanak added a comment.

http://wg21.link/p0968r0#2227 says:

The destructor for each element of class type is potentially invoked (15.4 
[class.dtor]) from the context where the aggregate initialization occurs. 
[Note: This provision ensures that destructors can be called for 
fully-constructed subobjects in case an exception is thrown (18.2 
[except.ctor]). —end note]

And '15.4 Destructors' has this sentence:
A program is ill-formed if a destructor that is potentially invoked is deleted 
or not accessible from the context of the invocation.

I'm not sure what "context" is in the case above (foo or Derived?), but if it's 
foo, it seems like clang is correct.


Repository:
  rC Clang

https://reviews.llvm.org/D53860



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to