aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-04-11 12:49:57 -0400
committerJason Merrill <jason@gcc.gnu.org>2013-04-11 12:49:57 -0400
commita2a5f18ea792acb01cf1ae24e94d9ad0daf3acca (patch)
treec00b873e05f47bbc82743c6005cf74237a6a257a /gcc/cp
parent7b55f98f5ceb209d2d77147e29ad49a84da5d36d (diff)
downloadgcc-a2a5f18ea792acb01cf1ae24e94d9ad0daf3acca.zip
gcc-a2a5f18ea792acb01cf1ae24e94d9ad0daf3acca.tar.gz
gcc-a2a5f18ea792acb01cf1ae24e94d9ad0daf3acca.tar.bz2
re PR c++/56901 (lambda with implicit capture by reference)
PR c++/56901 * semantics.c (lambda_capture_field_type, lambda_proxy_type): Strip references before checking WILDCARD_TYPE_P. From-SVN: r197819
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e6670b2..e2cf1b4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/56901
+ * semantics.c (lambda_capture_field_type, lambda_proxy_type):
+ Strip references before checking WILDCARD_TYPE_P.
+
2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (build_conditional_expr_1, build_over_call): Protect
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 3a558b0..0631833 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -9114,16 +9114,14 @@ lambda_function (tree lambda)
tree
lambda_capture_field_type (tree expr)
{
- tree type;
- if (!TREE_TYPE (expr) || WILDCARD_TYPE_P (TREE_TYPE (expr)))
+ tree type = non_reference (unlowered_expr_type (expr));
+ if (!type || WILDCARD_TYPE_P (type))
{
type = cxx_make_type (DECLTYPE_TYPE);
DECLTYPE_TYPE_EXPR (type) = expr;
DECLTYPE_FOR_LAMBDA_CAPTURE (type) = true;
SET_TYPE_STRUCTURAL_EQUALITY (type);
}
- else
- type = non_reference (unlowered_expr_type (expr));
return type;
}
@@ -9324,7 +9322,7 @@ lambda_proxy_type (tree ref)
if (REFERENCE_REF_P (ref))
ref = TREE_OPERAND (ref, 0);
type = TREE_TYPE (ref);
- if (type && !WILDCARD_TYPE_P (type))
+ if (type && !WILDCARD_TYPE_P (non_reference (type)))
return type;
type = cxx_make_type (DECLTYPE_TYPE);
DECLTYPE_TYPE_EXPR (type) = ref;