]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/65175
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Jun 2019 23:18:28 +0000 (23:18 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Jun 2019 23:18:28 +0000 (23:18 +0000)
* g++.dg/cpp0x/alias-decl-69.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272098 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-69.C [new file with mode: 0644]

index fc0d76df434dfa564a4f836f5fa5f29eeaaad520..8f5eba984a74bb89b2b2d8c9719997d5f3a3d297 100644 (file)
@@ -1,5 +1,8 @@
 2019-06-09  Marek Polacek  <polacek@redhat.com>
 
+       PR c++/65175
+       * g++.dg/cpp0x/alias-decl-69.C: New test.
+
        PR c++/60366
        * g++.dg/cpp0x/lambda/lambda-ice32.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-69.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-69.C
new file mode 100644 (file)
index 0000000..7dd7aa2
--- /dev/null
@@ -0,0 +1,40 @@
+// PR c++/65175
+// { dg-do compile { target c++11 } }
+
+template <class a> using au = typename a::av;
+template <bool, class a> using az = a;
+template <template <class...> class b, class... bf> struct d {
+  template <class bh> struct f { typedef bh e; };
+  static auto g(int) -> f<b<bf...>>;
+  typedef typename decltype(g(0))::e e;
+};
+template <class = void> class h;
+template <class, class, template <class...> class, class...> struct i;
+struct j {
+  typedef int bu;
+};
+namespace bv {
+template <class> struct k : j {};
+template <class bx> struct l : i<int, void, k, bx> {};
+} // namespace bv
+template <class bx> auto bw(bx) -> az<bv::l<bx>::c, typename bv::l<bx>::bz>;
+template <class, class cd, class> struct n : j { au<cd> av; };
+template <class, class cd, class> struct K : j { au<cd> av; };
+template <class cj> struct o {
+  typedef typename cj::e e;
+  static const bool c = true;
+  typedef h<typename e::bu> bz;
+};
+template <class, class, template <class...> class cj, class... bf>
+struct i : o<d<cj, bf...>> {};
+template <class> class h {
+public:
+  typedef int av;
+  struct : i<int, int, K, int, h, int> {} s;
+  template <class> struct p : i<int, int, n, int, h<h>, int> {};
+  template <class bx, class cl>
+  auto m_fn2(bx, cl) -> az<p<cl>::c, typename p<cl>::bz>;
+  template <class bx> static auto q(int, int, bx cm) -> decltype(bw(cm));
+};
+int a, b;
+void c() { h<>::q(b, 5, a).m_fn2(5, a); }