<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Nov 17, 2010, at 7:49 PM, Anders Carlsson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Nov 17, 2010 kl. 3:11 PM skrev Argyrios Kyrtzidis:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: akirtzidis<br>Date: Wed Nov 17 17:11:54 2010<br>New Revision: 119583<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=119583&view=rev">http://llvm.org/viewvc/llvm-project?rev=119583&view=rev</a><br>Log:<br>Introduce option -Wargument-larger-than[=N] which warns about function definitions if they take by-value<br>or return by-value any POD that is larger than some threshold (default is 64 bytes).<font class="Apple-style-span"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>Very cool!</div><div><br></div><div>However, I don't think "isPOD" is the right type here. It won't warn for:</div><div><br></div><div>struct A {</div><div>private:</div><div>int a[100];</div><div>};</div><div><br></div><div>for example.</div><div><br></div><div>I think what you want to check for (on Itanium at least) is "record type with a trivial copy constructor or destructor." </div><div>If a record type has a non-trivial copy constructor or destructor it will always be passed by pointer.</div></div></blockquote><div><br></div><div>I see your point but the standard doesn't make any guarantees about the layout of non-POD types so I'm not sure doing such a Sema check is the "right" thing.</div><div>Maybe check on the codegen side ?</div><div><br></div><div>-Argiris</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>- Anders</div><div><br></div><div><br></div></div></blockquote></div><br></body></html>