This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/77375] [5/6/7 Regression] constant object with mutable subobject allocated in read-only memory


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]