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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> ```
>   /* Protect the entire array initialization so that we can destroy
>      the partially constructed array if an exception is thrown.
>      But don't do this if we're assigning.  */
>   if (flag_exceptions && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
>       && from_array != 2)
>     {
>     ....build_vec_delete_1 ...
>    }
> ```
Just a few notes for the reported, TYPE_HAS_NONTRIVIAL_DESTRUCTOR is false even
for defaulted deconstructor which is why there is no accessible checks,
build_vec_delete_1 has one .

Also note this is accepted if you use -fno-exceptions as build_vec_delete_1 is
not called to check accessibility on the deconstructor:
```
class S {
  ~S(){};
};
int main(){
    S *ss = new S[100];
}
```

Reply via email to