[Bug c++/118631] Public class member as const reference to protected member

2025-01-23 Thread info--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118631 --- Comment #4 from Jörg Brüggmann --- Aha. Got it. Thank you!

[Bug c++/118631] Public class member as const reference to protected member

2025-01-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118631 --- Comment #3 from Andrew Pinski --- The copy constructor is needed because of: ``` StringSet operator + ( const StringSet& stringSetA, const StringSet& stringSetB ) { StringSet resultStringSet{ stringSetA }; resultStringSet.include(

[Bug c++/118631] Public class member as const reference to protected member

2025-01-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118631 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/118631] Public class member as const reference to protected member

2025-01-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118631 --- Comment #1 from Andrew Pinski --- Most likely you forgot a copy constructor. A default copy constructor will point the new msets to the old msets_ .