<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Mar 6, 2015, at 3:15 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Mar 6, 2015 at 2:57 PM, jahanian <span dir="ltr" class=""><<a href="mailto:fjahanian@apple.com" target="_blank" class="">fjahanian@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Mar 6, 2015, at 2:47 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Mar 6, 2015 at 2:45 PM, jahanian <span dir="ltr" class=""><<a href="mailto:fjahanian@apple.com" target="_blank" class="">fjahanian@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Mar 6, 2015, at 9:36 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Would it be plausible to check this on templates directly, rather than on their instantiations? This would be less work in the case of multiple instantiations, avoid redundant diagnostics, fail on templates without instantiations rather than creating a lurking failure, and we might even get all the "dependent" tests for free - because we wouldn't be able to look through the dependent types at all.<br class=""></div></div></blockquote><div class=""><br class=""></div></span>It could be plausible. But, in similar cases, checking is done on the instantiated templates and not on the templates directly. This adds another check in the</div><div class="">same code block. Providing a new iteration on templates for this one check is prohibitively expensive (and we normally don’t do much checking on templates).</div></div></blockquote><div class=""><br class="">It is? I'd be curious to see the numbers, as it sounds like you have some.<br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div></span>No I don’t have any. But iterating over templates looking for methods would add to cost.</div></div></blockquote><div class=""><br class="">Well, if we skipped template instantiations it wouldn't necessarily be a strict increase - we'd only visit the template pattern, and none of the instantiations.<br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div>We already visit template instantiations for issuing other diagnostics. New overhead is minimal comparing to iterating over template declarations looking for methods.</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""> Are we iterating over templates for other diagnostics?</div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">If so, I can add this there.</div></div></blockquote><div class=""><br class="">I don't recall any particular cases for/against.<br class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><span class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Do you see anything inherently wrong to adding this check where it is?</div></div></blockquote><div class=""><br class="">Just the issues I mentioned - duplicate diagnostics in the case of multiple instantiations (& no diagnostics in the case of no instantiations).<br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div></span>AFAIK, it is not common practice to add diagnostics on template declarations as this will break SDKs.</div></div></blockquote><div class=""><br class="">Not sure I follow - any type in a header/library could be violating this rule, whether it's a class template or a straight class.<br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div>By this I meant that we don’t issue diagnostics on template declarations in other situations. This will be the “first” and there</div><div class="">may be templates that no one is using and this will break SDKs for those (something template writers may not be used to).</div><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""> Furthermore, if template is not used</div><div class="">in practice, there is no point issuing this diagnostic.</div></div></blockquote><div class=""><br class="">Same would be true of non-template classes in headers, but we don't avoid those.<br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div>Templates are special in that for whatever reasons, we skip diagnostics on them.</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""> Can you point to similar situations where templates are iterated over checking for method</div><div class="">inconsistencies or other types of diagnostics?</div></div></blockquote><div class=""><br class="">Not that I recall/off-hand.<br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div>If we do none. This will be first and people may have strong opinion on the “firsts” :).</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""><br class="">I do recall Ted objecting to my desire to move unreachable-code warnings to act on template patterns rather than template instantiations (& he didn't have numbers either, but the case is different - in that case there are many more function template definitions in headers that aren't necessarily instantiated (owing to the language need for the definitions to be available for instantiations) - unlike classes V class templates, which just appear in headers in a fairly similar way, not a particularly biased ratio one way or the other (except by library design preferences))<br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div>I think similar situation is applicable to class templates which may not be instantiated. I just don’t know enough about usages etc. to make a strong argument one way</div><div class="">or the other. So, other opinions are most welcome.</div><div class="">- Fariborz</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class="">- David<br class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">- Fariborz</div><span class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">- Fariborz</div><span class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><br class="">- David</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Feb 25, 2015 at 10:39 AM, jahanian <span dir="ltr" class=""><<a href="mailto:fjahanian@apple.com" target="_blank" class="">fjahanian@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;font-family:Menlo" class="">This patch restricts issuing -Winconsistent-missing-override when dealing with</div><div style="margin:0px;font-size:11px;font-family:Menlo" class="">class template with dependent bases and dependent methods.</div><div style="margin:0px;font-size:11px;font-family:Menlo" class="">Fixed pr22582 <a class="">rdar://19917107</a>.</div></div><div style="margin:0px;font-size:11px;font-family:Menlo" class="">Please review.</div><div style="margin:0px;font-size:11px;font-family:Menlo" class=""><br class=""></div><div style="margin:0px;font-size:11px;font-family:Menlo" class="">- Fariborz</div><div style="margin:0px;font-size:11px;font-family:Menlo" class=""><br class=""></div><div style="margin:0px;font-size:11px;font-family:Menlo" class=""><span style="white-space:pre-wrap" class=""> </span></div></div><br class=""><div style="word-wrap:break-word" class=""><div style="margin:0px;font-size:11px;font-family:Menlo" class=""></div></div><br class="">_______________________________________________<br class="">
cfe-commits mailing list<br class="">
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank" class="">cfe-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></span></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></span></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>