Author
anonymous
over 8 years ago
Language
Compiler
Options
Author
anonymous
over 8 years ago
$
prog.cc: In function 'constexpr auto compute(bool)':
prog.cc:10:1: error: call to non-constexpr function 'std::optional<literal>::optional(const std::optional<literal>&)'
}
^
In file included from prog.cc:1:0:
/opt/wandbox/gcc-head/include/c++/7.0.1/optional:400:11: note: 'std::optional<literal>::optional(const std::optional<literal>&)' is not usable as a constexpr function because:
class optional
^~~~~~~~
/opt/wandbox/gcc-head/include/c++/7.0.1/optional:281:7: note: defaulted constructor calls non-constexpr 'std::_Optional_base<_Tp, false>::_Optional_base(const std::_Optional_base<_Tp, false>&) [with _Tp = literal]'
_Optional_base(const _Optional_base& __other)
^~~~~~~~~~~~~~
prog.cc: In function 'int main()':
prog.cc:14:5: error: non-constant condition for static assertion
static_assert( (*compute(true)).value == 42 );
^~~~~~~~~~~~~
prog.cc:14:5: error: 'constexpr auto compute(bool)' called in a constant expression
Exit Code:
1