<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:hfinkel@anl.gov" title="Hal Finkel <hfinkel@anl.gov>"> <span class="fn">Hal Finkel</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Generated code crashes in -O2/-O3 because of template expansion"
   href="http://llvm.org/bugs/show_bug.cgi?id=22636">bug 22636</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;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Generated code crashes in -O2/-O3 because of template expansion"
   href="http://llvm.org/bugs/show_bug.cgi?id=22636#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Generated code crashes in -O2/-O3 because of template expansion"
   href="http://llvm.org/bugs/show_bug.cgi?id=22636">bug 22636</a>
              from <span class="vcard"><a class="email" href="mailto:hfinkel@anl.gov" title="Hal Finkel <hfinkel@anl.gov>"> <span class="fn">Hal Finkel</span></a>
</span></b>
        <pre>Unfortunately, the source code provided is not valid. Specifically, binding a
null pointer to a reference in C++ produces undefined behavior. GCC does not
take advantage of this fact, but Clang does.

There was a note about this in the Clang 3.5 release notes. It says:

C++ Language Changes in Clang
-----------------------------

- Reference parameters and return values from functions are more aggressively
  assumed to refer to valid objects when optimizing. Clang will attempt to
  issue a warning by default if it sees null checks being performed on
  references, and `-fsanitize=null` can be used to detect null references
  being formed at runtime.</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>