Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 7 years ago

Language

Compiler

Options

Author

anonymous

over 7 years ago

$
prog.cc: In function 'int main()':
prog.cc:18:45:   in 'constexpr' expansion of 'do_some_stuff_wrong<int, int>(5, 5, 10)'
prog.cc:12:22: error: right operand of shift expression '(5 >> -5)' is negative [-fpermissive]
   return x < y ? val >> (x - y) : val >> (y - x);
                  ~~~~^~~~~~~~~~
prog.cc:17:19: warning: unused variable 'val' [-Wunused-variable]
     constexpr int val = do_some_stuff(5, 5, 10); // no warning
                   ^~~
prog.cc:18:19: warning: unused variable 'val2' [-Wunused-variable]
     constexpr int val2 = do_some_stuff_wrong(5, 5, 10); // warning
                   ^~~~
Exit Code:
1