On Wed, Mar 08, 2023 at 10:13:39AM +0000, Jonathan Wakely wrote: > On Wed, 8 Mar 2023 at 07:25, Richard Biener wrote: > > > > On Wed, 8 Mar 2023, Alexander Monakov wrote: > > > > > > > > On Tue, 7 Mar 2023, Jonathan Wakely wrote: > > > > > > > > Shouldn't this use the idiom suggested in ansidecl.h, i.e. > > > > > > > > > > private: > > > > > DISABLE_COPY_AND_ASSIGN (auto_mpfr); > > > > > > > > > > > > Why? A macro like that (or a base class like boost::noncopyable) has > > > > some value in a code base that wants to work for both C++03 and C++11 > > > > (or later). But in GCC we know we have C++11 now, so we can just > > > > delete members. I don't see what the macro adds. > > > > > > Evidently it's possible to forget to delete one of the members, as > > > showcased in this very thread. > > > > Yes. And I copy&pasted from somewhere I forgot which also forgot it ... > > Looks like gcc/gimple-predicate-analysis.h and gcc/timevar.h each have > two cases of a deleted copy constructor but no deleted assignment. > I'll send a patch for those.
So perhaps use the = delete decls and a standardized comment (same wording for all the auto_* types) above those which says what the above macro says? Then one can grep that comment etc. Jakub