<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:dblaikie@gmail.com" title="David Blaikie <dblaikie@gmail.com>"> <span class="fn">David Blaikie</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - clang generates wrong module by removing un-inlined function body in -O0"
   href="https://bugs.llvm.org/show_bug.cgi?id=36236">bug 36236</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>INVALID
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>dblaikie@gmail.com
           </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 INVALID - clang generates wrong module by removing un-inlined function body in -O0"
   href="https://bugs.llvm.org/show_bug.cgi?id=36236#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - clang generates wrong module by removing un-inlined function body in -O0"
   href="https://bugs.llvm.org/show_bug.cgi?id=36236">bug 36236</a>
              from <span class="vcard"><a class="email" href="mailto:dblaikie@gmail.com" title="David Blaikie <dblaikie@gmail.com>"> <span class="fn">David Blaikie</span></a>
</span></b>
        <pre>I believe this is correct behavior for C99. GCC does the same thing:

$ cat inl.c
inline void foo() {
}
int main() {
  foo();
}
$ gcc inl.c -std=c99
/tmp/ccMjLRUx.o: In function `main':
inl.c:(.text+0xa): undefined reference to `foo'

I can't find the proper reference for it, but my understanding is that in C the
inlinable definition is potentially separate from the non-inlined definition (
<a href="https://gustedt.wordpress.com/2010/11/29/myth-and-reality-about-inline-in-c99/">https://gustedt.wordpress.com/2010/11/29/myth-and-reality-about-inline-in-c99/</a>
discusses this with examples)</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>