Language
C++
Compiler
gcc 10.1.0
Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-10.1.0/include -std=gnu++2a
Exit Code:
1
Author
anonymous
over 4 years ago
C++
gcc 10.1.0
Author
anonymous
over 4 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-10.1.0/include -std=gnu++2a
prog.cc: In instantiation of 'void demo(X&&, Y&&) [with X = A; Y = B]':
prog.cc:36:18: required from here
prog.cc:27:29: error: use of deleted function 'C::C(A&&)'
27 | std::common_type_t<X,Y> res1{std::forward<X>(x)};
| ^~~~
prog.cc:18:5: note: declared here
18 | C(A&&) = delete;
| ^
prog.cc:27:29: warning: unused variable 'res1' [-Wunused-variable]
27 | std::common_type_t<X,Y> res1{std::forward<X>(x)};
| ^~~~