fork download
  1. #include <type_traits>
  2.  
  3. struct foo {};
  4. struct bar : foo {};
  5. struct qux : foo {};
  6.  
  7. int main() {
  8. std::common_type<qux, bar>::type x;
  9. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from prog.cpp:1:0:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/type_traits: In instantiation of 'std::common_type<qux, bar>':
prog.cpp:8:31:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/type_traits:604:64: error: no match for ternary 'operator?:' in 'true ? std::declval [with _Tp = qux, typename std::add_rvalue_reference<_Tp>::type = qux&&]() : std::declval [with _Tp = bar, typename std::add_rvalue_reference<_Tp>::type = bar&&]()'
stdout
Standard output is empty