testsuite: Add testcase for already fixed PR [PR88872]
authorJakub Jelinek <jakub@redhat.com>
Fri, 14 May 2021 11:24:12 +0000 (13:24 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 14 May 2021 11:24:12 +0000 (13:24 +0200)
2021-05-14  Jakub Jelinek  <jakub@redhat.com>

* g++.dg/cpp1y/pr88872.C: New test.

gcc/testsuite/g++.dg/cpp1y/pr88872.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp1y/pr88872.C b/gcc/testsuite/g++.dg/cpp1y/pr88872.C
new file mode 100644 (file)
index 0000000..3719e39
--- /dev/null
@@ -0,0 +1,24 @@
+// PR c++/88872
+// { dg-do compile { target c++14 } }
+
+struct a {
+  template <typename b> constexpr a(b) : c() {}
+  int c;
+};
+void d();
+template <char...> constexpr a operator"" _n() { return d; }
+struct e;
+struct f {
+  e operator[](int);
+};
+struct g {
+  void h();
+  f i;
+};
+template <typename> struct j {
+  void k() { [](auto) { constexpr auto l = 2_n; }(keywords); }
+  int keywords;
+};
+using m = j<int>;
+class e : public m {};
+void g::h() { i[0].k(); }