This is the mail archive of the gcc-patches@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]

Re: C++ PATCH: PR 20103


Hi Mark,

as no good deed goes unpunished, there's some fallout from your patch
for PR c++/20103. The testcase g++.dg/ext/complit1.C now ICEs
(although the testcase still passes, grumble):

====================================================
// PR c++/11063
// { dg-options "" }

class Foo
{
private:
  const int val_[2];

public:
  Foo(int, int);
};

Foo::Foo(int v0, int v1)
  : val_((int[]) {v0, v1})  // { dg-error "" "" }
{
}
====================================================

complit1.C: In constructor 'Foo::Foo(int, int)':
complit1.C:14: error: ISO C++ forbids assignment of arrays
complit1.C: In constructor 'Foo::Foo(int, int)':
complit1.C:14: internal compiler error: in emit_move_insn, at expr.c:3275
Please submit a full bug report, [etc.]

Would you mind having a look?

Btw, the code is rejected with or without -fpermissive on the 4.1 branch.
If I change the cast in the constructor from (int[]) to (const int[])
the testcase is accepted even without -fpermissive.

On mainline the code is now rejected (before we hit the ICE), but with
-fpermissive it is accepted (before we hit the ICE) regardless which
version of the constructor is chosen.

Is this intended?
Maybe we also need some more tests to cover all these situations.

Regards,
Volker



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