Language
C++
Compiler
gcc 11.1.0
Options
Warnings
Don't Use Boost
C++2b
no pedantic
$ g++ prog.cc -Wall -Wextra -std=c++2b
Exit Code:
1
Author
anonymous
almost 4 years ago
C++
gcc 11.1.0
Author
anonymous
almost 4 years ago
$ g++ prog.cc -Wall -Wextra -std=c++2b
prog.cc:3:27: error: the value of 'x' is not usable in a constant expression
3 | int x = 100; int r2 = sqr(x); // Error: Call does not produce a constant
| ^
prog.cc:3:5: note: 'int x' is not const
3 | int x = 100; int r2 = sqr(x); // Error: Call does not produce a constant
| ^