Commit 23f4e590 by Jason Merrill Committed by Jason Merrill

PR c++/56701 - wrong type of &*this

	* typeck.c (cp_build_addr_expr_1): Remove special *this handling.

From-SVN: r239285
parent b87060ce
2016-08-09 Jason Merrill <jason@redhat.com>
PR c++/56701
* typeck.c (cp_build_addr_expr_1): Remove special *this handling.
2016-08-09 Jakub Jelinek <jakub@redhat.com> 2016-08-09 Jakub Jelinek <jakub@redhat.com>
PR c++/72809 PR c++/72809
......
...@@ -5626,11 +5626,6 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain) ...@@ -5626,11 +5626,6 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain)
/* Let &* cancel out to simplify resulting code. */ /* Let &* cancel out to simplify resulting code. */
if (INDIRECT_REF_P (arg)) if (INDIRECT_REF_P (arg))
{ {
/* We don't need to have `current_class_ptr' wrapped in a
NON_LVALUE_EXPR node. */
if (arg == current_class_ref)
return current_class_ptr;
arg = TREE_OPERAND (arg, 0); arg = TREE_OPERAND (arg, 0);
if (TREE_CODE (TREE_TYPE (arg)) == REFERENCE_TYPE) if (TREE_CODE (TREE_TYPE (arg)) == REFERENCE_TYPE)
{ {
......
// PR c++/56701
// { dg-do compile { target c++11 } }
struct A
{
void f(){ A*&& a = &*this; }
};
int main(){}
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