Bug ID: 84667
           Summary: unreasonable refusal to use assignment operator method
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot
          Reporter: estellnb at elstel dot org
  Target Milestone: ---

Created attachment 43542
sample program that evokes the given error

g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516:

At me g++ refuses to make use of the following operator
  xstrbuf& operator = ( base_str_const s );

Instead it seems to convert an xstr_const into an xstr_mutable which is
generally forbidden and not enabled by my code.

Things work well however if I use the standard constructor instead of an

  inline xstrbuf( base_str_const s ) : base_str(
const_cast<char_type*>(s.chars), s.length ) { bufParams = xstrbuf_constBuf; };  

It is important to get the "bufParams = xstrbuf_constBuf; " executed otherwise
the code will fail. You can test for it yourself by executing ./runit.

  Any feedback would be very appreciated!

Reply via email to