Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 5 years ago

Language

C++

Compiler

gcc 9.2.0

Options
Warnings
Boost 1.72.0
C++2a
no pedantic
Raw compiler options
-Werror -DSHOW_ERROR

Author

anonymous

over 5 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.72.0/gcc-9.2.0/include -std=c++2a -Werror -DSHOW_ERROR
prog.cc:31:5: error: invalid covariant return type for 'virtual std::shared_ptr<DerivedSPtr> Derived::function()'
   31 |     function() override {
      |     ^~~~~~~~
prog.cc:15:39: note: overridden function is 'virtual std::shared_ptr<BaseSPtr> Base::function()'
   15 |     virtual std::shared_ptr<BaseSPtr> function() = 0;
      |                                       ^~~~~~~~
Exit Code:
1