[llvm-bugs] [Bug 38265] New: value-initialization of incomplete type

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 22 16:56:13 PDT 2018


            Bug ID: 38265
           Summary: value-initialization of incomplete type
           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:

struct x0
 x0 () = default;
struct x1
 x0 x2[];
 void x3 ()
 x1 ();

clang++ accepts it, but g++ rejects it:

code0.cpp:7:8: error: flexible array member 'x1::x2' in an otherwise empty
'struct x1'
  x0 x2[];
code0.cpp: In member function 'void x1::x3()':
code0.cpp:10:6: error: value-initialization of incomplete type 'x0 []'
  x1 ();

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/20180722/fc88efa9/attachment.html>

More information about the llvm-bugs mailing list