[Bug c++/89381] [7/8/9 Regression] Implicit copy constructor cannot be generated after unrelated class definition

2019-03-06 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89381

--- Comment #2 from Jason Merrill  ---
Author: jason
Date: Wed Mar  6 20:28:47 2019
New Revision: 269442

URL: https://gcc.gnu.org/viewcvs?rev=269442=gcc=rev
Log:
PR c++/89381 - implicit copy and using-declaration.

Here the used base::operator= gets into the list of foo's bindings for
operator=, but it shouldn't make the copy ctor deleted.

* class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
op= brought in by a using-declaration.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/implicit16.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c

[Bug c++/89381] [7/8/9 Regression] Implicit copy constructor cannot be generated after unrelated class definition

2019-03-06 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89381

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/89381] [7/8/9 Regression] Implicit copy constructor cannot be generated after unrelated class definition

2019-02-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89381

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |7.5

[Bug c++/89381] [7/8/9 Regression] Implicit copy constructor cannot be generated after unrelated class definition

2019-02-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89381

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to work||5.5.0
   Keywords|diagnostic, needs-reduction |
   Last reconfirmed||2019-02-18
 CC||jason at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|Implicit copy constructor   |[7/8/9 Regression] Implicit
   |cannot be generated after   |copy constructor cannot be
   |unrelated class definition  |generated after unrelated
   ||class definition
  Known to fail||6.4.0, 7.3.0, 8.2.0, 9.0

--- Comment #1 from Jonathan Wakely  ---
Reduced:

template
struct base
{
  base() { }
  base(const base&) { }
  base(base&&) { }
  base& operator=(const base&) { return *this; }
  base& operator=(base&&) { return *this; }
};

struct foo : base
{
using base::base;
using base::operator=;
};

//using workaround = decltype(foo{*static_cast(0)});

struct bar
{
bar& operator=(foo ve)
{
value = ve;
return *this;
}

foo value;
};

int main()
{
foo a;
foo b{a};
}


Regressed with r235002

PR c++/70528

* class.c (type_has_constexpr_default_constructor): Return true
for an implicitly declared constructor.