[cfe-commits] r91599 - /cfe/trunk/docs/UsersManual.html

Sebastian Redl sebastian.redl at getdesigned.at
Thu Dec 17 06:00:13 PST 2009


Nuno Lopes wrote:
> Author: nlopes
> Date: Thu Dec 17 04:00:52 2009
> New Revision: 91599
>
> URL: http://llvm.org/viewvc/llvm-project?rev=91599&view=rev
> Log:
> document -fno-assume-sane-operator-new, per Chris request.
> please review for English grammar mistakes
>
>  +<dt id="opt_fno-assume-sane-operator-new"><b>-fno-assume-sane-operator-new</b>:
> +Don't assume that the C++'s new operator is sane.</dt>
> +<dd>This option tells the compiler to do not assume that C++'s global - and any
> +possibly overloaded - new operator will always return a pointer that do not
> +alias any other pointer when the function returns.</dd>
>   
This is too strong an assumption. We can assume this for the normal 
operator new, but placement new already violates this as specified in 
the standard:

void *memory = get_some_mem();
T *pt = new (memory) T(); // pt aliases memory

Sebastian



More information about the cfe-commits mailing list