https://bugs.llvm.org/show_bug.cgi?id=33926

            Bug ID: 33926
           Summary: attribute declaration must precede definition
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: zahira.ammarguel...@intel.com
                CC: llvm-bugs@lists.llvm.org

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to