[cfe-commits] patch: warn on allocating over-aligned objects

Nick Lewycky nlewycky at google.com
Fri Dec 16 19:03:10 PST 2011


The attached patch warns on new expressions for types that are
over-allocated, when the "operator new" that will be called is not
overridden. Either the operator new in the class or in the global space can
override, unless it's a global operator new from a system header. This
addresses PR9527.

pr9527-2.cc:13:3: warning: type 'Test' requires 64 bytes of alignment and
the
      default allocator only guarantees 16 bytes [-Woveraligned]
  new Test;
  ^

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111216/a320663b/attachment.html>


More information about the cfe-commits mailing list