Skip to content
Snippets Groups Projects
Commit 2801a49d authored by Marek Polacek's avatar Marek Polacek
Browse files

c++: mutable temps in rodata [PR116369]

Here we wrongly mark the reference temporary for g TREE_READONLY,
so it's put in .rodata and so we can't modify its subobject even
when the subobject is marked mutable.  This is so since r9-869.
r14-1785 fixed a similar problem, but not in set_up_extended_ref_temp.

	PR c++/116369

gcc/cp/ChangeLog:

	* call.cc (set_up_extended_ref_temp): Don't mark a temporary
	TREE_READONLY if its type is TYPE_HAS_MUTABLE_P.

gcc/testsuite/ChangeLog:

	* g++.dg/tree-ssa/initlist-opt7.C: New test.
parent e783a4a6
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment