Home | History | Annotate | Download | only in expr.static.cast
      1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
      2 
      3 enum class EC { ec1 };
      4 
      5 void test0(EC ec) {
      6   (void)static_cast<bool>(ec);
      7   (void)static_cast<bool>(EC::ec1);
      8   (void)static_cast<char>(ec);
      9   (void)static_cast<char>(EC::ec1);
     10   (void)static_cast<int>(ec);
     11   (void)static_cast<int>(EC::ec1);
     12   (void)static_cast<unsigned long>(ec);
     13   (void)static_cast<unsigned long>(EC::ec1);
     14   (void)static_cast<float>(ec);
     15   (void)static_cast<float>(EC::ec1);
     16   (void)static_cast<double>(ec);
     17   (void)static_cast<double>(EC::ec1);
     18 }
     19 
     20 namespace PR9107 {
     21   enum E {};
     22   template <class _Tp> inline _Tp* addressof(_Tp& __x) {
     23     return (_Tp*)&(char&)__x;
     24   }
     25   void test() {
     26     E a;
     27     addressof(a);
     28   }
     29 }
     30