[Bug c++/91678] [9 Regression] decltype returns wrong type under certain conditions

2021-01-05 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #14 from Marek Polacek  ---
Fixed.

[Bug c++/91678] [9 Regression] decltype returns wrong type under certain conditions

2020-03-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|9.3 |9.4

--- Comment #13 from Jakub Jelinek  ---
GCC 9.3.0 has been released, adjusting target milestone.

[Bug c++/91678] [9 Regression] decltype returns wrong type under certain conditions

2020-03-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

--- Comment #12 from Marek Polacek  ---
It depends on r10-3735-gcb57504a550158913258e5be8ddb991376475efb :/

So, we'd have to play some games with unwrapping the NON_LVALUE_EXPR.

[Bug c++/91678] [9 Regression] decltype returns wrong type under certain conditions

2020-03-04 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

--- Comment #11 from Jason Merrill  ---
(In reply to Marek Polacek from comment #10)
> Don't know if I should pursue this backport.

Seems like it depends on other fixes, not sure how hard they will be to find. 
Your call.

[Bug c++/91678] [9 Regression] decltype returns wrong type under certain conditions

2020-03-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

--- Comment #10 from Marek Polacek  ---
With this patch GCC 9 ICEs on:

$ ./cc1plus -quiet pr87768.C -std=gnu++2a -fconcepts
pr87768.C: In instantiation of ‘constexpr const bool c::f’:
pr87768.C:14:29:   required from here
pr87768.C:9:29: internal compiler error: in tsubst_copy, at cp/pt.c:15833
9 |   requires requires(d e) { e[0]; }
  |~^
0xaaad12 tsubst_copy
/home/mpolacek/src/gcc9/gcc/cp/pt.c:15833
0xac0b50 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/mpolacek/src/gcc9/gcc/cp/pt.c:19709
0xaba51d tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/mpolacek/src/gcc9/gcc/cp/pt.c:18434
0xab8707 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/mpolacek/src/gcc9/gcc/cp/pt.c:17969
0x8c892b satisfy_expression_constraint
/home/mpolacek/src/gcc9/gcc/cp/constraint.cc:2070
0x8c92ff satisfy_constraint_1
/home/mpolacek/src/gcc9/gcc/cp/constraint.cc:2242
0x8c90c9 satisfy_parameterized_constraint
/home/mpolacek/src/gcc9/gcc/cp/constraint.cc:2185
0x8c9388 satisfy_constraint_1
/home/mpolacek/src/gcc9/gcc/cp/constraint.cc:2257
0x8c944d satisfy_constraint
/home/mpolacek/src/gcc9/gcc/cp/constraint.cc:2294
0x8c9511 satisfy_associated_constraints
/home/mpolacek/src/gcc9/gcc/cp/constraint.cc:2318
0x8c97ed constraints_satisfied_p(tree_node*)
/home/mpolacek/src/gcc9/gcc/cp/constraint.cc:2393
0x8454e3 add_function_candidate
/home/mpolacek/src/gcc9/gcc/cp/call.c:
0x851d96 add_candidates
/home/mpolacek/src/gcc9/gcc/cp/call.c:5754
0x84d828 build_op_call_1
/home/mpolacek/src/gcc9/gcc/cp/call.c:4712
0x84e172 build_op_call(tree_node*, vec**, int)
/home/mpolacek/src/gcc9/gcc/cp/call.c:4808
0xb0e895 finish_call_expr(tree_node*, vec**, bool,
bool, int)
/home/mpolacek/src/gcc9/gcc/cp/semantics.c:2602
0xabdd43 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/mpolacek/src/gcc9/gcc/cp/pt.c:19195
0xab8707 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/mpolacek/src/gcc9/gcc/cp/pt.c:17969
0xaa9801 tsubst_init
/home/mpolacek/src/gcc9/gcc/cp/pt.c:15527
0xad2f31 regenerate_decl_from_template
/home/mpolacek/src/gcc9/gcc/cp/pt.c:24262

because tsubst_copy/NON_LVALUE_EXPR gets
NON_LVALUE_EXPR (e)>

Don't know if I should pursue this backport.

[Bug c++/91678] [9 Regression] decltype returns wrong type under certain conditions

2020-03-02 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

--- Comment #9 from Marek Polacek  ---
I'm not sure yet -- I remember issues I'd seen with the patch, but those issues
were somehow resolved, so the maybe_lvalue_p bit was all that was needed on
trunk.  I need to do a regtest/bootstrap on 9 to see if there's anything broken
by this change.  If not, then this should be fine to backport.

[Bug c++/91678] [9 Regression] decltype returns wrong type under certain conditions

2020-03-02 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

Jason Merrill  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #8 from Jason Merrill  ---
Marek, is this backportable for 9.3?

[Bug c++/91678] [9 Regression] decltype returns wrong type under certain conditions

2019-12-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

Marek Polacek  changed:

   What|Removed |Added

Summary|[9/10 Regression] decltype  |[9 Regression] decltype
   |returns wrong type under|returns wrong type under
   |certain conditions  |certain conditions

--- Comment #7 from Marek Polacek  ---
(In reply to Marek Polacek from comment #5)
> It doesn't seem to fix Comment 4 though, will have to look why :/.

This patch actually fixed that, too:
$ ./cc1plus -quiet 91678.C
$