Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 4 years ago

Language

C++

Compiler

clang 11.1.0

Options
Warnings
Don't Use Boost
C++2a(GNU)
no pedantic

Author

anonymous

about 4 years ago

$ clang++ prog.cc -Wall -Wextra -std=gnu++2a
prog.cc:4:12: warning: reference to stack memory associated with local variable 'a' returned [-Wreturn-stack-address]
    return res;
           ^~~
prog.cc:3:10: note: binding reference variable 'res' here
    int& res = a;
         ^     ~
prog.cc:8:12: warning: reference to stack memory associated with local variable 'a' returned [-Wreturn-stack-address]
    return a;
           ^
2 warnings generated.
/usr/lib/gcc/x86_64-linux-gnu/5.5.0/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
Exit Code:
1