Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

C++

Compiler

gcc HEAD 11.0.0 20200919 (experimental)

Options
Warnings
Boost 1.73.0
C++11
-pedantic

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=c++11 -pedantic
prog.cc: In constructor 'A::A(int)':
prog.cc:7:9: warning: 'A::y' will be initialized after [-Wreorder]
    7 |     int y;
      |         ^
prog.cc:6:9: warning:   'int A::x' [-Wreorder]
    6 |     int x;
      |         ^
prog.cc:5:5: warning:   when initialized here [-Wreorder]
    5 |     A(int a) : y(a), x(y) {} // C5038, Initialized in reverse, y reused
      |     ^
/usr/lib/x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Exit Code:
1