<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Mar 4, 2014, at 11:43 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 4, 2014 at 10:59 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="">On Mar 4, 2014, at 10:48 PM, Duncan Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>> wrote:<br>
<div><blockquote type="cite"><div dir="auto"><blockquote type="cite"><blockquote type="cite"><div style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite"><br><blockquote type="cite">Related, should we require use of 'override' when methods override a base<br>class method?<br></blockquote><br>My vote: require override.<br></blockquote><br>+1: override is useful and prevents errors.<br>
</div></blockquote>Would it be too much to have clang emit a warning/error if override is missing? I know that sounds crazy and people hate errors which fire too often, but there’s not too much C++11 code out there yet, and so we have a chance to put errors/warnings in now without too much pain. People might just get used to them and think its how code has to be written :)<br>
</blockquote><div><br></div><div>Might be a nightmare when including legacy headers, but warnings can always be disabled...</div></div></blockquote></div><br></div><div>A clang warning for this would be awesome, but it should be off by default. That said, the build of LLVM itself could detect that Clang had this warning and turn it on. I think it would be great to have the makefiles/cmake detect modern clang's and turn on additional warnings that we can't inflict on the world by default.</div>
</div></blockquote><div><br></div><div>It might be reasonable to warn if a class has both a function marked 'override' and a function that overrides but is not marked 'override'.</div></div></div></div>
</blockquote></div><br><div>That could be useful - because it means that the author of the class is at least thinking about override - but having a "coding style" warning of "I always intend to use override" would still be useful.</div><div><br></div><div>-Chris</div></body></html>