<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 --- - GNU-style attributes in incorrect position"
   href="http://llvm.org/bugs/show_bug.cgi?id=20679">20679</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>GNU-style attributes in incorrect position
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>aaron@aaronballman.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>According to the GCC documentation
(<a href="https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax">https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax</a>):
---
For example,

     void (__attribute__((noreturn)) ****f) (void);
specifies the type “pointer to pointer to pointer to pointer to non-returning
function returning void”. As another example,

     char *__attribute__((aligned(8))) *f;
specifies the type “pointer to 8-byte-aligned pointer to char”. Note again that
this does not work with most attributes; for example, the usage of ‘aligned’
and ‘noreturn’ attributes given above is not yet supported.
---
If we wish to implement the documented (expected) behavior, we may need to
diagnose situations where GNU-style attribute placement laxity is currently
allowed. For instance, the aligned example above currently places the attribute
on the variable declaration instead of on the type, as expected.

So attributes in type position which apply only to declarations should warn and
attributes in declaration position which only apply to types should warn.

See further discussion in:
<a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140811/112661.html">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140811/112661.html</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>