// RUN: %clang_cc1 -triple i686-linux -Wno-string-plus-int -fsyntax-only -verify -std=c++11 -pedantic %s -Wno-comment
namespace StaticAssertFoldTest {
int x;
static_assert(++x, "test"); // expected-error {{not an integral constant expression}}
static_assert(false, "test"); // expected-error {{test}}
}
typedef decltype(sizeof(char)) size_t;
template<typename T> constexpr T id(const T &t) { return t; }
template<typename T> constexpr T min(const T &a, const T &b) {
return a < b ? a : b;
}
template<typename T> constexpr T max(const T &a, const T &b) {
return a < b ? b : a;
}
template<typename T, size_t N> constexpr T *begin(T (&xs)[N]) { return xs; }
template<typename T, size_t N> constexpr T *end(T (&xs)[N]) { return xs + N; }
struct MemberZero {
constexpr int zero() { return 0; }
};
namespace DerivedToVBaseCast {
struct U { int n; };
struct V : U { int n; };
struct A : virtual V { int n; };
struct Aa { int n; };
struct B : virtual A, Aa {};
struct C : virtual A, Aa {};
struct D : B, C {};
D d;
constexpr B *p = &d;
constexpr C *q = &d;
static_assert((void*)p != (void*)q, "");
static_assert((A*)p == (A*)q, "");
static_assert((Aa*)p != (Aa*)q, "");
constexpr B &pp = d;
constexpr C &qq = d;
static_assert((void*)&pp != (void*)&qq, "");
static_assert(&(A&)pp