https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99058
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #1) > C++17 support isn't stable until GCC 9 so there is no guarantee of > compatibility between 7 and 8 or 8 and 9. That applies to the entire library > (and language features) not just std::optional. I should clarify that what "applies to the entire library" is the experimental nature of C++17 features. But C++98/11/14 features like std::vector and std::shared_ptr are compatible between GCC 7 and later releases.