Commit d1c05c88 by Jason Merrill Committed by Jason Merrill

re PR c++/42761 (std::bind doesn't work for simple class types)

	PR c++/42761
	* semantics.c (finish_decltype_type): Within a template, treat
	unresolved CALL_EXPR as dependent.

From-SVN: r155966
parent a6918ffd
2010-01-16 Jason Merrill <jason@redhat.com>
PR c++/42761
* semantics.c (finish_decltype_type): Within a template, treat
unresolved CALL_EXPR as dependent.
2010-01-15 Dodji Seketeli <dodji@redhat.com>
* error.c (dump_template_parms,count_non_default_template_args):
......
......@@ -4803,6 +4803,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
if (type && !type_uses_auto (type))
return type;
treat_as_dependent:
type = cxx_make_type (DECLTYPE_TYPE);
DECLTYPE_TYPE_EXPR (type) = expr;
DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (type)
......@@ -4930,6 +4931,11 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
&& (TREE_CODE (TREE_TYPE (target_type)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (target_type)) == METHOD_TYPE))
type = TREE_TYPE (TREE_TYPE (target_type));
else if (processing_template_decl)
/* Within a template finish_call_expr doesn't resolve
CALL_EXPR_FN, so even though this decltype isn't really
dependent let's defer resolving it. */
goto treat_as_dependent;
else
sorry ("unable to determine the declared type of expression %<%E%>",
expr);
......
2010-01-15 Jason Merrill <jason@redhat.com>
PR c++/42761
* g++.dg/cpp0x/decltype22.C: New.
2010-01-16 Jakub Jelinek <jakub@redhat.com>
PR middle-end/42760
......
// PR c++/42761
// { dg-options "-std=c++0x" }
template<typename _Tp> _Tp* fn();
template <class T> struct A
{
template <class U,
class S = decltype(fn<T>())>
struct B { };
};
A<int> a;
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