Author
anonymous
almost 6 years ago
Language
C++
Compiler
gcc 9.1.0
Options
Warnings
Don't Use Boost
C++2a(GNU)
no pedantic
Author
anonymous
almost 6 years ago
$ g++ prog.cc -Wall -Wextra -std=gnu++2a
prog.cc: In member function 'boxed_value& boxed_value::operator=(const boxed_value&)':
prog.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
20 | val = rhs.val;
+++ |+ return *this;
21 | }
| ^
prog.cc: In function 'int test(const shape&, const shape&)':
prog.cc:25:23: error: no match for 'operator*' (operand types are 'boxed_value' and 'boxed_value')
25 | return (width(s1) * height(s1) + width(s2) * height(s2));
| ~~~~~~~~~ ^ ~~~~~~~~~~
| | |
| boxed_value boxed_value
prog.cc:25:48: error: no match for 'operator*' (operand types are 'boxed_value' and 'boxed_value')
25 | return (width(s1) * height(s1) + width(s2) * height(s2));
| ~~~~~~~~~ ^ ~~~~~~~~~~
| | |
| boxed_value boxed_value
prog.cc: In function 'int main()':
prog.cc:33:15: error: cannot convert 'bool' to 'void*'
33 | callee(0, false, 2);
| ^~~~~
| |
| bool
prog.cc:28:19: note: initializing argument 2 of 'void callee(int, void*, int)'
28 | void callee (int, void *, int);
| ^~~~~~
prog.cc:34:5: error: 'printf' was not declared in this scope
34 | printf("%*s", 2u, "hi");
| ^~~~~~
prog.cc:2:1: note: 'printf' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
1 | #include <cmath>
+++ |+#include <cstdio>
2 |
Exit Code:
1