This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77375] [5/6/7 Regression] constant object with mutable subobject allocated in read-only memory
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Aug 2016 09:41:52 +0000
- Subject: [Bug c++/77375] [5/6/7 Regression] constant object with mutable subobject allocated in read-only memory
- Auto-submitted: auto-generated
- References: <bug-77375-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77375
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
Target Milestone|--- |5.5
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I guess the question is if CLASSTYPE_HAS_MUTABLE should be set on types derived
from CLASSTYPE_HAS_MUTABLE types (then cp_apply_type_quals_to_decl's
/* If the type has (or might have) a mutable component, that component
might be modified. */
if (TYPE_HAS_MUTABLE_P (type) || !COMPLETE_TYPE_P (type))
type_quals &= ~TYPE_QUAL_CONST;
would do its job), or if instead in this spot (and maybe various others) should
walk the bases and check for TYPE_HAS_MUTABLE_P.