Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 6 years ago

Language

C++

Compiler

gcc 9.2.0

Options
Warnings
Boost 1.70.0
C++2a(GNU)
-pedantic
Raw compiler options
-Wconversion

Author

anonymous

almost 6 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.70.0/gcc-9.2.0/include -std=gnu++2a -pedantic -Wconversion
prog.cc: In function 'int main()':
prog.cc:8:18: error: cannot convert 'Foo' to 'int' in initialization
    8 |     int a = Foo::Bar;
      |             ~~~~~^~~
      |                  |
      |                  Foo
prog.cc:8:9: warning: unused variable 'a' [-Wunused-variable]
    8 |     int a = Foo::Bar;
      |         ^
Exit Code:
1