https://bugs.llvm.org/show_bug.cgi?id=38236
Bug ID: 38236
Summary: flexible array member in an otherwise empty struct
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: zhong...@pku.org.cn
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
The code is as follow:
struct ordered_tasks
{
int * pop ();
};
struct A
{
ordered_tasks * tasks[];
int * pop ();
};
int pop_first_bucket;
int * A::pop ()
{
int * out;
int cur_bucket = 0;
do {
if (tasks[0]) {
out = tasks[cur_bucket]->pop();
if (out)
return out;
}
} while (pop_first_bucket);
return 0;
}
clang++ accepts the code, but g++ rejects it:
code0.cpp:8:24: error: flexible array member 'A::tasks' in an otherwise empty
'struct A'
ordered_tasks * tasks[];
^
--
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