Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 2 years ago

Language

C++

Compiler

gcc HEAD 13.0.1 20230302 (experimental)

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

Author

anonymous

over 2 years ago

$ g++ prog.cc -Wall -Wextra -std=gnu++2b
prog.cc: In function 'int main()':
prog.cc:14:16: warning: possibly dangling reference to a temporary [-Wdangling-reference]
   14 |     int const& cl = R{i}.get();
      |                ^~
prog.cc:14:29: note: the temporary was destroyed at the end of the full expression 'R{i}.R::get()'
   14 |     int const& cl = R{i}.get();
      |                     ~~~~~~~~^~
prog.cc:15:11: warning: possibly dangling reference to a temporary [-Wdangling-reference]
   15 |     int&& r = R{i}.rget();
      |           ^
prog.cc:15:24: note: the temporary was destroyed at the end of the full expression 'R{i}.R::rget()'
   15 |     int&& r = R{i}.rget();
      |               ~~~~~~~~~^~
prog.cc:16:17: warning: possibly dangling reference to a temporary [-Wdangling-reference]
   16 |     int const&& cr = R{i}.rget();
      |                 ^~
prog.cc:16:31: note: the temporary was destroyed at the end of the full expression 'R{i}.R::rget()'
   16 |     int const&& cr = R{i}.rget();
      |                      ~~~~~~~~~^~
0x7ffc29c011fc
0x7ffc29c011fc
0x7ffc29c011fc
0x7ffc29c011fc
0x7ffc29c011fc
Exit Code:
0