1// { dg-do assemble } 2// PRMS Id: 3665 3 4//------------------------------------------------------------- 5// Referential declaration within class 6// 7// Imbeded below is the invocation of the compiler and the error 8// message 9// 10// This compiles successfully with both the xlC and CFRONT compilers 11// This was reviewed with Clem Dickey and we agree that it appears to 12// be a Cygnus compiler problem. 13//------------------------------------------------------------- 14/* 15$ make bug.reference.o 16 /usr/p3/bin/i960-vxworks-g++ `getsrc bug.reference.C` -I. -Iinc1 -Iinc2 17 -I/vw5.0.3/h -I/vw5.0.3/h/i960 -I/usr/p3/lib/gcc-lib/i960-vxworks/cygnus-2.3.3 18/include -I/usr/p3/lib/gcc-lib/i960-vxworks/cygnus-2.3.3-930417/include -I/usr/p 193/lib/i960-vxworks/include -I/usr/p3/i960-vxworks/include -c -DCPU_FAMILY=I960 20-DCPU=I960CA -mca -mold-align -g3 -O1 -DASSERT_ON -nostdinc -nostdinc++ -MD 21./bug.reference.C: In method `class1::class1 (long unsigned int, long unsigned i 22nt **&)': 23./bug.reference.C:43: cannot convert type `long unsigned int **' 24./bug.reference.C:43: to type `long unsigned int *[]&' 25make: 1254-004 The error code from the last command is 1. 26*/ 27 28// typedefs 29typedef unsigned long u32; 30typedef u32 *ul[16]; 31 32// class defs 33class class1 { 34 u32 var1; 35 class1(const class1 &); // Copy constructor 36 class1& operator=(const class1 &); // operator= member function 37public: 38 class1(u32, ul&); 39 ul &ulref; 40 ~class1() {} 41}; 42 43 44// member function defs 45class1::class1(u32 u, ul &l) : var1(u), ulref(l) 46{} 47 48/* =========================================================================== 49Note: The following is a "work around" that allows the successful compilation. 50 51 52// typedefs 53typedef unsigned long u32; 54typedef u32 *ul[16]; 55 56// class defs 57class class1 { 58 u32 var1; 59 class1(const class1 &); // Copy constructor 60 class1& operator=(const class1 &); // operator= member function 61public: 62 class1(u32, ul*); 63 ul &ulref; 64 ~class1() {} 65}; 66 67 68// member function defs 69class1::class1(u32 u, ul *l) : var1(u), ulref(*l) 70{} 71============================================================================*/ 72