re PR c++/79797 (ICE with NSDMI, this pointer and constexpr)
PR c++/79797 * constexpr.c (lookup_placeholder): Tweak. From-SVN: r246210
This commit is contained in:
parent
207f34233c
commit
fbd603c43d
@ -1,3 +1,8 @@
|
||||
2017-03-16 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/79797
|
||||
* constexpr.c (lookup_placeholder): Tweak.
|
||||
|
||||
2017-03-15 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/80043 - ICE with -fpermissive
|
||||
|
@ -3832,14 +3832,17 @@ cxx_eval_switch_expr (const constexpr_ctx *ctx, tree t,
|
||||
static tree
|
||||
lookup_placeholder (const constexpr_ctx *ctx, bool lval, tree type)
|
||||
{
|
||||
if (!ctx || !ctx->ctor || (lval && !ctx->object))
|
||||
if (!ctx)
|
||||
return NULL_TREE;
|
||||
|
||||
/* We could use ctx->object unconditionally, but using ctx->ctor when we
|
||||
can is a minor optimization. */
|
||||
if (!lval && same_type_p (TREE_TYPE (ctx->ctor), type))
|
||||
if (!lval && ctx->ctor && same_type_p (TREE_TYPE (ctx->ctor), type))
|
||||
return ctx->ctor;
|
||||
|
||||
if (!ctx->object)
|
||||
return NULL_TREE;
|
||||
|
||||
/* Since an object cannot have a field of its own type, we can search outward
|
||||
from ctx->object to find the unique containing object of TYPE. */
|
||||
tree ob = ctx->object;
|
||||
|
Loading…
Reference in New Issue
Block a user