<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:aaron@aaronballman.com" title="Aaron Ballman <aaron@aaronballman.com>"> <span class="fn">Aaron Ballman</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - warn_unused_result and cast to void"
   href="https://bugs.llvm.org/show_bug.cgi?id=51228">bug 51228</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WONTFIX
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - warn_unused_result and cast to void"
   href="https://bugs.llvm.org/show_bug.cgi?id=51228#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - warn_unused_result and cast to void"
   href="https://bugs.llvm.org/show_bug.cgi?id=51228">bug 51228</a>
              from <span class="vcard"><a class="email" href="mailto:aaron@aaronballman.com" title="Aaron Ballman <aaron@aaronballman.com>"> <span class="fn">Aaron Ballman</span></a>
</span></b>
        <pre>(In reply to David Blaikie from <a href="show_bug.cgi?id=51228#c4">comment #4</a>)
<span class="quote">> Yeah, generally I'd consider this "working as intended".

> Indeed this functionality is explicitly documented as such:
> <a href="https://releases.llvm.org/6.0.0/tools/clang/docs/AttributeReference">https://releases.llvm.org/6.0.0/tools/clang/docs/AttributeReference</a>.
> html#nodiscard-warn-unused-result-clang-warn-unused-result-gnu-warn-unused-
> result</span >

+1, I consider this to be working as intended. The linked discussion of the GCC
bug report is interesting, but doesn't really make a compelling case for why a
cast to void to silence the warning is undesirable. Silencing this diagnostic
by casting to void is not unexpected behavior for users (as the GCC bug report
shows). Even if it was, changing that now would break user's code if they're
compiling with -Werror.

I'm resolving as WONTFIX because this is behaving by design, but that doesn't
mean discussion on the topic has to end (if someone wants to build a compelling
case that also considers the potential for breaking code relying on this
silencing mechanism, we can always reopen the issue).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>