This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70932] flexible array member with non-trivial destructor


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70932

--- Comment #4 from Paul Wankadia <junyer at google dot com> ---
FWIW, using a simplified struct, Compiler Explorer (gcc.godbolt.org) with GCC
6.1 throws a different error:


#include <atomic>

struct State {
  int i;
  std::atomic<State*> next_[];
};


Compiler output — x86 gcc 6.1 (g++ (DRW-internal-build) 6.1.0)
5 : error: field 'next_' has incomplete type 'std::atomic<State*> []'
std::atomic<State*> next_[];
^
In file included from
/tmp/gcc-explorer-compiler116621-82-1gzc8bu/example.cpp:1:0:
/opt/gcc-6.1.0/include/c++/6.1.0/atomic:165:12: note: declaration of 'struct
std::atomic<State*>'

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]