<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Clang doesn't support __attribute__((__externally_visible__))"
   href="http://llvm.org/bugs/show_bug.cgi?id=16683">16683</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang doesn't support __attribute__((__externally_visible__))
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fanael4@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Clang impersonates GCC 4.2.1, but doesn't support
__attribute__((__externally_visible__)). This means the following code

/* __externally_visible__ was introduced in 4.1.0 */
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401)
__attribute__((__externally_visible__))
#endif
int x;

gets a warning emitted:

x.cpp:3:16: warning: unknown attribute '__externally_visible__' ignored
[-Wattributes]
__attribute__((__externally_visible__))
               ^

That's unexpected, because the #if is meant to stop passing the attribute to a
compiler that doesn't support it. However, Clang lies and claims it's GCC
4.2.1, which does support this attribute. Of course, there's an obvious
workaround, but still.

Ideally, Clang should support it with proper semantics, i.e. running an
internalize pass should leave __externally_visible__ entities externally
visible.</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>