<div dir="ltr">Thanks very much Justin. This is great work in general, and it'll be a huge improvement for llvm::Error users.<div><br></div><div>- Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 14, 2016 at 3:05 PM, Justin Bogner via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> writes:<br>
> Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> writes:<br>
>> My 2 cents: get rid of LLVM_UNUSED_RESULT, and move to LLVM_NODISCARD.<br>
>><br>
>> For compilers that support it, it should be a strict superset of features and<br>
>> functionality. The standard feature was written directly based on the clang<br>
>> warn_unused_result stuff.<br>
>><br>
>> I would just migrate us onto the spelling and usage pattern that got<br>
>> standardized. All we have to lose are warnings from compilers other than Clang<br>
>> until they implement this feature. That seems like not a huge loss to me<br>
>> honestly.<br>
><br>
> You might be right. It seems a bit unfortunate that we'd lose these<br>
> warnings on MSVC and gcc for the time being, but maybe that's better<br>
> than the usability cost of having two macros that expand to the same<br>
> thing.<br>
><br>
> Do note though, if we do that this would mean clang is the only compiler<br>
> we can support this on at all without -std=c++17, since [[nodiscard]]<br>
> will trigger extension warnings in earlier standard modes.<br>
<br>
</span>After talking to a few people it sounds like one LLVM_NODISCARD macro is<br>
the way to go - We have prior art for clang-only warnings; we have<br>
enough coverage building with clang that we'll still catch anything<br>
quickly; and having two macros that are so similar is confusing and<br>
difficult to use.<br>
<br>
I'll stage this as adding an LLVM_NODISCARD, converting in tree code to<br>
use it instead of LLVM_ATTRIBUTE_UNUSED_RESULT, then finally removing<br>
the old macro.<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>