Resurrecting std::auto_ptr in GCC when compiling with -std=c++17

1.6k views Asked by At

Is there a macro or compiler flag that would let me keep using auto_ptr in GCC 7/8 with -std=c++17? I have easily found the corresponding macro for clang and MSVC, but my Google-fu is not good enough to find the solution for GCC.

I don't want to use -fpermissive (it would let me accidentally do too much stuff I shouldn't be able to do), need something more specific.

P. S. I'm not using auto_ptr, but I have an important 3rd-party library that does.

1

There are 1 answers

0
Stephan Dollberg On

Yes, you can compile with -Wno-deprecated-declarations to make GCC (also works with clang) ignore warnings about deprecated classes.

You might want to only use this flag for your third party library as it's still a good warning for code that's under your control.