[llvm-bugs] [Bug 36638] New: [MS] clang fails to compile function with __unaligned argument to class member

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 7 14:38:48 PST 2018


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

            Bug ID: 36638
           Summary: [MS] clang fails to compile function with __unaligned
                    argument to class member
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ilia.taraban at intel.com
                CC: llvm-bugs at lists.llvm.org

clang fails to compile function with __unaligned argument to class member:

=============== nice.cpp ==============

class A;
void func(void (A::*a)(int) __unaligned);

=======================================


>>> clang -v
clang version 7.0.0 (trunk 326880)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...

>>> clang++ -c nice.cpp -fms-extensions
nice.cpp:2:6: error: variable has incomplete type 'void'
void func(void (A::*a)(int) __unaligned);
     ^
nice.cpp:2:20: error: expected unqualified-id
void func(void (A::*a)(int) __unaligned);
                   ^
nice.cpp:2:21: error: use of undeclared identifier 'a'
void func(void (A::*a)(int) __unaligned);
                    ^
nice.cpp:2:27: error: expected '(' for function-style cast or type construction
void func(void (A::*a)(int) __unaligned);


But this test is compiled without any errors using cl and icl -
https://godbolt.org/g/iPp9Yq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180307/7ea270ac/attachment.html>


More information about the llvm-bugs mailing list