Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C++

Compiler

gcc 10.1.0

Options
Warnings
Don't Use Boost
C++17
-pedantic

Author

anonymous

over 4 years ago

$ g++ prog.cc -Wall -Wextra -std=c++17 -pedantic
prog.cc: In static member function 'static int Test<T>::f()':
prog.cc:6:52: warning: no return statement in function returning non-void [-Wreturn-type]
    6 |     static int f(void){static_assert(sizeof(T)==0);}
      |                                                    ^
prog.cc: In member function 'int Test<T>::g()':
prog.cc:7:45: warning: no return statement in function returning non-void [-Wreturn-type]
    7 |     int g(void){static_assert(sizeof(T)==0);}
      |                                             ^
prog.cc: In instantiation of 'constexpr const int Test<int>::sdm':
prog.cc:16:12:   required from here
prog.cc:5:32: error: cast from 'std::nullptr_t' to 'int' loses precision [-fpermissive]
    5 |     static constexpr int sdm = T(nullptr);
      |                                ^~~~~~~~~~
prog.cc: In function 'int main()':
prog.cc:16:15: warning: statement has no effect [-Wunused-value]
   16 |    intTest.sdm;
      |               ^
prog.cc: In instantiation of 'static int Test<T>::f() [with T = int]':
prog.cc:15:14:   required from here
prog.cc:6:47: error: static assertion failed
    6 |     static int f(void){static_assert(sizeof(T)==0);}
      |                                      ~~~~~~~~~^~~
prog.cc: In instantiation of 'int Test<T>::g() [with T = int]':
prog.cc:17:14:   required from here
prog.cc:7:40: error: static assertion failed
    7 |     int g(void){static_assert(sizeof(T)==0);}
      |                               ~~~~~~~~~^~~
Exit Code:
1