re PR c++/92414 (internal compiler error: tree check: expected constructor, have error_mark in cxx_eval_store_expression, at cp/constexpr.c:4009)
PR c++/92414 * constexpr.c (cxx_eval_outermost_constant_expr): If DECL_INITIAL on object is erroneous, return t without trying to evaluate a constexpr dtor. * g++.dg/cpp2a/constexpr-dtor4.C: New test. From-SVN: r278468
This commit is contained in:
parent
8d5d90878e
commit
fce6467b1e
@ -1,3 +1,10 @@
|
|||||||
|
2019-11-19 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/92414
|
||||||
|
* constexpr.c (cxx_eval_outermost_constant_expr): If DECL_INITIAL
|
||||||
|
on object is erroneous, return t without trying to evaluate
|
||||||
|
a constexpr dtor.
|
||||||
|
|
||||||
2019-11-12 Jason Merrill <jason@redhat.com>
|
2019-11-12 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
* call.c (same_fn_or_template): Change to cand_parms_match.
|
* call.c (same_fn_or_template): Change to cand_parms_match.
|
||||||
|
@ -5834,6 +5834,8 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
|
|||||||
gcc_assert (object && VAR_P (object));
|
gcc_assert (object && VAR_P (object));
|
||||||
gcc_assert (DECL_DECLARED_CONSTEXPR_P (object));
|
gcc_assert (DECL_DECLARED_CONSTEXPR_P (object));
|
||||||
gcc_assert (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (object));
|
gcc_assert (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (object));
|
||||||
|
if (error_operand_p (DECL_INITIAL (object)))
|
||||||
|
return t;
|
||||||
ctx.ctor = unshare_expr (DECL_INITIAL (object));
|
ctx.ctor = unshare_expr (DECL_INITIAL (object));
|
||||||
TREE_READONLY (ctx.ctor) = false;
|
TREE_READONLY (ctx.ctor) = false;
|
||||||
/* Temporarily force decl_really_constant_value to return false
|
/* Temporarily force decl_really_constant_value to return false
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
|
2019-11-19 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/92414
|
||||||
|
* g++.dg/cpp2a/constexpr-dtor4.C: New test.
|
||||||
|
|
||||||
2019-11-19 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
|
2019-11-19 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
|
||||||
|
|
||||||
* gcc.target/mips/msa-ds.c: New test.
|
* gcc.target/mips/msa-ds.c: New test.
|
||||||
|
|
||||||
2019-11-19 Richard Sandiford <richard.sandiford@arm.com>
|
2019-11-19 Richard Sandiford <richard.sandiford@arm.com>
|
||||||
gcc/
|
|
||||||
Revert:
|
Revert:
|
||||||
2019-11-18 Richard Sandiford <richard.sandiford@arm.com>
|
2019-11-18 Richard Sandiford <richard.sandiford@arm.com>
|
||||||
|
|
||||||
|
15
gcc/testsuite/g++.dg/cpp2a/constexpr-dtor4.C
Normal file
15
gcc/testsuite/g++.dg/cpp2a/constexpr-dtor4.C
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// PR c++/92414
|
||||||
|
// { dg-do compile { target c++2a } }
|
||||||
|
|
||||||
|
struct A { virtual void foo (); };
|
||||||
|
|
||||||
|
struct B : A {
|
||||||
|
constexpr B (int); // { dg-warning "used but never defined" }
|
||||||
|
constexpr ~B () { }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct D : B {
|
||||||
|
constexpr D () : B (42) { } // { dg-error "used before its definition" }
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr D d; // { dg-message "in 'constexpr' expansion of" }
|
Loading…
Reference in New Issue
Block a user