Language
C++
Compiler
clang 15.0.7
Options
Warnings
Boost 1.80.0
C++2a
no pedantic
$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.80.0-clang-15.0.7/include -std=c++2a Exit Code:
1
Author
anonymous
over 1 year ago
C++
clang 15.0.7
Author
anonymous
over 1 year ago
$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.80.0-clang-15.0.7/include -std=c++2a prog.cc:14:18: error: constexpr variable 'b' must be initialized by a constant expression
constexpr bool b = s.f();
^ ~~~~~
prog.cc:14:22: note: function parameter 's' with unknown value cannot be used in a constant expression
constexpr bool b = s.f();
^
prog.cc:13:14: note: declared here
void call(S& s) {
^
prog.cc:17:17: error: constexpr variable 'N' must be initialized by a constant expression
constexpr int N = s.constant;
^ ~~~~~~~~~~
prog.cc:17:21: note: function parameter 's' with unknown value cannot be used in a constant expression
constexpr int N = s.constant;
^
prog.cc:13:14: note: declared here
void call(S& s) {
^
2 errors generated.