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.
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...
--- /dev/null
+// 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