Closed tlane-jlg closed 1 year ago
Starting at this commit the following code sample is no longer possible in C++ 14 using the Clang compiler. I'm assuming this is unintentional given that std::optional works here in C++ 17.
std::optional
#include <iostream> #include <etl/optional.h> constexpr etl::optional<int> a; int main() { std::cout << "Hello world!" << std::endl; }
These are the relevant parts of the error message:
error: constexpr variable cannot have non-literal type 'const etl::optional<int>'
note: 'optional<int, true>' is not literal because it has data member 'storage' of non-literal type 'etl::optional<int, true>::storage_type'
Fixed 20.38.2
Starting at this commit the following code sample is no longer possible in C++ 14 using the Clang compiler. I'm assuming this is unintentional given that
std::optional
works here in C++ 17.These are the relevant parts of the error message: