Commit 3e475d30 by Jason Merrill Committed by Jason Merrill

re PR c++/48745 ([C++0x] Segmentation fault with list-initialization, void…

re PR c++/48745 ([C++0x] Segmentation fault with list-initialization, void initializers and variadics)

	PR c++/48745
	* pt.c (value_dependent_expr_p): Handle CONSTRUCTOR.

From-SVN: r173678
parent 0126595f
2011-05-11 Jason Merrill <jason@redhat.com>
PR c++/48745
* pt.c (value_dependent_expr_p): Handle CONSTRUCTOR.
2011-05-11 Nathan Froyd <froydnj@codesourcery.com>
* cp-tree.h (TYPENAME_TYPE_FULLNAME, TYPEOF_TYPE_EXPR): Use
......
......@@ -18273,6 +18273,16 @@ value_dependent_expression_p (tree expression)
type-dependent. */
return type_dependent_expression_p (expression);
case CONSTRUCTOR:
{
unsigned ix;
tree val;
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (expression), ix, val)
if (value_dependent_expression_p (val))
return true;
return false;
}
default:
/* A constant expression is value-dependent if any subexpression is
value-dependent. */
......
2011-05-11 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/sfinae22.C: New.
2011-05-11 Tobias Burnus <burnus@net-b.de>
PR fortran/48889
......
// PR c++/48745
// { dg-options -std=c++0x }
template<class T>
struct add_rval_ref {
typedef T&& type;
};
template<>
struct add_rval_ref<void> {
typedef void type;
};
template<class T>
typename add_rval_ref<T>::type create();
template<class T, class... Args>
decltype(T{create<Args>()...}, char()) f(int);
template<class, class...>
char (&f(...))[2];
static_assert(sizeof(f<int, void>(0)) != 1, "Error"); // #
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