[Bug c++/89158] [8/9 Regression] by-value capture of ICE variable isn't an lvalue?

2019-02-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89158

--- Comment #6 from Marek Polacek  ---
Author: mpolacek
Date: Tue Feb  5 21:30:51 2019
New Revision: 268561

URL: https://gcc.gnu.org/viewcvs?rev=268561=gcc=rev
Log:
PR c++/89158 - by-value capture of constexpr variable broken.
* call.c (convert_like_real) : Call mark_exp_read
instead of mark_rvalue_use.

* g++.dg/cpp0x/lambda/lambda-89158.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-89158.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/89158] [8/9 Regression] by-value capture of ICE variable isn't an lvalue?

2019-02-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89158

Marek Polacek  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #5 from Marek Polacek  ---
https://gcc.gnu.org/ml/gcc-patches/2019-02/msg00214.html

[Bug c++/89158] [8/9 Regression] by-value capture of ICE variable isn't an lvalue?

2019-02-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89158

Marek Polacek  changed:

   What|Removed |Added

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

[Bug c++/89158] [8/9 Regression] by-value capture of ICE variable isn't an lvalue?

2019-02-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89158

--- Comment #4 from Marek Polacek  ---
Looks like using mark_lvalue_use instead works.

[Bug c++/89158] [8/9 Regression] by-value capture of ICE variable isn't an lvalue?

2019-02-02 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89158

--- Comment #3 from Marek Polacek  ---
When reference_binding creates the conversion const int -> const int & the
expression is still VIEW_CONVERT_EXPR(Val) so it doesn't set
conv->need_temporary_p.  Only then do we call mark_rvalue_use which turns it
into NON_LVALUE_EXPR<42>.

[Bug c++/89158] [8/9 Regression] by-value capture of ICE variable isn't an lvalue?

2019-02-02 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89158

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek  ---
From a quick look it seems we haven't properly set need_temporary_p when
converting NON_LVALUE_EXPR<42> to const int &.  Then taking the address of 42
breaks.

[Bug c++/89158] [8/9 Regression] by-value capture of ICE variable isn't an lvalue?

2019-02-02 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89158

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P2
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-02-02
 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
   Target Milestone|--- |8.3
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r261121.  clang as well as icpc accept it.