<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 5 April 2017 at 13:38, Duncan Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
> On Apr 5, 2017, at 05:13, Aaron Ballman via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br>
><br>
> aaron.ballman added inline comments.<br>
><br>
><br>
> ================<br>
> Comment at: lib/Sema/SemaAttr.cpp:578<br>
> +    return;<br>
> +  Diag(PragmaAttributeStack.<wbr>back().Loc, diag::warn_pragm_attribute_no_<wbr>pop_eof);<br>
> +}<br>
> ----------------<br>
> arphaman wrote:<br>
>> aaron.ballman wrote:<br>
>>> Perhaps adding a FixIt here would be a kindness?<br>
>> Where would the fix-it point to? I think only the user will know the location at which they meant to insert `#pragma clang attribute pop`.<br>
> Given that it's a warning rather than an error, and our recovery mechanism is to effectively pop the pragma at the end of the TU, I was thinking it could be added at the end of the TU. However, you are correct that it's probably not where the programmer needs it,<br>
<br>
</span>What about at the end of the file the push is in?  This is likely to be used in header files, and it's probably unintentional if it extends past the end of the file of the push.<br></blockquote><div><br></div><div>Then we'd have to take into account preprocessor directives, as we'd obviously want to insert it before the '#endif'. Or if the user used `#pragma once`  then the end of the file could probably work.</div><div>IMHO the improvement can be done as a follow-up that improves this and other pragmas like #pragma pack.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I think we should consider the same thing for #pragma pack (although that's a little off-topic).<br>
<span class=""><br>
> so a FixIt likely isn't appropriate. Does that suggest the warning should be an error instead?<br>
<br>
</span>Maybe it should be an error, but I still think a fixit would be nice if we can find a spot.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> Repository:<br>
>  rL LLVM<br>
><br>
> <a href="https://reviews.llvm.org/D30009" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D30009</a><br>
><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>