re PR c++/82782 (ICE: nested template alias and specialized template with auto templa...
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 5 Feb 2018 11:15:55 +0000 (11:15 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 5 Feb 2018 11:15:55 +0000 (11:15 +0000)
2018-02-05  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/82782
* g++.dg/cpp1z/inline-var4.C: New.

From-SVN: r257388

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/inline-var4.C [new file with mode: 0644]

index 074e6eadbd1803433bb32ac9553dafe3e845c244..bed5534a24bd2c5ad3587bc087404e9a5d0a837a 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-05  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/82782
+       * g++.dg/cpp1z/inline-var4.C: New.
+
 2018-02-05  Martin Liska  <mliska@suse.cz>
 
        * c-c++-common/asan/pointer-compare-1.c: Adjust ASAN_OPTIONS
diff --git a/gcc/testsuite/g++.dg/cpp1z/inline-var4.C b/gcc/testsuite/g++.dg/cpp1z/inline-var4.C
new file mode 100644 (file)
index 0000000..48563b3
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/82782
+// { dg-options -std=c++17 }
+
+template <const auto& Value>
+struct make_char_sequence;
+
+template <int N, const char (&StringLiteral)[N]>
+struct make_char_sequence<StringLiteral>
+{
+  using type = int;
+};
+
+template <const auto& StringLiteral>
+using make_char_sequence_t = typename make_char_sequence<StringLiteral>::type;
+
+inline constexpr char sample[] = "Sample";
+
+using X = make_char_sequence_t<sample>;