Author
anonymous
almost 7 years ago
Language
C++
Compiler
gcc 8.2.0
Options
Warnings
Boost 1.67.0
C++17
-pedantic
Author
anonymous
almost 7 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.67.0/gcc-8.2.0/include -std=c++17 -pedantic
In file included from /opt/wandbox/gcc-8.2.0/include/c++/8.2.0/utility:70,
from prog.cc:1:
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h: In instantiation of 'struct std::pair<int, void>':
prog.cc:8:27: required from here
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:204:11: error: 'std::pair<_T1, _T2>::second' has incomplete type
_T2 second; /// @c second is a copy of the second object
^~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:204:11: error: invalid use of 'void'
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:249:17: error: forming reference to void
constexpr pair(const _T1& __a, const _T2& __b)
^~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:258:26: error: forming reference to void
explicit constexpr pair(const _T1& __a, const _T2& __b)
^~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:300:18: error: forming reference to void
constexpr pair(_U1&& __x, const _T2& __y)
^~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:307:27: error: forming reference to void
explicit constexpr pair(_U1&& __x, const _T2& __y)
^~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:400:2: error: forming reference to void
operator=(const pair<_U1, _U2>& __p)
^~~~~~~~
/opt/wandbox/gcc-8.2.0/include/c++/8.2.0/bits/stl_pair.h:411:2: error: forming reference to void
operator=(pair<_U1, _U2>&& __p)
^~~~~~~~
prog.cc: In function 'int main()':
prog.cc:8:35: error: invalid use of void expression
std::pair<int, void> p(42, f());
^
Exit Code:
1