https://bugs.llvm.org/show_bug.cgi?id=46562
Bug ID: 46562
Summary: Clang fails to parse C++11 attributes for unnamed
bit-fields
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
A short test shows that Clang does not accept attributes before the colon (`:`)
for bit-fields when the identifier is omitted.
### SOURCE (<stdin>):
struct A {
int x, [[]] : 0;
};
### COMPILER INVOCATION:
clang -cc1 -fsyntax-only -xc++ -
### ACTUAL OUTPUT:
<stdin>:2:10: error: an attribute list cannot appear here
int x, [[]] : 0;
^~~~
<stdin>:2:15: error: expected member name or ';' after declaration specifiers
int x, [[]] : 0;
~~~ ^
2 errors generated.
### EXPECTED OUTPUT:
(rc=0)
### COMPILER VERSION INFO (clang++ -v):
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
f9348f70c2330f3565ee01134bcba1dd38628c79)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/wandbox/clang-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs