Language
C++
Compiler
gcc HEAD 11.0.0 20210117 (experimental)
Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2a
Exit Code:
1
Author
anonymous
over 4 years ago
C++
gcc HEAD 11.0.0 20210117 (experimental)
Author
anonymous
over 4 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2a
prog.cc: In instantiation of 'void f() [with A i = A{}]':
prog.cc:11:12: required from here
prog.cc:6:24: error: static assertion failed
6 | static_assert(std::is_same_v<decltype(i), A const>); // #1
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:6:24: note: 'std::is_same_v<A, const A>' evaluates to false
prog.cc:7:8: error: binding reference of type 'A&' to 'const A' discards qualifiers
7 | A& ar = i; // #2
| ^~
prog.cc:7:8: warning: unused variable 'ar' [-Wunused-variable]