aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-01-16 10:23:19 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-01-16 10:23:19 -0500
commitd1c05c88b5a11412e87a024d7cff3c56bb1475a5 (patch)
tree572cb4b5c52eda131d1d51fb619a47e08ed42616 /gcc/cp
parenta6918ffd390f28fbe74abc82aae3c0aa89def495 (diff)
downloadgcc-d1c05c88b5a11412e87a024d7cff3c56bb1475a5.zip
gcc-d1c05c88b5a11412e87a024d7cff3c56bb1475a5.tar.gz
gcc-d1c05c88b5a11412e87a024d7cff3c56bb1475a5.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9f73d86..0830727 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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):
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index b2f9fd3..fa3ecda 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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);