Language
C++
Compiler
gcc HEAD 8.0.0 20170828 (experimental)
Options
Warnings
Boost 1.65.0
C++1z(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.65.0/gcc-head/include -std=gnu++1z
Exit Code:
1
Author
anonymous
over 7 years ago
C++
gcc HEAD 8.0.0 20170828 (experimental)
Author
anonymous
over 7 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.65.0/gcc-head/include -std=gnu++1z
prog.cc: In instantiation of 'void A<Derived>::showv() [with Derived = fromB]':
prog.cc:40:26: required from here
prog.cc:7:53: error: 'int fromB::v' is protected within this context
std::cout << static_cast<const Derived*>(this)->v << std::endl;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
prog.cc:29:9: note: declared protected here
int v = 2;
^