gcc/testsuite/g++.dg/cpp2a/class-deduction-alias23.C
raw| 1 | // PR c++/115296 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | using size_t = decltype(sizeof(0)); |
| 5 | |
| 6 | template<class T, size_t N = size_t(-1)> |
| 7 | struct span { span(T); }; |
| 8 | |
| 9 | template<class T, size_t N> |
| 10 | span(T(&)[N]) -> span<T, N>; // { dg-bogus "array exceeds maximum" } |
| 11 | |
| 12 | template<class T, size_t N> |
| 13 | requires (sizeof(T[N]) != 42) // { dg-bogus "array exceeds maximum" } |
| 14 | span(T*) -> span<T, N>; |
| 15 | |
| 16 | template<class T> |
| 17 | using array_view = span<T>; |
| 18 | |
| 19 | array_view x = 0; |