Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/torture/pr94216.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 // { dg-do compile } | |
2 // { dg-additional-options "-g" } | |
3 | |
4 template <int _Nm> struct A { typedef int _Type[_Nm]; }; | |
5 template <int _Nm> struct B { | |
6 typename A<_Nm>::_Type _M_elems; | |
7 void operator[](int) { int a = *_M_elems; } | |
8 }; | |
9 class C { | |
10 struct D { | |
11 using type = int *; | |
12 }; | |
13 | |
14 public: | |
15 using pointer = D::type; | |
16 }; | |
17 class F { | |
18 public: | |
19 using pointer = C::pointer; | |
20 F(pointer); | |
21 }; | |
22 struct G { | |
23 int data; | |
24 }; | |
25 template <int MaxDimensions> struct H { | |
26 using dimensions_t = B<MaxDimensions>; | |
27 dimensions_t dimensions; | |
28 G mem; | |
29 }; | |
30 template <int MaxDimensions, typename Allocator, typename DimT, typename AlignT> | |
31 H<MaxDimensions> alloc_view(int, DimT, AlignT, Allocator) { | |
32 H<MaxDimensions> b; | |
33 b.dimensions[0]; | |
34 return b; | |
35 } | |
36 namespace memory { | |
37 template <typename> using DynMdView = H<6>; | |
38 } | |
39 class I { | |
40 I(); | |
41 memory::DynMdView<void> m_view; | |
42 F m_memory; | |
43 }; | |
44 int c, d, e; | |
45 I::I() : m_view(alloc_view<6>(c, d, e, [] {})), m_memory(&m_view.mem.data) {} |