Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

C++

Compiler

clang HEAD 12.0.0 (https://github.com/llvm/llvm-project.git 1c45220028a8aa39ad2f26c8c3c6234d1a816086)

Options
Warnings
Boost 1.73.0
C++11
no pedantic

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/clang-head/include -std=c++11
prog.cc:17:10: error: virtual function 'Setup' has a different return type ('void') than the function it overrides (which has return type 'Test::Setup_should_be_spelled_SetUp *')
    void Setup() override {} // override するものがないので NG
    ~~~~ ^
prog.cc:9:44: note: overridden virtual function is here
    virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } // override して欲しい関数とは違う戻り値にしておく
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
prog.cc:18:18: error: only virtual member functions can be marked 'override'
    void setup() override {} // override するものがないので NG
                 ^~~~~~~~~
prog.cc:25:10: error: virtual function 'Setup' has a different return type ('void') than the function it overrides (which has return type 'Test::Setup_should_be_spelled_SetUp *')
    void Setup() {} // return type 違いでエラー
    ~~~~ ^
prog.cc:9:44: note: overridden virtual function is here
    virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } // override して欲しい関数とは違う戻り値にしておく
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
3 errors generated.
Exit Code:
1