<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - attribute declaration must precede definition"
   href="https://bugs.llvm.org/show_bug.cgi?id=33926">33926</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>attribute declaration must precede definition
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>zahira.ammarguellat@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>bash-4.2$ cat t3.c
extern __inline int foo (int __goo) {
  return __goo;
}
extern __typeof(foo) foo __asm__("");
bash-4.2$
bash-4.2$ gcc -v
gcc version 4.8.5 (GCC)
bash-4.2$
bash-4.2$ gcc -c t3.c
bash-4.2$

bash-4.2$ ../llorg_ws/builds/llorgefi2linux_debug/llvm/bin/clang -v
clang version 6.0.0 (cfe/trunk 308973)
bash-4.2$

bash-4.2$ clang -c -Xclang -ast-dump t3.c | grep foo
t3.c:4:34: warning: attribute declaration must precede definition
      [-Wignored-attributes]
extern __typeof(foo) foo __asm__("");
                                 ^
t3.c:1:21: note: previous definition is here
extern __inline int foo (int __goo) {
                    ^
1 warning generated.
|-FunctionDecl 0xb5c40b0 <t3.c:1:1, line:3:1> line:1:21 referenced foo 'int
(int)' extern inline
`-FunctionDecl 0xb5c42e8 prev 0xb5c40b0 <line:4:1, col:36> col:22 foo 'int
(int)' extern
bash-4.2$

gcc doesn't generate a warning. clang does. We can see that foo has 2 different
attributes.</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>