[llvm-bugs] [Bug 38267] New: alignas example won't compile

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 22 17:22:18 PDT 2018


            Bug ID: 38267
           Summary: alignas example won't compile
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

The code is as follow:

char alignas(128) cacheline[128];

This example is given here: http://en.cppreference.com/w/cpp/language/alignas

clang++ rejects it:

code2.cpp:1:6: error: 'alignas' attribute cannot be applied to types
    char alignas(128) cacheline[128];
    1 error generated.

Instead, g++ accepts the above code sample.

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/20180723/f5795434/attachment.html>

More information about the llvm-bugs mailing list