Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 8 years ago

Language

C++

Compiler

gcc 8.2.0

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

Author

anonymous

almost 8 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/gcc-8.2.0/include -std=gnu++2a
In file included from /opt/wandbox/gcc-8.2.0/include/c++/8.2.0/cassert:44,
                 from prog.cc:3:
prog.cc: In function 'int main()':
prog.cc:19:43:   in 'constexpr' expansion of 'safe_right_shift(((unsigned int)1024), ((unsigned int)32))'
prog.cc:7:5: error: call to non-'constexpr' function 'void __assert_fail(const char*, const char*, unsigned int, const char*)'
     assert(shift<sizeof(unsigned int)*CHAR_BIT); //ugly error
     ^~~~~~
prog.cc:18:20: warning: unused variable 'val' [-Wunused-variable]
     constexpr auto val = safe_right_shift(1024,31);
                    ^~~
prog.cc:19:20: warning: unused variable 'val2' [-Wunused-variable]
     constexpr auto val2 = safe_right_shift(1024,32); // ugly error
                    ^~~~
Exit Code:
1