diff options
Diffstat (limited to 'gcc/cp/semantics.cc')
-rw-r--r-- | gcc/cp/semantics.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 28baf7b..b57547c 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -3605,11 +3605,13 @@ finish_this_expr (void) { tree result = NULL_TREE; - if (current_class_type && LAMBDA_TYPE_P (current_class_type)) + if (current_class_ref && !LAMBDA_TYPE_P (TREE_TYPE (current_class_ref))) + result = current_class_ptr; + else if (current_class_type && LAMBDA_TYPE_P (current_class_type)) result = (lambda_expr_this_capture (CLASSTYPE_LAMBDA_EXPR (current_class_type), /*add*/true)); - else if (current_class_ptr) - result = current_class_ptr; + else + gcc_checking_assert (!current_class_ptr); if (result) /* The keyword 'this' is a prvalue expression. */ |