From b64551af5159ea30b5941ddd430001b13936822c Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Mon, 8 Mar 2021 15:26:58 -0500 Subject: [PATCH] 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. --- gcc/testsuite/g++.dg/cpp2a/nontype-class41.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp2a/nontype-class41.C 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 +struct static_string { char chars[N]; /* operator<=> */ }; + +template +static_string(char const(&)[N]) -> static_string; + +static_string hi = {"hi"}; + +template struct name {}; +using Hi = name<{"hi"}>; -- 2.7.4