Commit 5806f771 by Jason Merrill Committed by Jason Merrill

re PR c++/58636 (ICE with initializer_list and rvalue references)

	PR c++/58636
	* call.c (build_list_conv): Don't try to build a list of references.

From-SVN: r212503
parent 2010baed
2014-07-13 Jason Merrill <jason@redhat.com>
PR c++/58636
* call.c (build_list_conv): Don't try to build a list of references.
2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net>
PR C++/60209 - Declaration of user-defined literal operator cause error
......
......@@ -806,6 +806,12 @@ build_list_conv (tree type, tree ctor, int flags, tsubst_flags_t complain)
/* But no narrowing conversions. */
flags |= LOOKUP_NO_NARROWING;
/* Can't make an array of these types. */
if (TREE_CODE (elttype) == REFERENCE_TYPE
|| TREE_CODE (elttype) == FUNCTION_TYPE
|| VOID_TYPE_P (elttype))
return NULL;
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (ctor), i, val)
{
conversion *sub
......
// PR c++/58636
// { dg-do compile { target c++11 } }
#include <initializer_list>
// { dg-error "pointer to reference" "" { target *-*-* } 0 }
int foo(std::initializer_list<int&&>);
int i = foo({ 0 }); // { dg-error "std::initializer_list" }
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