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