Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C++

Compiler

gcc HEAD 11.0.0 20210118 (experimental)

Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic

Author

anonymous

over 4 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2a
prog.cc: In instantiation of 'void f() [with auto i = A{}]':
prog.cc:16:12:   required from here
prog.cc:7:8: error: binding reference of type 'A&' to 'const A' discards qualifiers
    7 |     A& ar = i;                                            // #2
      |        ^~
prog.cc:7:8: warning: unused variable 'ar' [-Wunused-variable]
prog.cc: In instantiation of 'void g() [with auto i = A{}]':
prog.cc:17:12:   required from here
prog.cc:12:8: error: binding reference of type 'A&' to 'const A' discards qualifiers
   12 |     A& ar = i;                                            // #2
      |        ^~
prog.cc:12:8: warning: unused variable 'ar' [-Wunused-variable]
Exit Code:
1