Commit 6dab6cf1 by Jason Merrill Committed by Jason Merrill

re PR c++/48452 ([C++0x][SFINAE] Failures with n-ary initialization expressions (in return type))

	PR c++/48452
	* typeck.c (build_x_compound_expr_from_list): Return error_mark_node
	in SFINAE context.

From-SVN: r172147
parent b46c79a1
2011-04-07 Jason Merrill <jason@redhat.com>
PR c++/48452
* typeck.c (build_x_compound_expr_from_list): Return error_mark_node
in SFINAE context.
PR c++/48450
* call.c (resolve_args): Take complain.
(build_new_function_call, build_operator_new_call): Pass it.
......
......@@ -5472,6 +5472,8 @@ build_x_compound_expr_from_list (tree list, expr_list_kind exp,
default:
gcc_unreachable ();
}
else
return error_mark_node;
for (list = TREE_CHAIN (list); list; list = TREE_CHAIN (list))
expr = build_x_compound_expr (expr, TREE_VALUE (list),
......
2011-04-07 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/sfinae10.C: New.
* g++.dg/cpp0x/sfinae9.C: New.
* c-c++-common/Wcast-qual-1.c: Move here from...
......
// PR c++/48452
// { dg-options -std=c++0x }
namespace std {
template <class T> T&& declval();
}
template<class T, class... Args>
decltype(T(std::declval<Args>()...), char()) f(int);
template<class, class...>
char (&f(...))[2];
struct A { virtual ~A() = 0; };
struct B {};
static_assert(sizeof(f<A, int, int>(0)) != 1, "Error"); // a
static_assert(sizeof(f<B, void, int>(0)) != 1, "Error"); // b
static_assert(sizeof(f<void, int, int>(0)) != 1, "Error"); // c
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