| // RUN: clang-cc -fsyntax-only -verify %s |
| // Tests that dependent expressions are always allowed, whereas non-dependent |
| // Fake typeid, lacking a typeinfo header. |
| namespace std { class type_info {}; } |
| return (sizeof(x) == sizeof(int))? 0 : (sizeof(x) == sizeof(double))? 1 : 2; |
| template <typename T, typename U> |
| static_cast<void>(static_cast<U>(reinterpret_cast<T>( |
| dynamic_cast<U>(const_cast<T>(i1))))); |
| dummy d1 = sizeof(t1); // FIXME: delayed checking okay? |
| dummy d2 = offsetof(T, foo); // expected-error {{cannot initialize 'd2'}} |
| dummy d3 = __alignof(u1); // FIXME: delayed checking okay? |
| i1 = typeid(t1); // expected-error {{incompatible type assigning}} |