diff options
author | Marek Polacek <polacek@redhat.com> | 2021-03-08 15:26:58 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2021-03-08 15:27:20 -0500 |
commit | b64551af5159ea30b5941ddd430001b13936822c (patch) | |
tree | 568f7d938dbcceb57d49d0c42919eb05d08b4be2 /gcc | |
parent | bc56d27de97ecea813279ce5ba45b278dcccfe21 (diff) | |
download | gcc-b64551af5159ea30b5941ddd430001b13936822c.zip gcc-b64551af5159ea30b5941ddd430001b13936822c.tar.gz gcc-b64551af5159ea30b5941ddd430001b13936822c.tar.bz2 |
c++: Add test for PR96268.
This works since the recent r11-7102, but we didn't have a test for
a template-argument context.
gcc/testsuite/ChangeLog:
PR c++/96268
* g++.dg/cpp2a/nontype-class41.C: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp2a/nontype-class41.C | 13 |
1 files changed, 13 insertions, 0 deletions
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 0000000..2be8843 --- /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"}>; |