Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 2 years ago

Language

C++

Compiler

clang 15.0.0

Options
Warnings
Boost 1.80.0
C++2b
no pedantic

Author

anonymous

over 2 years ago

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.80.0-clang-15.0.0/include -std=c++2b
prog.cc:8:10: warning: reference to stack memory associated with local variable 'n' returned [-Wreturn-stack-address]
  return r; // UB
         ^
prog.cc:6:8: note: binding reference variable 'r' here
  int& r = n;
       ^   ~
1 warning generated.
Exit Code:
0