This is the mail archive of the gcc-patches@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]

Re: [v3] annex D 8 and 9 for C++0x


> > Do we really need to warn about auto_ptr<>?
> 
> That's the one part of the plan that bothers me too.  I have lots of
> code using auto_ptr in perfectly correct ways, frequently in public
> interfaces.  I'll move to using C++0x, but don't want to have to
> re-write a lot of code to use unique_ptr when auto_ptr works OK.  If I
> use -Wno-deprecated to silence warnings about auto_ptr then I don't
> get warnings if someone sneaks an ostrstream into the codebase.

Ah. Well, in this case, you could use -Wno-deprecated-declarations to
get rid of just the auto_ptr and binder deprecation warnings.

> I'm concerned that there's no easy transition.  I can't use
> std::unique_ptr in c++98 mode, and can't use template aliases for
> std::tr1::unique_ptr there either, and I can't use std::auto_ptr in
> c++0x mode without disabling the warnings.

I believe you can, as above. Summarized as:

-Wno-deprecated, no deprecated warnings of any kind

-Wno-deprecated-declarations, no warnings for __attribute__ deprecated.

Thanks, figuring out how to flag this stuff was question 2 in the "Still
needed" section of my original email...

;)

> But since my objections to deprecating auto_ptr didn't sway my
> national body and it's going to Annex D, I guess it's right for
> libstdc++ to warn about auto_ptr.

Thanks. This is what I think too.

-benjamin


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