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

            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: unassignedclangb...@nondot.org
          Reporter: zhong...@pku.org.cn
                CC: dgre...@apple.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to