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 function 'int main()':
prog.cc:36:18: error: use of function 'void demo(X&&, Y&&) [with X = A; Y = B]' with unsatisfied constraints
36 | demo(A{}, B{}); // call with rvalues
| ^
prog.cc:26:6: note: declared here
26 | void demo(X&& x, Y&& y) {
| ^~~~
prog.cc:26:6: note: constraints not satisfied
prog.cc: In instantiation of 'void demo(X&&, Y&&) [with X = A; Y = B]':
prog.cc:36:18: required from here
prog.cc:4:37: required for the satisfaction of 'Common<X, Y>' [with X = A; Y = B]
prog.cc:5:1: in requirements with 'T&& t', 'U&& u' [with _Tp2 = B; _Tp1 = A; U = B; T = A]
prog.cc:10:4: note: the required expression 'CommonType<T, U>{forward<T>(t)}' is invalid
10 | { CommonType<T, U>{std::forward<T>(t)} }; // invalid: call to deleted constructor
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: note: set '-fconcepts-diagnostics-depth=' to at least 2 for more detail