[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-12-13 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

Nathan Sidwell  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Nathan Sidwell  ---
Refixed trunk & gcc-8

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-12-13 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

--- Comment #12 from Nathan Sidwell  ---
Author: nathan
Date: Thu Dec 13 17:47:52 2018
New Revision: 267099

URL: https://gcc.gnu.org/viewcvs?rev=267099=gcc=rev
Log:
[PR c++/87531] Fix second bug

https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00929.html
PR c++/87531
* class.c (finish_struct): Set DECL_CONTEXT of template assign op.
* name-lookup.c (get_class_binding_direct): Don't strip using-decl
of overload here.
* parser.c (cp_parser_postfix_expression): Cope with using decl in
overload set.
* semantics.c (finish_id_expr): Likewise.

* g++.dg/lookup/pr87531-2.C: New.

Added:
branches/gcc-8-branch/gcc/testsuite/g++.dg/lookup/pr87531-2.C
Modified:
branches/gcc-8-branch/gcc/cp/ChangeLog
branches/gcc-8-branch/gcc/cp/class.c
branches/gcc-8-branch/gcc/cp/name-lookup.c
branches/gcc-8-branch/gcc/cp/parser.c
branches/gcc-8-branch/gcc/cp/semantics.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-12-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

Marek Polacek  changed:

   What|Removed |Added

 CC||s...@li-snyder.org

--- Comment #11 from Marek Polacek  ---
*** Bug 88485 has been marked as a duplicate of this bug. ***

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-12-13 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

--- Comment #10 from Nathan Sidwell  ---
Author: nathan
Date: Thu Dec 13 15:57:24 2018
New Revision: 267096

URL: https://gcc.gnu.org/viewcvs?rev=267096=gcc=rev
Log:
[PR c++/87531] Fix second bug

https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00929.html

PR c++/87531
* class.c (finish_struct): Set DECL_CONTEXT of template assign op.
* name-lookup.c (get_class_binding_direct): Don't strip using-decl
of overload here.
* parser.c (cp_parser_postfix_expression): Cope with using decl in
overload set.
* semantics.c (finish_id_expr): Likewise.

* g++.dg/lookup/pr87531-2.C: New.

Added:
trunk/gcc/testsuite/g++.dg/lookup/pr87531-2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c
trunk/gcc/cp/name-lookup.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-12-06 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

--- Comment #9 from Nathan Sidwell  ---
Created attachment 45169
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45169=edit
non operator= version

This turns out to be an orthogonal regression as shown by the new testcase.  We
fail to notice there are template definitions in the current class.

works in 7.x fails in 8.x & trunk

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-12-06 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

Nathan Sidwell  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #8 from Nathan Sidwell  ---
ew, yes that should work.

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-12-05 Thread petschy at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

petschy at gmail dot com changed:

   What|Removed |Added

 CC||petschy at gmail dot com

--- Comment #7 from petschy at gmail dot com ---
After this fix, the following code doesn't compile:

template
struct Ptr
{
Ptr& operator=(T* p_)
{
return operator=(p_);
}

template
Ptr& operator=(U* p_)
{
ptr = p_;
return *this;
}

T* ptr = nullptr;
};

$ g++-8.2.1 -Wall -std=c++11 -c 20181204-templated_opeq.cpp
20181204-templated_opeq.cpp: In member function ‘Foo&
Foo::operator=(T*)’:
20181204-templated_opeq.cpp:6:21: error: expected primary-expression before ‘>’
token
   return operator=(p_);
 ^

On the gcc-8-branch, the commit before the fix (a9a931e4) is OK. 7.3.1
(4c925b84) is OK. Tested on Debian Stretch, AMD64.

Is the above code invalid?

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-11-29 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

Nathan Sidwell  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Nathan Sidwell  ---
Fixed trunk & gcc-8.

Raised issue with CWG, for standardese, but I don't expect that to come back
with needing a change.

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-11-29 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

--- Comment #5 from Nathan Sidwell  ---
Author: nathan
Date: Thu Nov 29 12:50:45 2018
New Revision: 266614

URL: https://gcc.gnu.org/viewcvs?rev=266614=gcc=rev
Log:
[PR c++/87531] operator= lookup in templates

https://gcc.gnu.org/ml/gcc-patches/2018-11/msg02301.html
PR c++/87531
* class.c (finish_struct): In a template, add artificial using
decl for operator=.

* g++.dg/lookup/pr87531.C: New.

Added:
branches/gcc-8-branch/gcc/testsuite/g++.dg/lookup/pr87531.C
Modified:
branches/gcc-8-branch/gcc/cp/ChangeLog
branches/gcc-8-branch/gcc/cp/class.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-11-28 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

--- Comment #4 from Nathan Sidwell  ---
Author: nathan
Date: Wed Nov 28 21:25:06 2018
New Revision: 266590

URL: https://gcc.gnu.org/viewcvs?rev=266590=gcc=rev
Log:
[PR c++/87531] operator= lookup in templates

https://gcc.gnu.org/ml/gcc-patches/2018-11/msg02301.html
PR c++/87531
* class.c (finish_struct): In a template, add artificial using
decl for operator=.

* g++.dg/lookup/pr87531.C: New.

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

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-11-27 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

--- Comment #3 from Nathan Sidwell  ---
Created attachment 45102
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45102=edit
simpler example of original failure, other failure modes added

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-11-27 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

Nathan Sidwell  changed:

   What|Removed |Added

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

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-11-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

Jakub Jelinek  changed:

   What|Removed |Added

   Last reconfirmed|2018-10-08 00:00:00 |2018-11-27
 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Nathan, can you please have a look?  Isn't this somewhat similar to PR87989? 
Though, even current trunk still fails.

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-10-08 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-10-08
 CC||nathan at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
(In reply to Nikita Kniazev from comment #0)
> The regression appeared after 7.3.0 and not later than 8.1.0. I do not have
> 8.0.0 to test it.

Because there is no 8.0.0 release.

https://gcc.gnu.org/develop.html#num_scheme

The regression started with r255605

[PR C++/15272] lookups with ambiguating dependent base

https://gcc.gnu.org/ml/gcc-patches/2017-12/msg00766.html
PR c++/15272
* pt.c (tsubst_baselink): Don't repeat the lookup for
non-dependent baselinks.

PR c++/15272
* g++.dg/template/pr71826.C: Adjust for 15272 fix.

[Bug c++/87531] [8/9 Regression] assignment operator does nothing if performed as a call via operator=

2018-10-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87531

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
   Target Milestone|--- |8.3