| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
// { dg-options "--embed-dir=${srcdir}/c-c++-common/cpp/embed-dir" } |
| 3 |
|
| 4 |
template <int... N> |
| 5 |
constexpr decltype (sizeof 0) |
| 6 |
foo () |
| 7 |
{ |
| 8 |
return sizeof... (N); |
| 9 |
} |
| 10 |
|
| 11 |
template <typename T, typename U> |
| 12 |
struct same_type; |
| 13 |
template <typename T> |
| 14 |
struct same_type <T, T> {}; |
| 15 |
|
| 16 |
void |
| 17 |
bar () |
| 18 |
{ |
| 19 |
} |
| 20 |
|
| 21 |
template <typename U, typename... T> |
| 22 |
same_type <U, int> * |
| 23 |
bar (U u, T... t) |
| 24 |
{ |
| 25 |
bar (t...); |
| 26 |
return nullptr; |
| 27 |
} |
| 28 |
|
| 29 |
static_assert ( |
| 30 |
#embed <magna-carta.txt> limit (1) prefix (foo <) suffix (> () == 1, "") |
| 31 |
); |
| 32 |
static_assert ( |
| 33 |
#embed <magna-carta.txt> limit (2) prefix (foo <) suffix (> () == 2, "") |
| 34 |
); |
| 35 |
static_assert ( |
| 36 |
#embed <magna-carta.txt> limit (42) prefix (foo <) suffix (> () == 42, "") |
| 37 |
); |
| 38 |
static_assert ( |
| 39 |
#embed <magna-carta.txt> limit (521) prefix (foo <) suffix (> () == 521, "") |
| 40 |
); |
| 41 |
|
| 42 |
void |
| 43 |
baz () |
| 44 |
{ |
| 45 |
bar ( |
| 46 |
#embed "magna-carta.txt" limit (54) |
| 47 |
); |
| 48 |
} |