-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Code:
#include <https://raw.githubusercontent.com/martinmoene/optional-lite/master/include/nonstd/optional.hpp>
#include <iostream>
#include <string>
int main()
{
nonstd::optional<std::string> s;
s = "test";
std::cout << (*s == "test") << std::endl;
std::cout << (s.value_or("") == "test") << std::endl; // comment this line
std::cout << (s->empty()) << std::endl;
}
Output:
1
1
1
Expected output:
1
1
0
If I comment line with value_or
it works just fine. GCC version also works as expected, but clang and msvc does not.
Live code: https://godbolt.org/z/frqjfr
Metadata
Metadata
Assignees
Labels
No labels