[Bug c++/115960] gcc throws an error when I use Optional in c++17.
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jul 17 18:46:13 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115960
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Noah Williams from comment #5)
> It isn't? The library I was trying to compile included the "optional"
> header, and I had looked it up and found it was part of C++ 17, so I thought
> it was part of the standard.
std::optional is part of C++17 but Optional is not.
LLVM had its own Optional class which basically implemented what was included
in C++17 before they wrote LLVM in C++17. This is the whole confusing thing
with their code is that LLVM is compiled as C++17 but sometimes uses their own
Optional class and sometimes std::optional. But again this is not GCC related
issue and should be discussed in LLVM's developmental forms instead.
More information about the Gcc-bugs
mailing list