diff options
author | Marek Polacek <polacek@redhat.com> | 2019-06-09 23:18:28 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2019-06-09 23:18:28 +0000 |
commit | 3645c6e286c4677815e0eeeb8c8aefa759795bd0 (patch) | |
tree | 436dc98c9ac5aec53de6f92bc70011c85b8705c3 /gcc | |
parent | dcba286a9ad584b5713ab32c63516519ecef521a (diff) | |
download | gcc-3645c6e286c4677815e0eeeb8c8aefa759795bd0.zip gcc-3645c6e286c4677815e0eeeb8c8aefa759795bd0.tar.gz gcc-3645c6e286c4677815e0eeeb8c8aefa759795bd0.tar.bz2 |
re PR c++/65175 (ICE forming a typedef with an alias template)
PR c++/65175
* g++.dg/cpp0x/alias-decl-69.C: New test.
From-SVN: r272098
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/alias-decl-69.C | 40 |
2 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc0d76d..8f5eba9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..7dd7aa23 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-69.C @@ -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); } |