fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int returnValue;
  8. double returnValue2;
  9. static_assert( std::is_same<int, decltype(returnValue)>::value , "");
  10. static_assert( std::is_same<double, decltype(returnValue)>::value , "");
  11.  
  12. return 0;
  13. }
Compilation error #stdin compilation error #stdout 0s 3336KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:10:2: error: static assertion failed: 
  static_assert( std::is_same<double, decltype(returnValue)>::value ,  "");
  ^
prog.cpp:8:9: warning: unused variable ‘returnValue2’ [-Wunused-variable]
  double returnValue2;
         ^
stdout
Standard output is empty