April 01, 2004 Non-conformance with deleting pointer to incomplete type | ||||
---|---|---|---|---|
| ||||
Hi, The following program causes a compiler error (8.38n): struct T; T* CreateT(); int main() { delete CreateT(); } According 5.3.5/5, deleting a pointer to an incomplete type yields undefined behavior only if the complete type has a non-trivial destructor or deallocation function, so a compile error seems inappropriate here. All compilers I have tested except GCC and DigitalMars just give a warning. Jonathan |
April 02, 2004 Re: Non-conformance with deleting pointer to incomplete type | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan Turkanis | "Jonathan Turkanis" <technews@kangaroologic.com> wrote in message news:c4ghig$1uk3$1@digitaldaemon.com... > Hi, > inappropriate here. All compilers I have tested except GCC and DigitalMars just give a warning. I just verified that GCC downgraded the diagnostic from an error to a warning with version 3.3. Best Regards, Jonathan |
Copyright © 1999-2021 by the D Language Foundation