Commit 9c7de5c6 by Jason Merrill Committed by Jason Merrill

re PR c++/53839 ([C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391)

	PR c++/53839
	* semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
	address, make sure the value is constant.

From-SVN: r191263
parent afcf5b8e
2012-09-13 Jason Merrill <jason@redhat.com> 2012-09-13 Jason Merrill <jason@redhat.com>
PR c++/53839
* semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
address, make sure the value is constant.
PR c++/54511 PR c++/54511
* pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P. * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
......
...@@ -7474,7 +7474,11 @@ cxx_eval_indirect_ref (const constexpr_call *call, tree t, ...@@ -7474,7 +7474,11 @@ cxx_eval_indirect_ref (const constexpr_call *call, tree t,
} }
if (r == NULL_TREE) if (r == NULL_TREE)
return t; {
if (!addr)
VERIFY_CONSTANT (t);
return t;
}
return r; return r;
} }
......
2012-09-13 Jason Merrill <jason@redhat.com> 2012-09-13 Jason Merrill <jason@redhat.com>
PR c++/53839
* g++.dg/cpp0x/constexpr-temp1.C: New.
PR c++/54511 PR c++/54511
* g++.dg/template/anonunion2.C: New. * g++.dg/template/anonunion2.C: New.
......
// { dg-do compile { target c++11 } }
struct A { int i; };
constexpr A f2 (const A& a) { return a; }
constexpr int f1 (const A &a) { return f2(a).i; }
A g(const A &a)
{
return { f1(a) };
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment