2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2024-12-29 10:55:25 +08:00

re PR c++/3331 (member pointer inherits const)

* tree.c (build1): Don't set TREE_READONLY on INDIRECT_REF.
        PR c++/3331
        * cp/init.c (resolve_offset_ref): Use build_indirect_ref.

From-SVN: r49132
This commit is contained in:
Jason Merrill 2002-01-23 07:44:45 -05:00 committed by Jason Merrill
parent b21155754f
commit f893c16eea
4 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,7 @@
2002-01-23 Jason Merrill <jason@redhat.com>
* tree.c (build1): Don't set TREE_READONLY on INDIRECT_REF.
* function.c (assign_parms): Don't put args of inline functions
into registers when not optimizing.

View File

@ -1,7 +1,12 @@
2002-01-22 Jason Merrill <jason@redhat.com>
2002-01-23 Jason Merrill <jason@redhat.com>
PR c++/3331
* init.c (resolve_offset_ref): Use build_indirect_ref.
* decl2.c (grokclassfn): Don't set DECL_REGISTER on 'this'.
2002-01-22 Jason Merrill <jason@redhat.com>
* parse.y (function_body): Suppress the block for the outermost
curly braces.
* decl.c (pushdecl): Don't try to skip it.

View File

@ -1880,9 +1880,8 @@ resolve_offset_ref (exp)
member = cp_convert (ptrdiff_type_node, member);
return build1 (INDIRECT_REF, type,
build (PLUS_EXPR, build_pointer_type (type),
addr, member));
addr = build (PLUS_EXPR, build_pointer_type (type), addr, member);
return build_indirect_ref (addr, 0);
}
else if (TYPE_PTRMEMFUNC_P (TREE_TYPE (member)))
{

View File

@ -2507,6 +2507,12 @@ build1 (code, type, node)
TREE_READONLY (t) = 0;
break;
case INDIRECT_REF:
/* Whether a dereference is readonly has nothing to do with whether
its operand is readonly. */
TREE_READONLY (t) = 0;
break;
default:
if (TREE_CODE_CLASS (code) == '1' && node && TREE_CONSTANT (node))
TREE_CONSTANT (t) = 1;