Commit 11f18e1d by Jason Merrill Committed by Jason Merrill

re PR c++/34180 (Default copy constructor copies const auto_ptr members)

	PR c++/34180
	* method.c (do_build_copy_constructor): Don't drop cv-quals from
	the field type.

From-SVN: r153960
parent 040ca4b3
2009-11-05 Jason Merrill <jason@redhat.com>
PR c++/34180
* method.c (do_build_copy_constructor): Don't drop cv-quals from
the field type.
PR c++/7046
* class.c (finish_struct): Store maximum_field_alignment in
TYPE_PRECISION.
......
......@@ -622,6 +622,7 @@ do_build_copy_constructor (tree fndecl)
if (DECL_MUTABLE_P (field))
quals &= ~TYPE_QUAL_CONST;
quals |= TYPE_QUALS (expr_type);
expr_type = cp_build_qualified_type (expr_type, quals);
}
......
2009-11-05 Jason Merrill <jason@redhat.com>
PR c++/34180
* g++.dg/init/synth2.C: New.
PR c++/7046
* g++.dg/abi/pragma-pack1.C: New.
......
// PR c++/34180
struct G {
G(); // { dg-message "" "candidate" }
G(G&); // { dg-message "" "candidate" }
};
class A
{ // { dg-error "no match" }
const G g;
};
int main()
{
A a;
A b = a; // { dg-message "required here" }
}
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