Commit 24991604 by Jason Merrill Committed by Jason Merrill

re PR c++/60708 (An array temporary causes an ICE in gimplify)

	PR c++/60708
	* call.c (build_array_conv): Call complete_type.

From-SVN: r208996
parent dd5593fc
2014-04-01 Jason Merrill <jason@redhat.com> 2014-04-01 Jason Merrill <jason@redhat.com>
PR c++/60708
* call.c (build_array_conv): Call complete_type.
PR c++/60713 PR c++/60713
* typeck2.c (PICFLAG_SIDE_EFFECTS): New. * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
(picflag_from_initializer): Return it. (picflag_from_initializer): Return it.
......
...@@ -948,6 +948,9 @@ build_array_conv (tree type, tree ctor, int flags, tsubst_flags_t complain) ...@@ -948,6 +948,9 @@ build_array_conv (tree type, tree ctor, int flags, tsubst_flags_t complain)
bool user = false; bool user = false;
enum conversion_rank rank = cr_exact; enum conversion_rank rank = cr_exact;
/* We might need to propagate the size from the element to the array. */
complete_type (type);
if (TYPE_DOMAIN (type) if (TYPE_DOMAIN (type)
&& !variably_modified_type_p (TYPE_DOMAIN (type), NULL_TREE)) && !variably_modified_type_p (TYPE_DOMAIN (type), NULL_TREE))
{ {
......
// PR c++/60708
// { dg-do compile { target c++11 } }
template <class T, class U> struct mypair {
mypair(T, U) {}
};
template<typename T> struct S {
mypair<T *, int> get_pair() noexcept {
return mypair<T*,int>(nullptr, 0);
}
};
static void foo(const mypair<char *, int> (&a)[2]) noexcept { }
int main()
{
S<char> s;
foo({s.get_pair(), s.get_pair()});
}
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