[cfe-dev] missing optimization opportunity for const std::vector compared to std::array

Dennis Luehring dl.soluz at gmx.net
Thu Jun 5 11:14:36 PDT 2014


Am 05.06.2014 19:29, schrieb James Dennett:
> > and why is then clang 3.4.1
> > even without Richard Smith latest patch with __builtin_operator_new/delete
> > allowed to remove this new?
> >
> > #include <memory>
> >
> > int main()
> > {
> >   return *new int(10);
> > }
>
> That's using the new operator, which can be optimized away even when
> operator new cannot be.  (The new operator will use operator new if
> needed, but it may not need to.)
>
that makes it clear - thx



More information about the cfe-dev mailing list