[PATCH] Disable -Wctor-dtor-privacy warnings for some standard types
Daniel Krügler
daniel.kruegler@gmail.com
Sat Jun 15 12:14:00 GMT 2019
Am Sa., 15. Juni 2019 um 12:52 Uhr schrieb Daniel Krügler
<daniel.kruegler@gmail.com>:
>
> Am Fr., 14. Juni 2019 um 16:05 Uhr schrieb Jonathan Wakely <jwakely@redhat.com>:
> >
> > These types are not constructible by design, so we never want warnings
> > for them, even with -Wsystem-headers.
> >
> > * include/experimental/type_traits (experimental::nonesuch): Use
> > pragma to disable -Wctor-dtor-privacy warnings.
> > * include/std/type_traits (__is_convertible_helper<From, To, false>)
> > (__is_nt_convertible_helper<From, To, false>, __nonesuch): Likewise.
> >
> > Tested x86_64-linux, committed to trunk.
>
> Unless I'm misunderstanding something, __nonesuchbase (twice) would
> not be affected by that warning, so maybe the start of the
> corresponding warning suppression could be moved after their
> definition? Or did you do it that way to keep __nonesuchbase and
> nonesuch close together?
Jonathan is momentarily not able to respond to this list using proper
email format, but he responded to me in private as follows:
"I did do that to keep them together, rather than introducing white
space between the base and the class using it. I even considered
putting the pragmas around the whole file, but decided to add them
just locally where needed.
I don't mind moving the base struct out of the pragma if you or
anybody else feels strongly, but thought it didn't do any harm this
way."
Personally I don't feel strongly about it - Thanks for the explanation!
- Daniel
More information about the Libstdc++
mailing list