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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Actually, I see that 5.1 accepts the code in C++ 98 mode but rejects it in C++
11 mode.  Clang behaves the same way.  Probably due to a change to the
standard.

In hindsight I agree that the test case is invalid.  I even made that point
recently in a review of a patch submitted to make it valid (forgetting I had
previously raised this bug):
https://gcc.gnu.org/ml/gcc-patches/2016-01/msg00055.html

Unfortunately, there is a bug here that makes GCC accept the following
(equivalent and also invalid) code:

cat x.cpp && ~/bin/gcc-5.1.0/bin/g++ x.cpp -c -std=c++11
template <class T>
struct A {
    int n;
    T a[];
    A (): n (), a () { }
};

struct B { B (int); };

A<B> ab;

A few days ago I submitted bug 69127 for a similar problem with zero-length
arrays.  I suppose that bug could be used to fix this problem as well, even
though it's about flexible array members.

Let me close this bug as INVALID.

Reply via email to