[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / ext / flexary.h
bloba8dff7db0d4bfef3ec7f622775a5ff9f3f6024df
1 // Definitions of helper macros for tests of flexible array members.
3 #if __cplusplus < 201102L
4 # define _CAT(x, y) x ## y
5 # define CAT(x, y) _CAT (x, y)
7 // Generate a struct with a unique name containing a bitfield
8 // of size that must evaluate to a non-zero value, otherwise
9 // generate a compiler error.
10 # define ASSERT(expr) \
11 struct CAT (FAM_Assert, __LINE__) { unsigned asrt: 0 != (expr); }
12 #else
13 // In C++ 11 and beyond, use static_assert.
14 # define ASSERT(expr) static_assert (expr, #expr)
15 #endif
17 // Macro to verify that a flexible array member is allocated
18 // at the very end of the containing struct.
19 #define ASSERT_AT_END(T, m) \
20 ASSERT (__builtin_offsetof (T, m) == sizeof (T))
22 typedef __SIZE_TYPE__ size_t;