<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - clang-cl generates incorrect code for globals without static initializers which have references to imported functions"
   href="http://llvm.org/bugs/show_bug.cgi?id=20076">bug 20076</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>DUPLICATE
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - clang-cl generates incorrect code for globals without static initializers which have references to imported functions"
   href="http://llvm.org/bugs/show_bug.cgi?id=20076#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - clang-cl generates incorrect code for globals without static initializers which have references to imported functions"
   href="http://llvm.org/bugs/show_bug.cgi?id=20076">bug 20076</a>
              from <span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span></b>
        <pre>When you use a dllimported function in a global constant initializer, you end
up getting the address of a thunk from the import library instead of the
address of the actual function.  It's worse for globals, where you get a link
error instead.

This will be hard to fix because a GlobalValue in LLVM is a Constant, and LLVM
optimizers will try to fold it into the initializer.

*** This bug has been marked as a duplicate of <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - The address of a dllimported global variable cannot be used in a constant initializer"
   href="show_bug.cgi?id=19955">bug 19955</a> ***</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>