Commit 8d42565b by Jason Merrill Committed by Jason Merrill

* init.c (build_new_1): Don't strip quals from type.

From-SVN: r38291
parent fab09a24
2000-12-15 Jason Merrill <jason@redhat.com> 2000-12-15 Jason Merrill <jason@redhat.com>
* init.c (build_new_1): Don't strip quals from type.
* decl.c (pushdecl): Don't check for linkage on a non-decl. * decl.c (pushdecl): Don't check for linkage on a non-decl.
* call.c (build_op_delete_call): See through ARRAY_TYPEs. * call.c (build_op_delete_call): See through ARRAY_TYPEs.
......
...@@ -2268,9 +2268,6 @@ build_new_1 (exp) ...@@ -2268,9 +2268,6 @@ build_new_1 (exp)
code = has_array ? VEC_NEW_EXPR : NEW_EXPR; code = has_array ? VEC_NEW_EXPR : NEW_EXPR;
if (CP_TYPE_QUALS (type))
type = TYPE_MAIN_VARIANT (type);
/* If our base type is an array, then make sure we know how many elements /* If our base type is an array, then make sure we know how many elements
it has. */ it has. */
while (TREE_CODE (true_type) == ARRAY_TYPE) while (TREE_CODE (true_type) == ARRAY_TYPE)
......
// Test that const-correctness is observed when using new.
struct A {
A() { }
int f () { return 1; }
int f () const { return 0; }
};
int main ()
{
return (new const A)->f ();
}
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