Language
C++
Compiler
gcc HEAD 11.0.1 20210317 (experimental)
Options
Warnings
Boost 1.73.0
C++2b(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2b
Exit Code:
1
Author
anonymous
almost 4 years ago
C++
gcc HEAD 11.0.1 20210317 (experimental)
Author
anonymous
almost 4 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2b
prog.cc: In function 'int main()':
prog.cc:8:25: error: cannot bind non-const lvalue reference of type 'bool&' to an rvalue of type 'bool'
8 | bool& non_const_ref = *iter;
| ^~~~~
In file included from /opt/wandbox/gcc-head/include/c++/11.0.1/vector:68,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_bvector.h:86:5: note: after user-defined conversion: 'std::_Bit_reference::operator bool() const'
86 | operator bool() const _GLIBCXX_NOEXCEPT
| ^~~~~~~~
prog.cc:7:15: warning: unused variable 'const_ref' [-Wunused-variable]
7 | bool const& const_ref = *iter;
| ^~~~~~~~~
prog.cc:8:9: warning: unused variable 'non_const_ref' [-Wunused-variable]
8 | bool& non_const_ref = *iter;
| ^~~~~~~~~~~~~