Message ID | 20210308202911.43097-1-polacek@redhat.com |
---|---|
State | New |
Headers | show |
Series | [pushed] c++: Add test for PR96268. | expand |
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C new file mode 100644 index 00000000000..2be88437072 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C @@ -0,0 +1,13 @@ +// PR c++/96268 +// { dg-do compile { target c++20 } } + +template <int N> +struct static_string { char chars[N]; /* operator<=> */ }; + +template <int N> +static_string(char const(&)[N]) -> static_string<N>; + +static_string hi = {"hi"}; + +template <static_string str> struct name {}; +using Hi = name<{"hi"}>;