+2010-07-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/44967
+ * pt.c (tsubst_copy_and_build): Handle partial substitution of
+ CALL_EXPR.
+
2010-07-19 Jason Merrill <jason@redhat.com>
PR c++/44996
}
}
+ if (processing_template_decl
+ && (type_dependent_expression_p (function)
+ || any_type_dependent_arguments_p (call_args)))
+ {
+ ret = build_nt_call_vec (function, call_args);
+ KOENIG_LOOKUP_P (ret) = koenig_p;
+ goto call_out;
+ }
+
/* We do not perform argument-dependent lookup if normal
lookup finds a non-function, in accordance with the
expected resolution of DR 218. */
|| TREE_CODE (function) == IDENTIFIER_NODE)
/* Only do this when substitution turns a dependent call
into a non-dependent call. */
- && type_dependent_expression_p_push (t)
- && !any_type_dependent_arguments_p (call_args))
+ && type_dependent_expression_p_push (t))
function = perform_koenig_lookup (function, call_args);
if (TREE_CODE (function) == IDENTIFIER_NODE)
{
unqualified_name_lookup_error (function);
- release_tree_vector (call_args);
- return error_mark_node;
+ ret = error_mark_node;
+ goto call_out;
}
/* Remember that there was a reference to this entity. */
koenig_p,
complain);
+ call_out:
release_tree_vector (call_args);
return ret;
+2010-07-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/44967
+ * g++.dg/cpp0x/sfinae2.C: New.
+
2010-07-20 Richard Guenther <rguenther@suse.de>
PR lto/42696
--- /dev/null
+// PR c++/44967
+// { dg-options -std=c++0x }
+
+template <typename T> T&& declval();
+
+template<typename T1, typename T2, typename... Args>
+struct has_construct
+{
+ typedef char one;
+ typedef struct {char _m[2]; } two;
+
+ template<typename U1, typename U2, typename... Args2>
+ static decltype(declval<U1>().construct(declval<U2*>(), declval<Args2>()...), one()) test(int);
+ template<typename, typename, typename...>
+ static two test(...);
+
+ static const bool value = sizeof(test<T1, T2, Args...>(0)) == 1;
+};
+
+
+struct A0
+{};
+
+struct A1
+{
+ void construct(int*, int);
+};
+
+template<typename _Tp>
+struct A2
+{
+ template<typename _Tp1, typename... _Args>
+ void construct(_Tp1*, _Args&&...) {}
+};
+
+#define SA(X) static_assert(X,#X)
+SA((!has_construct<A0, int, int>::value)); // ok
+SA((has_construct<A1, int, int>::value)); // bang
+SA((has_construct<A2<int>, int>::value)); // bang