<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">This patch looks good to me. But I am not sure if Aaron has any comment.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 22, 2016, at 6:19 PM, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" class="">dexonsmith@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On 2016-Feb-22, at 17:24, Manman Ren <<a href="mailto:mren@apple.com" class="">mren@apple.com</a>> wrote:<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Feb 8, 2016, at 8:17 PM, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" class="">dexonsmith@apple.com</a>> wrote:<br class=""><br class="">This patch adds support for templates in availability attributes.<br class="">- If the context for an availability diagnostic is a<br class=""> `FunctionTemplateDecl`, look through it to the `FunctionDecl`.<br class=""></blockquote><br class=""><blockquote type="cite" class="">AvailabilityResult Decl::getAvailability(std::string *Message) const {<br class="">+  if (auto *FTD = dyn_cast<FunctionTemplateDecl>(this))<br class="">+    return FTD->getTemplatedDecl()->getAvailability(Message);<br class="">+<br class=""> AvailabilityResult Result = AR_Available;<br class=""></blockquote><br class="">This looks generally correct to me.<br class="">The UnavailableAttr is attached to the FunctionDecl, not the FunctionTemplateDecl, so looking through sounds right.<br class=""><br class=""><blockquote type="cite" class="">- Add `__has_feature(attribute_availability_in_templates)`.<br class=""></blockquote></blockquote></div></blockquote><div><br class=""></div>@Aaron, any comment on this?</div><div>This patch adds extra support for Availability attribute (similar to attribute_availability_with_strict in r261548).</div><div>Not sure if has_attribute can be used for this purpose.</div><div><br class=""></div><div>Manman</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><br class="">Is there anything else I should be testing to be sure availability<br class="">works correctly in templates?<br class=""></blockquote><br class="">Maybe<br class="">test<UnavailableClass>()<br class="">calling unavailable function from an unavailable template function<br class="">calling an unavailable template function<br class=""><br class="">I think these all work with the current compiler. But I am not sure if we have existing test coverage.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Thanks for the ideas; let me know if you have any others.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Can you have a look at the new patch?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Cheers,<br class="">Manman<br class=""><br class=""><blockquote type="cite" class="">I'm working on a patch to add<br class="">availability markup to the libc++ headers, and this is the only<br class="">problem I've hit so far.  Anyone have thoughts on other things I<br class="">should test?<br class=""></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span id="cid:330CDA28-A0CB-4CE4-A5AE-77FDF19EE579@apple.com"><0001-SemaCXX-Support-templates-in-availability-attributes.patch></span></div></blockquote></div><br class=""></div></body></html>