1 // PR debug/46583
2 // { dg-do compile }
3 // { dg-options "-O -fno-inline -fipa-cp -fipa-cp-clone -fcompare-debug" }
4 // { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } }
5 
6 template < typename = unsigned long >struct A
7 {
8   unsigned long elems[3];
beginA9   unsigned long *begin ()
10   {
11     return 0;
12   }
13 };
14 
15 void
bar(unsigned long * a1,unsigned long,unsigned long * a3,unsigned const &)16 bar (unsigned long *a1, unsigned long, unsigned long *a3, unsigned const &)
17 {
18   *a3 = *a1;
19 }
20 
operatorM(A<> a1,unsigned long a2)21 A < >operatorM (A < >a1, unsigned long a2)
22 {
23   typedef A < >G;
24   G a3;
25   bar (a1.begin (), a2, a3.begin (), 0);
26   return a3;
27 }
28 
29 struct B
30 {
BB31   B (A < >m):n (operatorM (m, 1))
32   {
33   }
34   A < >n;
35 };
36 
37 void
foo()38 foo ()
39 {
40   B (A < >());
41 }
42