[llvm-bugs] [Bug 38236] flexible array member in an otherwise empty struct

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 19 19:10:36 PDT 2018


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

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
> 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[];
>                         ^

This is intentional.

C has a rule that structs can't be empty, C++ does not, so it makes sense that
this restriction would not exist in C++.

-- 
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/20180720/3428fdd4/attachment.html>


More information about the llvm-bugs mailing list