summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.mike')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/align1.C57
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/align2.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ambig1.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/asm1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/asm2.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/bool1.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/bool2.C58
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/bool4.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/conv1.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/debug1.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast3.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast4.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast5.C72
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast6.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast9.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh1.C38
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh10.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh11.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh12.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh13.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh14.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh15.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh16.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh17.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh18.C63
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh19.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh2.C74
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh20.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh21.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh23.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh24.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh25.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh26.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh27.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh28.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh29.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh3.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh30.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh31.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh32.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh33.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh34.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh35.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh36.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh37.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh38.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh39.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh4.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh40.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh41.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh42.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh44.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh45.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh46.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh47.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh48.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh49.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh5.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh50.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh51.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh52.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh53.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh54.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh55.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh56.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh57.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh58.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh59.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh6.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh7.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh8.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh9.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/enum1.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/err1.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/err2.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/err3.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/explicit1.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/explicit2.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/for1.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/for2.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/for3.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/fresco1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/hog1.C188
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/init1.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/init2.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/leak1.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/mangle1.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/mangle2.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/mangle3.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/mi1.C45
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/mi2.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc1.C54
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc11.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc12.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc13.C54
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc14.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc2.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc3.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc5.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc6.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc7.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc8.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc9.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net1.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net10.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net11.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net12.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net13.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net14.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net15.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net16.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net17.C59
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net18.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net19.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net2.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net20.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net21.C60
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net22.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net23.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net24.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net25.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net26.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net27.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net28.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net29.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net3.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net30.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net31.C68
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net32.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net34.C41
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net35.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net36.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net37.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net38.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net39.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net4.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net40.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net41.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net42.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net43.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net44.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net45.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net46.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net47.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net48.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net6.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net7.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net8.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net9.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns10.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns11.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns12.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns13.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns14.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns15.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns2.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns3.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns4.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns5.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns6.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns7.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns9.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/offset1.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/opr-as1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/opr-dot1.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p10148.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p10247.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p10416.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p10511.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p10769b.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p10849a.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p10951.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p11012.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p11110.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p11142.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p11144.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p11482.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p11667.C62
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p12306.C76
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p12306a.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p1248.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p1567.C42
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p16146.C90
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p1862.C63
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p1989.C495
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2394.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2431.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2573.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2736.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2746.C156
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2793.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2806.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2846.C67
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2846a.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2846b.C53
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2855.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2960.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3041.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3060c.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3060d.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3068.C61
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3070.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3139.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3524a.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3524b.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3524c.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3538a.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3538b.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3570.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3579.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3708.C87
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3708a.C87
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3708b.C86
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3764.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p3836.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4068.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4104.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4173.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p418.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4238.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4246.C49
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4263.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p438.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4484.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4511.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4619.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4623.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4667.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4671.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4677.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4693.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4736a.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4736b.C49
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4736c.C63
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p4750.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5469.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5469a.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5571.C71
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5611.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5673.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5718.C38
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5793.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5840.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5958.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6004.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6058.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6149.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6311.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p646.C163
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6578.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p658.C109
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6610a.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6610b.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6611.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6746.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6901.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p6927.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p700.C2386
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p701.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p710.C43
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p7180.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p7476.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p755.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p755a.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p7626.C43
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p7635.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p7651.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p783.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p783a.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p783b.C38
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p784.C3658
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p786.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p7865.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p7868.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p789.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p789a.C44
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p7912.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8009.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8018.C86
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8039.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p807.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p807a.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p811.C549
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8154.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8155.C148
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8175.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8269.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8460.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8483.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8620.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8786.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8804.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p8825.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p9068.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p9129.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p9206.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p9506.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p9706.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p9732a.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p9732b.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p9732c.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p991.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/parse1.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmd1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmf1.C91
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmf2.C55
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmf3.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmf4.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmf6.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmf7.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmf8.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pmf9.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pt1.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pt2.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pt3.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pt4.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ref1.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/rtti1.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/rtti2.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/rtti3.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/s24939.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/s35520.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/s9959.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/scast1.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/sizeof.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/temp.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/thunk1.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/thunk2.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/thunk3.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/unroll1.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/unused.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/virt1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/virt2.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/virt3.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/virt4.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/virt5.C54
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/virt6.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/visibility-1.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/vtable1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/warn1.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/warn2.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/warn3.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/warn4.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/warn5.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/warn6.C42
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/warn7.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/warn8.C20
352 files changed, 16118 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/align1.C b/gcc/testsuite/g++.old-deja/g++.mike/align1.C
new file mode 100644
index 000000000..027a908bb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/align1.C
@@ -0,0 +1,57 @@
+// { dg-do run }
+// Check to make sure we align virtual base classes properly
+
+class eel_base {
+public:
+};
+
+class markable_eel_base : public eel_base {
+private:
+ int mark;
+};
+
+class eel_edge : public markable_eel_base {
+public:
+private:
+ int foo;
+};
+
+class edge : public virtual eel_edge {
+public:
+ edge() {
+ _weight = 0.0;
+ }
+private:
+ double _weight;
+};
+class eel_branch_edge : public virtual edge {
+};
+class branch_edge : public eel_branch_edge {
+};
+
+class eel_interproc_branch_edge : public branch_edge {
+};
+
+class interproc_edge : public virtual edge {
+};
+
+class eel_jump_edge : public virtual edge {
+protected:
+};
+
+class jump_edge : public eel_jump_edge {
+public:
+};
+
+class eel_interproc_jump_edge : public jump_edge {
+protected:
+};
+
+class interproc_jump_edge : public eel_interproc_jump_edge,
+ public interproc_edge {
+public:
+};
+
+int main () {
+ void *vp = new interproc_jump_edge();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/align2.C b/gcc/testsuite/g++.old-deja/g++.mike/align2.C
new file mode 100644
index 000000000..ef39bb1ac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/align2.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+class Foo {
+};
+
+class Bar : virtual Foo {
+public:
+ int b;
+} x;
+
+int main()
+{
+ // printf("Foo offset %d\n", (int)(Foo*)&x - (int)&x);
+ // printf("b offset %d\n", (int)&x.b - (int)&x);
+ // printf("sizeof is %d\n", sizeof(Bar));
+ // This core dumps on a SPARC is alignment is wrong.
+ Bar blist[10];
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ambig1.C b/gcc/testsuite/g++.old-deja/g++.mike/ambig1.C
new file mode 100644
index 000000000..95c5eb7cd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ambig1.C
@@ -0,0 +1,33 @@
+// { dg-do assemble }
+extern "C" int printf(const char *, ...);
+
+struct VB {
+ virtual void f() {
+ printf("VB\n");
+ }
+};
+
+class M : public virtual VB {
+public:
+ int i;
+ void f() {
+ printf("M(%d)\n", i);
+ }
+};
+
+class lM : public M {
+};
+
+class rM : public M {
+};
+
+class D : public lM, rM { // { dg-error "" } ambiguous function
+} d;
+
+int main() {
+ ((lM*)&d)->i = 1;
+ ((rM*)&d)->i = 2;
+ ((rM*)&d)->f();
+ ((lM*)&d)->f();
+ ((VB*)&d)->f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/asm1.C b/gcc/testsuite/g++.old-deja/g++.mike/asm1.C
new file mode 100644
index 000000000..907e558ad
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/asm1.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+struct A {
+ static void foo() asm("_my_routine");
+};
+
+void A::foo() {
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/asm2.C b/gcc/testsuite/g++.old-deja/g++.mike/asm2.C
new file mode 100644
index 000000000..62ae86235
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/asm2.C
@@ -0,0 +1,25 @@
+// { dg-do run }
+// Compile with -S, there should be no references to
+// LTRAMP in the output.
+
+extern "C" int printf (const char *, ...);
+
+void
+sub2 (void (*func) ())
+{
+ (*func) ();
+}
+
+int
+main(void)
+{
+ extern void sub (void);
+
+ sub2 (sub);
+}
+
+void
+sub (void)
+{
+ printf ("hello world\n");
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/bool1.C b/gcc/testsuite/g++.old-deja/g++.mike/bool1.C
new file mode 100644
index 000000000..baa4196bf
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/bool1.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// bool test case
+
+
+void foo(int i) {
+ foo (true);
+}
+
+struct C {
+ void foo(int i) {
+ foo(true);
+ }
+ void bar(bool b) {
+ bar(0);
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/bool2.C b/gcc/testsuite/g++.old-deja/g++.mike/bool2.C
new file mode 100644
index 000000000..3d8bc3c03
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/bool2.C
@@ -0,0 +1,58 @@
+// { dg-do run }
+// { dg-options "" }
+class A {
+public:
+ operator bool () {
+ return true;
+ }
+} a;
+class A1 {
+public:
+ operator int () {
+ return true;
+ }
+} a1;
+class A2 {
+public:
+ operator const char * () {
+ return "";
+ }
+} a2;
+class A3 {
+public:
+ operator unsigned long long int () {
+ return true;
+ }
+} a3;
+class A4 {
+public:
+ operator const char * () {
+ return "";
+ }
+ operator unsigned long long int () {
+ return true;
+ }
+} a4;
+class A5 {
+public:
+ operator double () {
+ return 256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0
+ *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0
+ *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0
+ *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0;
+ }
+} a5;
+int i = true;
+bool b = true;
+bool c = (bool)(void (A::*)())0;
+bool d = 256;
+main() {
+ if (!d) return 1;
+ if (!a) return 1;
+ if (!(bool)a) return 1;
+ // if (!(long long)a) return 1;
+ if (!a1) return 1;
+ if (!a2) return 1;
+ if (!a3) return 1;
+ if (!a5) return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/bool4.C b/gcc/testsuite/g++.old-deja/g++.mike/bool4.C
new file mode 100644
index 000000000..3d119e5e0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/bool4.C
@@ -0,0 +1,3 @@
+// { dg-do assemble }
+
+void foo(bool arg = (1==0)) {}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/conv1.C b/gcc/testsuite/g++.old-deja/g++.mike/conv1.C
new file mode 100644
index 000000000..b6f227224
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/conv1.C
@@ -0,0 +1,11 @@
+// { dg-do run }
+enum E { C };
+
+E foo() {
+ return C;
+}
+
+int main() {
+ if (foo() != C)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/debug1.C b/gcc/testsuite/g++.old-deja/g++.mike/debug1.C
new file mode 100644
index 000000000..6c477d303
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/debug1.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-g -O -fkeep-inline-functions" }
+
+class c {
+public:
+ ~c () { };
+};
+
+int
+foo (const c& lhs)
+{
+ c str (lhs);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C
new file mode 100644
index 000000000..8764acdde
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C
@@ -0,0 +1,22 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions -w" }
+
+#include <typeinfo>
+
+struct B {
+ virtual int f() { }
+};
+
+struct D {
+ virtual int f() { }
+};
+
+main() {
+ B b;
+ try {
+ (void)dynamic_cast<D&>(b);
+ } catch (std::bad_cast) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C
new file mode 100644
index 000000000..ec737d6cc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C
@@ -0,0 +1,25 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions -w" }
+
+// Ensure reference handling works.
+
+#include <typeinfo>
+
+struct B {
+ virtual int f() { }
+} ob;
+
+struct D : public B {
+ virtual int f() { }
+} od;
+
+main() {
+ B *b=&ob;
+ try {
+ void *vp = &dynamic_cast<D&>(*b);
+ return 1;
+ } catch (std::bad_cast) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast3.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast3.C
new file mode 100644
index 000000000..662a37e0d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast3.C
@@ -0,0 +1,19 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe**-* } }
+// { dg-options "-fexceptions -w" }
+// Ensure that the return type of dynamic_cast is the real type.
+
+struct B {
+ virtual int f() { }
+};
+
+struct D : public B {
+ virtual int f() { }
+ int i;
+} od;
+
+main() {
+ B *b=&od;
+ if (dynamic_cast<D*>(b)->i)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast4.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast4.C
new file mode 100644
index 000000000..75e9771b5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast4.C
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+int main() {
+ int* d;
+ dynamic_cast<void*>(d); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast5.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast5.C
new file mode 100644
index 000000000..b6adac72a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast5.C
@@ -0,0 +1,72 @@
+// { dg-do run }
+#include <stddef.h>
+
+void *p;
+int fail;
+
+class HeapTracked {
+public:
+ virtual ~HeapTracked() = 0;
+ void *operator new(size_t size);
+ void operator delete(void *ptr);
+ static bool isObjectAllocation(const HeapTracked *ptr);
+};
+
+HeapTracked::~HeapTracked(){}
+void * HeapTracked::operator new(size_t size)
+{
+ void * memPtr = ::operator new(size);
+ p = memPtr;
+ return memPtr;
+}
+
+void HeapTracked::operator delete(void *ptr)
+{
+ if (p != ptr)
+ fail = 1;
+ ::operator delete(ptr);
+}
+
+bool HeapTracked::isObjectAllocation(const HeapTracked *ptr)
+{
+ if (p != const_cast<void*>(dynamic_cast<const void*>(ptr)))
+ fail = 1;
+ return false;
+}
+
+class Mumble1: public virtual HeapTracked {
+ double d;
+public:
+ virtual ~Mumble1(){}
+};
+
+class Mumble2: public virtual HeapTracked {
+ double d;
+public:
+ virtual ~Mumble2(){}
+};
+
+class Foo: virtual public HeapTracked,
+ virtual public Mumble1,
+ virtual public Mumble2 {
+public:
+ ~Foo(){}
+};
+
+int main()
+{
+ Foo *pf = new Foo;
+ pf->isObjectAllocation(pf);
+
+ Mumble1 *pm1 = pf;
+ pm1->isObjectAllocation(pm1);
+
+ Mumble2 *pm2 = pf;
+ pm2->isObjectAllocation(pm2);
+
+ // delete pf;
+ // delete pm1;
+ delete pm2;
+
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast6.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast6.C
new file mode 100644
index 000000000..60065a496
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast6.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+#include <typeinfo>
+
+class A {
+public:
+ virtual void j () {}
+};
+
+class B : public A { };
+
+void x (A& a) {
+ const B& b1 = dynamic_cast<B&>((const A&)a); // { dg-error "" } opps
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C
new file mode 100644
index 000000000..33e3fa787
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// { dg-options "-fexceptions" }
+
+#include <typeinfo>
+#include <stdexcept>
+
+class A {
+public:
+ virtual void j () {}
+};
+
+class B : public A { };
+
+void x (A& a) {
+ // These should all work.
+ const B& b2 = dynamic_cast<B&>(a);
+ const B& b3 = dynamic_cast<const B&>((const A&)a);
+ const B& b4 = dynamic_cast<const B&>(a);
+}
+
+int main() {
+ try {
+ B b;
+ x (b);
+ } catch (std::exception& e) {
+ // If we get a bad_cast, it is wrong.
+ return 1;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C
new file mode 100644
index 000000000..e2c5a2df9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+#include <typeinfo>
+
+class Base
+{
+public:
+ virtual ~Base() { }
+};
+
+class Derived : public Base
+{
+public:
+ Derived() {}
+};
+
+int main()
+{
+ const Derived b;
+ const Base* ap = &b;
+
+ const Derived* p1 = dynamic_cast<const Derived*>(ap);
+ return p1 == 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast9.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast9.C
new file mode 100644
index 000000000..f2b999019
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast9.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+class S1 { int i; };
+class S2 { int i; };
+class VB {
+public:
+ virtual void foo() { }
+};
+
+class D : public S1, virtual public VB {
+} d;
+
+class E : public S2, public D {
+} e;
+
+int main() {
+ return (char *)&e - (char *)dynamic_cast<E*>((D*)&e);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh1.C b/gcc/testsuite/g++.old-deja/g++.mike/eh1.C
new file mode 100644
index 000000000..8105107f3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh1.C
@@ -0,0 +1,38 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions -O -S" }
+
+extern "C" int printf (const char *, ...);
+extern "C" int atoi (const char *);
+extern "C" void exit (int);
+
+struct Exception
+ {
+ int v;
+ Exception(int i) { v = i; };
+ };
+
+ void inc(int &i)
+ {
+ try {
+ if (i == 0)
+ throw Exception(i);
+ else
+ i++;
+ }
+ catch (Exception v) {
+ i = v.v;
+ }
+ }
+
+main (int argc, const char *argv[])
+{
+ if (argc != 2)
+ {
+ printf ("usage: a.out <num>\n");
+ exit (1);
+ }
+ int count = atoi (argv[1]);
+ inc (count);
+ printf ("success\n");
+ exit (0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh10.C b/gcc/testsuite/g++.old-deja/g++.mike/eh10.C
new file mode 100644
index 000000000..a38e2ebc7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh10.C
@@ -0,0 +1,28 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+void foo() {
+ int i;
+ i = 42;
+ throw i;
+}
+
+void ee(int *);
+
+void bar() {
+ int i = 2;
+ ee(&i);
+}
+
+void ee(int *) { }
+
+main() {
+ try {
+ foo();
+ return 3;
+ } catch (int& i) {
+ bar();
+ return i != 42;
+ }
+ return 2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh11.C b/gcc/testsuite/g++.old-deja/g++.mike/eh11.C
new file mode 100644
index 000000000..8042d6443
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh11.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions" }
+
+struct A {
+ ~A();
+};
+
+int main(int argc, char** argv) {
+ A a;
+ return 0;
+}
+
+
+A::~A() {
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh12.C b/gcc/testsuite/g++.old-deja/g++.mike/eh12.C
new file mode 100644
index 000000000..8ec2998ef
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh12.C
@@ -0,0 +1,14 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+class MyError { };
+
+int main (int argc, char **argv) {
+ try {
+ throw MyError();
+ }
+ catch (MyError x) {
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh13.C b/gcc/testsuite/g++.old-deja/g++.mike/eh13.C
new file mode 100644
index 000000000..bac568655
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh13.C
@@ -0,0 +1,6 @@
+// { dg-do run { xfail arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <string>
+
+main() { }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh14.C b/gcc/testsuite/g++.old-deja/g++.mike/eh14.C
new file mode 100644
index 000000000..2e788fa36
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh14.C
@@ -0,0 +1,25 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+class arghh {
+public:
+ int n;
+ arghh (int v) { n = v; }
+};
+
+int main () {
+ try {
+ throw arghh (11);
+ }
+ catch (arghh& a) {
+ if (a.n != 11)
+ return 1;
+ }
+ try {
+ throw arghh (22);
+ }
+ catch (arghh& a) {
+ if (a.n != 22)
+ return 2;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh15.C b/gcc/testsuite/g++.old-deja/g++.mike/eh15.C
new file mode 100644
index 000000000..4418f1607
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh15.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions" }
+
+struct A {
+ A() throw (int);
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh16.C b/gcc/testsuite/g++.old-deja/g++.mike/eh16.C
new file mode 100644
index 000000000..73beac0a5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh16.C
@@ -0,0 +1,26 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int e = 1;
+
+struct A {
+ ~A() {
+ --e;
+ }
+};
+
+struct B {
+ A a;
+ B() {
+ throw 1;
+ }
+};
+
+main() {
+ try {
+ B b;
+ } catch (...) {
+ return e;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh17.C b/gcc/testsuite/g++.old-deja/g++.mike/eh17.C
new file mode 100644
index 000000000..5b066c9c3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh17.C
@@ -0,0 +1,25 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int e = 1;
+
+struct A {
+ ~A() {
+ --e;
+ }
+};
+
+struct B : public A {
+ B() {
+ throw 1;
+ }
+};
+
+main() {
+ try {
+ B b;
+ } catch (...) {
+ return e;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh18.C b/gcc/testsuite/g++.old-deja/g++.mike/eh18.C
new file mode 100644
index 000000000..02e6545e7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh18.C
@@ -0,0 +1,63 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+class VB {
+public:
+ int n;
+ VB (int v) { n = v; }
+ VB (const VB& o) {
+ n = o.n;
+// printf("copying VB from %d to %d\n", &o, this);
+ }
+};
+
+class D : public virtual VB {
+ int j;
+public:
+ D(int i1, int i2) : VB(i2) { j = i1; }
+ VB& vb() { return *(VB*)this; }
+ const VB& vb() const { return *(const VB*)this; }
+};
+
+class pD : private virtual VB {
+ int j;
+public:
+ pD(int i1, int i2) : VB(i2) { j = i1; }
+ VB& vb() { return *(VB*)this; }
+ const VB& vb() const { return *(const VB*)this; }
+};
+
+
+int main () {
+ D d(1943, 4279);
+ pD pd(3621, 9527);
+ VB *vb = &d.vb();
+ VB *pvb = &pd.vb();
+
+ // A catch of a public virtual base.
+ try {
+// printf("Throwing D at %d (VB at %d)\n", &d, vb);
+ throw d;
+ }
+ catch (VB& vb) {
+// printf("Catching VB at %d\n", &vb);
+ if (vb.n != 4279)
+ return 1;
+ }
+ catch (...) {
+ return 1;
+ }
+
+ // A catch of a private virtual base.
+ try {
+// printf("Throwing D at %d (VB at %d)\n", &pd, pvb);
+ throw pd;
+ }
+ catch (VB& vb) {
+// printf("Catching VB at %d\n", &vb);
+ // This was a private base of the throw object, don't catch it.
+ return 1;
+ }
+ catch (...) {
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh19.C b/gcc/testsuite/g++.old-deja/g++.mike/eh19.C
new file mode 100644
index 000000000..bbd668f98
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh19.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions" }
+
+class test1 {
+public:
+ class fehler{public:fehler(){};};
+ void func(int a) {
+ if( a == 0 )
+ throw fehler();
+ }
+};
+
+int main() {
+ test1 var;
+
+ try {
+ var.func(1);
+ var.func(0);
+ } catch(test1::fehler()) // function type promoted to pointer
+ {
+ ;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C
new file mode 100644
index 000000000..0a08790fe
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C
@@ -0,0 +1,74 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <cstdlib>
+#include <iostream>
+
+class Vector {
+private:
+ int *p;
+ int sz;
+
+public:
+ // Exception class
+ class Range {
+ private:
+ int value_i;
+
+ public:
+ Range( int i ) { value_i = i; };
+ int value() { return value_i; };
+ };
+
+ Vector( int s );
+ ~Vector();
+ int size() { return sz; };
+ int& operator []( int i );
+};
+
+Vector::Vector(int s) {
+ sz = s;
+ p = new int[sz];
+}
+
+Vector::~Vector() {
+ delete [] p;
+}
+
+int&
+Vector::operator [](int i) {
+ if (0<=i && i<sz) {
+ return p[i];
+ } else {
+ throw Range( i );
+ }
+}
+
+void crash(Vector& v ) {
+ v[v.size()+10]; // Triggers range error!
+}
+
+void do_something(Vector& v) {
+ crash( v );
+}
+
+void
+f(Vector& v) {
+ try {
+ do_something( v );
+ } catch (Vector::Range& r) {
+ std::cout << "Invalid vector range " << r.value()
+ << " caught in f()" << std::endl;
+ std::exit(0);
+ }
+}
+
+main() {
+ Vector v(10);
+
+ f( v );
+ return 1;
+}
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh20.C b/gcc/testsuite/g++.old-deja/g++.mike/eh20.C
new file mode 100644
index 000000000..ad29dbaa3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh20.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions -Wall" }
+
+int
+main() {
+ throw 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh21.C b/gcc/testsuite/g++.old-deja/g++.mike/eh21.C
new file mode 100644
index 000000000..ac74fa386
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh21.C
@@ -0,0 +1,14 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int main () {
+ try {
+ try {
+ throw 1;
+ } catch ( char * ) {
+ }
+ } catch ( int ) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh23.C b/gcc/testsuite/g++.old-deja/g++.mike/eh23.C
new file mode 100644
index 000000000..da2ac0ef3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh23.C
@@ -0,0 +1,47 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <exception>
+#include <stdlib.h>
+
+struct double_fault { };
+int fault_now;
+
+class E {
+public:
+ E() { }
+ E(const E&) {
+ if (fault_now)
+ throw double_fault();
+ }
+};
+
+void foo() {
+ try {
+ throw E();
+ } catch (...) {
+ fault_now = 1;
+ throw;
+ }
+}
+
+void bar() {
+ try {
+ foo();
+ } catch (E e) { // double fault here
+ }
+}
+
+void my_terminate() {
+ exit (0); // double faults should call terminate
+}
+
+main() {
+ std::set_terminate (my_terminate);
+ try {
+ bar();
+ } catch (...) {
+ return 1;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh24.C b/gcc/testsuite/g++.old-deja/g++.mike/eh24.C
new file mode 100644
index 000000000..829819b39
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh24.C
@@ -0,0 +1,33 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int fail = 0;
+
+struct A {
+ int ok;
+ A() {
+ ok = 1;
+ }
+ ~A() {
+ if (! ok)
+ fail = 1;
+ ok = 0;
+ }
+};
+
+main() {
+ try {
+ try {
+ A a;
+ throw 1.0;
+ } catch (double i) {
+ A a1;
+ throw 1; // make sure both a1 and a2 are not destroyed when we throw!
+ } catch (int i) {
+ A a2;
+ throw 1.0;
+ }
+ } catch (int i) {
+ }
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh25.C b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
new file mode 100644
index 000000000..fb492f78a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
@@ -0,0 +1,31 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <exception>
+#include <stdlib.h>
+
+void my_terminate() {
+ exit (0); // Double faults should call terminate
+}
+
+struct A {
+ A() { }
+ ~A() {
+ std::set_terminate (my_terminate);
+ throw 1; // This throws from EH dtor, should call my_terminate
+ }
+};
+
+main() {
+ try {
+ try {
+ throw 1;
+ } catch (int i) {
+ A a; // A hit on this EH dtor went to the wrong place
+ throw 1;
+ }
+ } catch (...) {
+ return 1;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh26.C b/gcc/testsuite/g++.old-deja/g++.mike/eh26.C
new file mode 100644
index 000000000..d0d65da31
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh26.C
@@ -0,0 +1,15 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+class MyExceptionHandler { };
+
+main() {
+ try {
+ throw MyExceptionHandler();
+ } catch(const MyExceptionHandler& eh) {
+ return 0;
+ } catch(...) {
+ return 1;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh27.C b/gcc/testsuite/g++.old-deja/g++.mike/eh27.C
new file mode 100644
index 000000000..8be08da8c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh27.C
@@ -0,0 +1,17 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <typeinfo>
+
+class MyExceptionHandler { };
+
+main() {
+ try {
+ throw MyExceptionHandler();
+ } catch(const MyExceptionHandler& eh) {
+ return 0;
+ } catch(...) {
+ return 1;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh28.C b/gcc/testsuite/g++.old-deja/g++.mike/eh28.C
new file mode 100644
index 000000000..57cab1178
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh28.C
@@ -0,0 +1,17 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <typeinfo>
+
+int fail = 1;
+
+class X { public: virtual void p() { } };
+class Y : public X { public: virtual void p() { fail = 0; } };
+
+main()
+{
+ try { Y y; throw y; }
+ catch (X& x) { x.p(); }
+ catch (...) { }
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh29.C b/gcc/testsuite/g++.old-deja/g++.mike/eh29.C
new file mode 100644
index 000000000..892e95964
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh29.C
@@ -0,0 +1,27 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int count;
+
+class A {
+public:
+ A() {
+// printf("ctor %x\n", (int)this);
+ if (count==3)
+ throw 1;
+ ++count;
+ }
+ ~A() {
+ --count;
+// printf("dtor %x\n", (int)this);
+ }
+};
+
+main() {
+ try {
+ A a[5];
+ } catch (...) {
+ return count;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh3.C b/gcc/testsuite/g++.old-deja/g++.mike/eh3.C
new file mode 100644
index 000000000..8c9ddb456
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh3.C
@@ -0,0 +1,21 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+class foo {
+public:
+ class error {};
+
+ void cause_error(void) { throw error(); }
+};
+
+int main(void)
+{
+ foo f;
+ try {
+ f.cause_error();
+ }
+ catch (foo::error&) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh30.C b/gcc/testsuite/g++.old-deja/g++.mike/eh30.C
new file mode 100644
index 000000000..8da682c53
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh30.C
@@ -0,0 +1,4 @@
+// { dg-do assemble { target native } }
+// { dg-options "-fexceptions -fPIC -S" }
+
+main() { throw 1; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh31.C b/gcc/testsuite/g++.old-deja/g++.mike/eh31.C
new file mode 100644
index 000000000..150d66b98
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh31.C
@@ -0,0 +1,23 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int count;
+
+class Foo {
+public:
+ Foo() { ++count; }
+ Foo(const Foo&) { ++count; }
+ ~Foo() { --count; }
+};
+
+
+main() {
+ try {
+ throw Foo();
+ }
+ catch (Foo& object) {
+ if (count == 1)
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh32.C b/gcc/testsuite/g++.old-deja/g++.mike/eh32.C
new file mode 100644
index 000000000..53822c743
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh32.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions" }
+
+class Base {
+public:
+ virtual ~Base() throw();
+};
+
+Base::~Base() throw()
+{
+}
+
+class Foo : public Base {
+public:
+ virtual ~Foo() throw();
+};
+
+Foo::~Foo() throw()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh33.C b/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
new file mode 100644
index 000000000..b679991e4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
@@ -0,0 +1,21 @@
+// { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <exception>
+
+void my_unexpected() {
+ throw 42;
+}
+
+void foo() throw (int) { throw "Hi"; }
+
+int main() {
+ std::set_unexpected (my_unexpected);
+ try {
+ foo();
+ } catch (int i) {
+ if (i == 42)
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh34.C b/gcc/testsuite/g++.old-deja/g++.mike/eh34.C
new file mode 100644
index 000000000..056f6b8df
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh34.C
@@ -0,0 +1,16 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+
+#include <exception>
+#include <stdlib.h>
+
+void my_unexpected() {
+ exit (0);
+}
+
+void foo() throw () { throw "Hi"; }
+
+int main() {
+ std::set_unexpected (my_unexpected);
+ foo();
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh35.C b/gcc/testsuite/g++.old-deja/g++.mike/eh35.C
new file mode 100644
index 000000000..adf852a64
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh35.C
@@ -0,0 +1,17 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+main() {
+ try {
+ throw 'a';
+ } catch (char a) {
+ try {
+ throw 'a';
+ } catch (int i) {
+ return 1;
+ } catch (char c) {
+ return 0;
+ }
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh36.C b/gcc/testsuite/g++.old-deja/g++.mike/eh36.C
new file mode 100644
index 000000000..d6b4788cb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh36.C
@@ -0,0 +1,29 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <typeinfo>
+
+class A {
+ int space;
+};
+class B {
+public:
+ int data;
+ B(int i) : data(i) {
+ }
+};
+class D : public A, public B {
+public:
+ D(int i) : B(i) {
+ }
+} d(42);
+
+main() {
+ try {
+ throw &d;
+ } catch (B* b) {
+ if (b->data == 42)
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh37.C b/gcc/testsuite/g++.old-deja/g++.mike/eh37.C
new file mode 100644
index 000000000..a98b5df99
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh37.C
@@ -0,0 +1,21 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <typeinfo>
+
+class B {
+public:
+ int data;
+ B(int i) : data(i) {
+ }
+} b(42);
+
+main() {
+ try {
+ throw &b;
+ } catch (B* b) {
+ if (b->data == 42)
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh38.C b/gcc/testsuite/g++.old-deja/g++.mike/eh38.C
new file mode 100644
index 000000000..5a5687982
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh38.C
@@ -0,0 +1,28 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <typeinfo>
+
+class B {
+public:
+ int data;
+ B(int i) : data(i) {
+ }
+} b(42);
+
+main() {
+ try {
+ throw &b;
+ } catch (const B* bptr) {
+ if (bptr->data == 42)
+ {
+ try {
+ throw &b;
+ } catch (void *bptr) {
+ if (((B*)bptr)->data == 42)
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh39.C b/gcc/testsuite/g++.old-deja/g++.mike/eh39.C
new file mode 100644
index 000000000..e4bfff8d1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh39.C
@@ -0,0 +1,28 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int fail = 1;
+class B {
+public:
+ B() { throw 1; }
+};
+class D : public B {
+public:
+ D();
+};
+
+D::D() try : B() {
+ fail = 1;
+} catch (...) {
+ fail = 0;
+ throw;
+}
+
+main() {
+ try {
+ D d;
+ fail = 1;
+ } catch (...) {
+ }
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh4.C b/gcc/testsuite/g++.old-deja/g++.mike/eh4.C
new file mode 100644
index 000000000..d7eb96ef7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh4.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions" }
+
+void foo() {
+ throw 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh40.C b/gcc/testsuite/g++.old-deja/g++.mike/eh40.C
new file mode 100644
index 000000000..e42b41974
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh40.C
@@ -0,0 +1,29 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int fail = 1;
+class B {
+public:
+ B() { throw 1; }
+};
+class D : public B {
+public:
+ D() try : B() {
+ fail = 1;
+ } catch (char c) {
+ fail = 1;
+ throw;
+ } catch (...) {
+ fail = 0;
+ throw;
+ }
+};
+
+main() {
+ try {
+ D d;
+ fail = 1;
+ } catch (...) {
+ }
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh41.C b/gcc/testsuite/g++.old-deja/g++.mike/eh41.C
new file mode 100644
index 000000000..831d75dc4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh41.C
@@ -0,0 +1,29 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+int fail = 0;
+
+struct A {
+ A () { a = 'a'; b = 'b'; c = 'c'; }
+ ~ A () {
+ if ( a != 'a' ) fail = 1;
+ if ( b != 'b' ) fail = 1;
+ if ( c != 'c' ) fail = 1;
+ }
+ char a, b, c;
+};
+
+void some_init () { throw 1; }
+
+struct C : A {
+ C () { some_init (); }
+};
+
+int main () {
+ try {
+ C c;
+ } catch (int i) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh42.C b/gcc/testsuite/g++.old-deja/g++.mike/eh42.C
new file mode 100644
index 000000000..ab69c3c53
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh42.C
@@ -0,0 +1,18 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+struct none { int i[50]; };
+
+class my_ex { } a;
+
+none throw_it() {
+ throw 1;
+}
+
+int main() {
+ try {
+ none n = throw_it();
+ } catch (int ex) {
+ return 0;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh44.C b/gcc/testsuite/g++.old-deja/g++.mike/eh44.C
new file mode 100644
index 000000000..27afd3fec
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh44.C
@@ -0,0 +1,36 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+// prms-id: 9159
+
+static unsigned int iCounter = 0;
+static unsigned int iMax;
+int fail = 0;
+
+class ca {
+public:
+ ca(int) {
+ if (iCounter++ == iMax)
+ throw (const char*)"iCounter";
+ }
+ virtual ~ca() {
+ }
+};
+
+class cc {
+public:
+ cc(const ca &rca1, const ca &rca2) {
+ }
+ virtual ~cc() {
+ fail = 1;
+ }
+};
+
+
+int main(int argc, char **argv) {
+ iMax = 1;
+ try {
+ cc sc(ca(1), ca(1));
+ } catch (const char *pMsg) {
+ }
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh45.C b/gcc/testsuite/g++.old-deja/g++.mike/eh45.C
new file mode 100644
index 000000000..5bd4dd476
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh45.C
@@ -0,0 +1,35 @@
+// { dg-do run }
+int i;
+int fail;
+
+class ca {
+public:
+ ca() {
+ if (++i != 1)
+ fail = 1;
+ }
+ virtual ~ca() {
+ if (++i != 4)
+ fail = 4;
+ }
+};
+
+class cb {
+public:
+ cb(const ca &rca) {
+ if (++i != 2)
+ fail = 2;
+ }
+ virtual ~cb() {
+ if (++i != 3)
+ fail = 3;
+ }
+};
+
+void foo(const cb &rcb) {
+}
+
+int main(int argc, char **argv) {
+ foo(cb(ca()));
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh46.C b/gcc/testsuite/g++.old-deja/g++.mike/eh46.C
new file mode 100644
index 000000000..9785e6ad1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh46.C
@@ -0,0 +1,47 @@
+// { dg-do assemble }
+// { dg-xfail-if "" { arm-*-pe } { "*" } { "" } }
+// { dg-options "-fexceptions" }
+
+int atoi(const char *);
+
+struct ios {
+ virtual ~ios();
+};
+
+class fstreambase : virtual public ios {
+};
+
+class ifstream : public fstreambase {
+};
+
+class ofstream : public fstreambase {
+};
+
+extern const short O;
+extern const short D;
+
+const short O= 0;
+const short D= -3;
+
+
+short glc(const char* const * const l,
+ short& n,short& x,short& y,
+ ifstream* i,ofstream* o)
+
+{
+ n=atoi(l[1]);
+
+ x=atoi(l[2]);
+ y=atoi(l[3]);
+
+ if((x < 0)||(y <0))
+ {
+ return D;
+ }
+
+ i = new ifstream[n];
+ o = new ofstream[2];
+
+ return O;
+
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh47.C b/gcc/testsuite/g++.old-deja/g++.mike/eh47.C
new file mode 100644
index 000000000..10eb8a897
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh47.C
@@ -0,0 +1,23 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <cstdlib>
+#include <exception>
+
+void myterm() {
+ exit (0);
+}
+
+main() {
+ try {
+ throw "";
+ } catch (...) {
+ }
+ try {
+ std::set_terminate (myterm);
+ throw;
+ } catch (...) {
+ return 1;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh48.C b/gcc/testsuite/g++.old-deja/g++.mike/eh48.C
new file mode 100644
index 000000000..d9caf61b4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh48.C
@@ -0,0 +1,34 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <exception>
+#include <stdlib.h>
+
+using std::uncaught_exception;
+class A {
+public:
+ ~A() {
+ if (uncaught_exception ())
+ exit (0);
+ }
+};
+
+int main() {
+ if (uncaught_exception ())
+ return 1;
+ try {
+ throw "";
+ } catch (...) {
+ if (uncaught_exception ())
+ return 1;
+ }
+ if (uncaught_exception ())
+ return 1;
+ try {
+ A a;
+ throw "";
+ } catch (...) {
+ return 1;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh49.C b/gcc/testsuite/g++.old-deja/g++.mike/eh49.C
new file mode 100644
index 000000000..1380ca02d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh49.C
@@ -0,0 +1,15 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions -O9" }
+
+void main1() {
+ throw 1;
+}
+
+int main() {
+ try {
+ main1();
+ } catch (...) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh5.C b/gcc/testsuite/g++.old-deja/g++.mike/eh5.C
new file mode 100644
index 000000000..4ece58892
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh5.C
@@ -0,0 +1,21 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+class foo {
+public:
+ class error {};
+
+ void cause_error(void) { throw "Hello World!"; }
+};
+
+int main(void)
+{
+ foo f;
+ try {
+ f.cause_error();
+ }
+ catch (const char cp[]) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
new file mode 100644
index 000000000..de21dc2f4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
@@ -0,0 +1,21 @@
+// { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <exception>
+
+void my_unexpected() {
+ throw 42;
+}
+
+template <class T> void foo(T) throw (int) { throw "Hi"; }
+
+main() {
+ std::set_unexpected (my_unexpected);
+ try {
+ foo(1);
+ } catch (int i) {
+ if (i == 42)
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh51.C b/gcc/testsuite/g++.old-deja/g++.mike/eh51.C
new file mode 100644
index 000000000..073980a53
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh51.C
@@ -0,0 +1,21 @@
+// { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <exception>
+
+void my_unexpected() {
+ throw 42;
+}
+
+template <class T> void foo(T) throw (T) { throw "Hi"; }
+
+main() {
+ std::set_unexpected (my_unexpected);
+ try {
+ foo(1);
+ } catch (int i) {
+ if (i == 42)
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh52.C b/gcc/testsuite/g++.old-deja/g++.mike/eh52.C
new file mode 100644
index 000000000..18b477c09
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh52.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+// { dg-options "-fexceptions -O9" }
+
+int promote_mode (int mode, int *punsignedp)
+{
+ int unsignedp = *punsignedp;
+ *punsignedp = unsignedp;
+ return mode;
+}
+
+int main() {
+ int i;
+ i = promote_mode (42, &i);
+ return i != 42;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh53.C b/gcc/testsuite/g++.old-deja/g++.mike/eh53.C
new file mode 100644
index 000000000..5f2ff57ac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh53.C
@@ -0,0 +1,15 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions -g" }
+
+class zeroset {
+public:
+ ~zeroset () { }
+};
+
+int main () {
+ zeroset a;
+ try {
+ ;
+ } catch( zeroset ) {
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh54.C b/gcc/testsuite/g++.old-deja/g++.mike/eh54.C
new file mode 100644
index 000000000..56e57e0a4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh54.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions" }
+
+int main() { try { 1; } } // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh55.C b/gcc/testsuite/g++.old-deja/g++.mike/eh55.C
new file mode 100644
index 000000000..148268074
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh55.C
@@ -0,0 +1,19 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <exception>
+#include <stdlib.h>
+
+void my_terminate_handler() {
+ exit(0);
+}
+
+void throw_an_unexpected_exception() throw() {
+ throw 1;
+}
+
+int main() {
+ std::set_terminate(my_terminate_handler);
+ throw_an_unexpected_exception();
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh56.C b/gcc/testsuite/g++.old-deja/g++.mike/eh56.C
new file mode 100644
index 000000000..1b660fca1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh56.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+// { dg-options "-fexceptions" }
+
+struct A {
+ A() { }
+ A(const char *) { }
+ A(const A&) { }
+ ~A() { }
+};
+
+struct bmf {
+ bmf (const A n) { }
+ ~bmf (void) { }
+ A name;
+};
+
+void imf (void) {
+ bmf Sabs ("abs");
+}
+
+int main(void) {
+ imf ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh57.C b/gcc/testsuite/g++.old-deja/g++.mike/eh57.C
new file mode 100644
index 000000000..087b4131b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh57.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-fno-exceptions" }
+
+class Calendar_Time {
+public:
+ ~Calendar_Time ();
+ int operator <= (const Calendar_Time& t) const;
+};
+
+class Temporal_Model_Interval {
+public:
+ Calendar_Time start_time ();
+};
+
+int intersects_p (Temporal_Model_Interval* i1, Temporal_Model_Interval* i2) {
+ return ((i1->start_time() <= i2->start_time())
+ || (i1->start_time() <= i2->start_time()));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh58.C b/gcc/testsuite/g++.old-deja/g++.mike/eh58.C
new file mode 100644
index 000000000..9bc89260c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh58.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions" }
+
+struct C {
+ bool mem;
+ ~C();
+};
+
+C genTemp();
+
+int foo_notok(int arg) {
+ switch (arg) {
+ case 0:
+ return genTemp().mem;
+ default:
+ return 3;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh59.C b/gcc/testsuite/g++.old-deja/g++.mike/eh59.C
new file mode 100644
index 000000000..f2f2bb3bc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh59.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// { dg-options "-O -funroll-loops" }
+
+struct A {
+ ~A();
+};
+
+void foo();
+
+int main() {
+ for (int i=0;i<4;i++) {
+ A a;
+ foo();
+ }
+}
+
+void foo() { }
+A::~A() { }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh6.C b/gcc/testsuite/g++.old-deja/g++.mike/eh6.C
new file mode 100644
index 000000000..cc29ea595
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh6.C
@@ -0,0 +1,19 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+extern "C" int printf(const char *, ...);
+
+void main1() {
+ throw 1;
+}
+
+
+int main() {
+ try {
+ main1();
+ } catch (...) {
+ printf("Unwind works!\n");
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh7.C b/gcc/testsuite/g++.old-deja/g++.mike/eh7.C
new file mode 100644
index 000000000..f431fb96d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh7.C
@@ -0,0 +1,7 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+main() {
+ if (0)
+ throw 1 | 2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh8.C b/gcc/testsuite/g++.old-deja/g++.mike/eh8.C
new file mode 100644
index 000000000..8e01da0b5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh8.C
@@ -0,0 +1,20 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+extern "C" int printf(const char *, ...);
+
+int i;
+
+main() {
+ try {
+ try {
+ throw i;
+ } catch (char *) {
+ return 1;
+ }
+ return 1;
+ } catch (int i) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh9.C b/gcc/testsuite/g++.old-deja/g++.mike/eh9.C
new file mode 100644
index 000000000..633642faa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh9.C
@@ -0,0 +1,4 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+main() throw () { }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/enum1.C b/gcc/testsuite/g++.old-deja/g++.mike/enum1.C
new file mode 100644
index 000000000..35b1df089
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/enum1.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Warn if a enum cannot fit into a small bit-field.
+
+enum TypeKind { ATK, BTK, CTK, DTK } ;
+
+struct Type {
+ enum TypeKind kind : 1; // { dg-warning "" }
+ void setBTK();
+};
+
+void Type::setBTK() { kind = DTK; } // { dg-warning "truncate" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/err1.C b/gcc/testsuite/g++.old-deja/g++.mike/err1.C
new file mode 100644
index 000000000..8e15dd27a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/err1.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+struct gorf {
+ int stuff;
+ void snarf(); // { dg-error "" }
+};
+
+template <class T> void gorf::snarf() { return; } // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/err2.C b/gcc/testsuite/g++.old-deja/g++.mike/err2.C
new file mode 100644
index 000000000..9d8a596e6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/err2.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+class foo {
+public:
+ void apply(foo *(foo::*memptr)()) {
+ this->*memptr(); // { dg-error "" } wrong
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/err3.C b/gcc/testsuite/g++.old-deja/g++.mike/err3.C
new file mode 100644
index 000000000..18161b31f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/err3.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+class cb {
+};
+
+class cc {
+public:
+ cc()
+ : cb() { // { dg-error "" }
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/explicit1.C b/gcc/testsuite/g++.old-deja/g++.mike/explicit1.C
new file mode 100644
index 000000000..b8284abaa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/explicit1.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+struct A1 {
+ explicit A1(int) { }
+} a1(1);
+
+struct A {
+ explicit A(int);
+} a(1);
+
+A::A(int) {
+}
+
+void foo(A a) {
+ foo(a);
+ foo(1); // { dg-error "" } not allowed
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/explicit2.C b/gcc/testsuite/g++.old-deja/g++.mike/explicit2.C
new file mode 100644
index 000000000..989367f83
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/explicit2.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+class string {
+public:
+ string(const char*) { }
+ explicit string(int size) { }
+};
+
+void foo(string) { }
+
+string bar() {
+ foo("hello"); // ok
+ foo(string(2)); // ok
+ foo(2); // { dg-error "" } no implicit conversion from int to string
+ string x = 2; // { dg-error "" } no implicit conversion from int to string
+ string y(2); // ok
+ foo((string)2); // ok
+ return 2; // { dg-error "" } no implicit conversion from int to string
+}
+
+class A : string {
+public:
+ A() : string(2) { } // ok
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/for1.C b/gcc/testsuite/g++.old-deja/g++.mike/for1.C
new file mode 100644
index 000000000..0f2e543f8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/for1.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+int main() {
+ for( {int i = 0; int j = 0;} i < 10; ++i ) ; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/for2.C b/gcc/testsuite/g++.old-deja/g++.mike/for2.C
new file mode 100644
index 000000000..42e6baa55
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/for2.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+
+void foo() {
+ for (class C {};;)
+ ;
+ C c; // { dg-error "declared" "decl" }
+ // { dg-error "expected" "exp" { target *-*-* } 6 }
+}
+
+void bar() {
+ for (enum E {num};;)
+ ;
+ E e; // { dg-error "declared" "decl" }
+ // { dg-error "expected" "exp" { target *-*-* } 13 }
+}
+
+void bee () {
+ int i = 0;
+ for (int fun() = 0; i != 2; ++i) { // { dg-warning "extern" "extern" }
+ // { dg-error "initialized" "init" { target *-*-* } 19 }
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/for3.C b/gcc/testsuite/g++.old-deja/g++.mike/for3.C
new file mode 100644
index 000000000..80f66913b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/for3.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// { dg-options "-Wshadow" }
+
+int
+main(int i) { // { dg-warning "" } shadowed decl
+ for(int i=1; i < 3; i++); // { dg-warning "" } declaration of
+ for(int i=1; i < 3; i++); // { dg-warning "" } declaration of
+ for(int j=1; j < 3; j++);
+ for(int j=1; j < 3; j++);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/fresco1.C b/gcc/testsuite/g++.old-deja/g++.mike/fresco1.C
new file mode 100644
index 000000000..fe90eb7e7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/fresco1.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+// This is a Fresco found bug.
+
+class WhoCares {};
+
+typedef float Coord;
+
+class BugDemo : public WhoCares {
+public:
+ typedef Coord Matrix[4][4];
+ virtual void vf1(BugDemo::Matrix m) = 0;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/hog1.C b/gcc/testsuite/g++.old-deja/g++.mike/hog1.C
new file mode 100644
index 000000000..0dbbc0705
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/hog1.C
@@ -0,0 +1,188 @@
+// { dg-do run }
+class dummy { public: void operator++(void) {}
+ };
+class dummy_000 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_001 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_002 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_003 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_004 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_005 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_006 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_007 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_008 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_009 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_010 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_011 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_012 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_013 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_014 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_015 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_016 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_017 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_018 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_019 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_020 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_021 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_022 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_023 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_024 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_025 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_026 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_027 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_028 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_029 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_030 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_031 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_032 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_033 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_034 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_035 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_036 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_037 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_038 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_039 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_040 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_041 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_042 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_043 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_044 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_045 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_046 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_047 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_048 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+class dummy_049 : private virtual dummy { public: void operator++(void) {
+dummy::operator++(); } };
+
+class super :
+ private dummy_000, private dummy_001, private dummy_002, private
+dummy_003, private dummy_004,
+ private dummy_005, private dummy_006, private dummy_007, private
+dummy_008, private dummy_009,
+ private dummy_010, private dummy_011, private dummy_012, private
+dummy_013, private dummy_014,
+ private dummy_015, private dummy_016, private dummy_017, private
+dummy_018, private dummy_019,
+ private dummy_020, private dummy_021, private dummy_022, private
+dummy_023, private dummy_024,
+ private dummy_025, private dummy_026, private dummy_027, private
+dummy_028, private dummy_029,
+ private dummy_030, private dummy_031, private dummy_032, private
+dummy_033, private dummy_034,
+ private dummy_035, private dummy_036, private dummy_037, private
+dummy_038, private dummy_039,
+ private dummy_040, private dummy_041, private dummy_042, private
+dummy_043, private dummy_044,
+ private dummy_045, private dummy_046, private dummy_047, private
+dummy_048, private dummy_049
+{
+public:
+ void operator++(void);
+};
+
+void super::operator++(void)
+{
+ dummy_000::operator++();
+ dummy_001::operator++();
+ dummy_002::operator++();
+ dummy_003::operator++();
+ dummy_004::operator++();
+ dummy_005::operator++();
+ dummy_006::operator++();
+ dummy_007::operator++();
+ dummy_008::operator++();
+ dummy_009::operator++();
+ dummy_010::operator++();
+ dummy_011::operator++();
+ dummy_012::operator++();
+ dummy_013::operator++();
+ dummy_014::operator++();
+ dummy_015::operator++();
+ dummy_016::operator++();
+ dummy_017::operator++();
+ dummy_018::operator++();
+ dummy_019::operator++();
+ dummy_020::operator++();
+ dummy_021::operator++();
+ dummy_022::operator++();
+ dummy_023::operator++();
+ dummy_024::operator++();
+ dummy_025::operator++();
+ dummy_026::operator++();
+ dummy_027::operator++();
+ dummy_028::operator++();
+ dummy_029::operator++();
+ dummy_030::operator++();
+ dummy_031::operator++();
+ dummy_032::operator++();
+ dummy_033::operator++();
+ dummy_034::operator++();
+ dummy_035::operator++();
+ dummy_036::operator++();
+ dummy_037::operator++();
+ dummy_038::operator++();
+ dummy_039::operator++();
+ dummy_040::operator++();
+ dummy_041::operator++();
+ dummy_042::operator++();
+ dummy_043::operator++();
+ dummy_044::operator++();
+ dummy_045::operator++();
+ dummy_046::operator++();
+ dummy_047::operator++();
+ dummy_048::operator++();
+ dummy_049::operator++();
+}
+
+
+int main(void)
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/init1.C b/gcc/testsuite/g++.old-deja/g++.mike/init1.C
new file mode 100644
index 000000000..5bc1ea4a9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/init1.C
@@ -0,0 +1,28 @@
+// The VxWorks kernel has no implementation of atexit, so local statics
+// are never destroyed.
+// { dg-do run { xfail vxworks_kernel } }
+int count;
+
+extern "C" void _exit(int);
+
+struct C {
+ ~C() { if (count != 1) _exit(1); }
+} c;
+
+class A {
+public:
+ ~A () { ++count; }
+};
+
+void f() {
+ static A a;
+}
+
+void g() {
+ // Since this isn't constructed, we can't destruct it.
+ static A a;
+}
+
+int main () {
+ f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/init2.C b/gcc/testsuite/g++.old-deja/g++.mike/init2.C
new file mode 100644
index 000000000..81f6e4f1d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/init2.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+struct Foo {
+ Foo (int);
+};
+
+int bar (Foo);
+
+int x = bar (3);
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/leak1.C b/gcc/testsuite/g++.old-deja/g++.mike/leak1.C
new file mode 100644
index 000000000..403a73755
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/leak1.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+int count = 0;
+
+class T {
+ int i;
+public:
+ T() {
+ i = 1;
+ ++count;
+ }
+ T(const T& o) {
+ i = o.i;
+ ++count;
+ }
+ T operator +(const T& o) {
+ T r;
+ r.i = this->i + o.i;
+ return r;
+ }
+ operator int () {
+ return i;
+ }
+ ~T() {
+ --count;
+ }
+} s, b;
+
+void bar() {
+ static int j = int(s+b);
+ int i = int(s+b);
+}
+
+int i = int(s+b);
+
+int main() {
+ bar();
+ bar();
+ return count != 2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C b/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C
new file mode 100644
index 000000000..de5e96588
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+// Make sure the typedef name is used in name mangling, not some random
+// anonymous name
+
+struct foo {
+ typedef enum { red } color;
+ void bar(color r) {
+ }
+} f;
+
+#ifdef sparc
+void f1() asm("bar__3fooQ23foo3$_0");
+void f1() {
+}
+void f2() asm("_bar__3fooQ23foo3$_0");
+void f2() {
+}
+void f3() asm("__bar__3fooQ23foo3$_0");
+void f3() {
+}
+#endif
+
+main() {
+ f.bar(foo::red);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mangle2.C b/gcc/testsuite/g++.old-deja/g++.mike/mangle2.C
new file mode 100644
index 000000000..720c3c3ae
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/mangle2.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+typedef struct {
+} color;
+
+void foo(color) {
+}
+
+#ifdef sparc
+void f1() asm("foo__FG3$_0");
+void f1() { }
+void f2() asm("_foo__FG3$_0");
+void f2() { }
+void f3() asm("__foo__FG3$_0");
+void f3() { }
+#endif
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mangle3.C b/gcc/testsuite/g++.old-deja/g++.mike/mangle3.C
new file mode 100644
index 000000000..4b3e5812c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/mangle3.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+struct ZZ {
+ int p;
+};
+
+
+template <int ZZ::* ptr>
+struct YY {
+ ZZ qq;
+ YY() { }
+};
+
+int main() {
+ YY<&ZZ::p> ww;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mi1.C b/gcc/testsuite/g++.old-deja/g++.mike/mi1.C
new file mode 100644
index 000000000..e5f01c4d6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/mi1.C
@@ -0,0 +1,45 @@
+// { dg-do run }
+// { dg-options "-w" }
+
+class A {
+public:
+ virtual ~A(){};
+ virtual int type(void) {
+ return -1;
+ }
+};
+
+class B : public A {
+public:
+ virtual ~B(){};
+};
+
+
+class C0 : public B, public virtual A {
+public:
+ virtual int type(void) {
+ return 0;
+ }
+};
+
+class C1 : public C0
+{
+public:
+ virtual int type(void) {
+ return 1;
+ }
+};
+
+class C2 : public C0 {
+public:
+ virtual int type(void) {
+ return 2;
+ }
+};
+
+main() {
+ C1 *one = new C1;
+
+ if (one->type() != 1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mi2.C b/gcc/testsuite/g++.old-deja/g++.mike/mi2.C
new file mode 100644
index 000000000..51d8d2fa5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/mi2.C
@@ -0,0 +1,47 @@
+// { dg-do run }
+class A {
+ char a;
+public:
+ A(char x) : a(x) { }
+ virtual ~A() { }
+};
+
+class B : virtual public A {
+ char b;
+public:
+ B(char x) : A('b'), b(x) { }
+ ~B() { }
+};
+
+class C : virtual public A {
+ char c;
+public:
+ C(char x) : A('c'), c(x) { }
+ ~C() { }
+};
+
+class D : virtual public A, public B, public C {
+ char d;
+public:
+ D(char x) : A('d'), B('d'), C('d'), d(x) { }
+ ~D() { }
+};
+
+class E : virtual public A, public B, public C {
+ char e;
+public:
+ E(char x) : A('e'), B('e'), C('e'), e(x) { }
+ ~E() { }
+};
+
+class F : virtual public A, public D, public E {
+ char f;
+public:
+ F(char x) : A('f'), D('f'), E('f'), f(x) { }
+ ~F() { }
+};
+
+int main() {
+ F f('x');
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc1.C b/gcc/testsuite/g++.old-deja/g++.mike/misc1.C
new file mode 100644
index 000000000..7a6021856
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc1.C
@@ -0,0 +1,54 @@
+// { dg-do run }
+// GROUPS passed construct-destruct
+/* g++ constructs j 13 times, and destructs it once. */
+
+extern "C" {
+ int printf (const char *, ...);
+ void exit(int);
+}
+
+void foo() {
+}
+
+class C {
+ int val;
+ public:
+ static int count;
+ C(int ii) {
+ val = ii;
+ ++count;
+ printf("up\n");
+ }
+ ~C() {
+ --count;
+ printf("down\n");
+ }
+ int operator ++() {
+ return ++val;
+ }
+ operator int() {
+ return val;
+ }
+};
+
+int C::count = 0;
+
+void bar() {
+ for (int ii=0; ii<13; ++ii)
+ for (C j=1; j<9; ++j)
+ foo();
+}
+
+int main() {
+ bar();
+ if (C::count)
+ {
+ printf("FAIL\n");
+ exit(1);
+ }
+ else
+ {
+ printf("PASS\n");
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc11.C b/gcc/testsuite/g++.old-deja/g++.mike/misc11.C
new file mode 100644
index 000000000..23fc10a77
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc11.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+// GROUPS passed pt coredump
+template<class T> class A;
+void f () { A<int> *a; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc12.C b/gcc/testsuite/g++.old-deja/g++.mike/misc12.C
new file mode 100644
index 000000000..1ac53bb9a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc12.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// GROUPS passed
+struct A { virtual void f(); };
+struct B { virtual void f() ; };
+struct C : virtual A , virtual B { virtual void f(); };
+
+/* This used to get an error because the DECL_CONTEXT was blown away. */
+void g(A *ptr) { ptr->f(); }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc13.C b/gcc/testsuite/g++.old-deja/g++.mike/misc13.C
new file mode 100644
index 000000000..f85a4f408
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc13.C
@@ -0,0 +1,54 @@
+// { dg-do run }
+// GROUPS passed vtable
+extern "C" int printf (const char *, ...);
+enum E { vf_request, vf_event } want;
+
+int errs = 0;
+
+class ivResource {
+public:
+ virtual ~ivResource () { }
+};
+
+class ivHandler : public ivResource {
+public:
+ virtual void event() { }
+};
+
+class ivGlyph : public ivResource {
+public:
+ virtual ~ivGlyph () { }
+ virtual void request () {
+ if (want!=vf_request)
+ ++errs;
+ }
+};
+
+class ItemView : public ivGlyph, public ivHandler {
+public:
+ virtual void event () {
+ if (want!=vf_event)
+ ++errs;
+ }
+} a;
+
+ivGlyph *bar() {
+ return &a;
+}
+
+ivHandler *bar2() {
+ return &a;
+}
+
+int main() {
+ want=vf_request;
+ bar()->request();
+ want=vf_event;
+ bar2()->event();
+ if (errs) {
+ printf("FAIL\n");
+ return 1;
+ }
+ printf("PASS\n");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc14.C b/gcc/testsuite/g++.old-deja/g++.mike/misc14.C
new file mode 100644
index 000000000..6f966f211
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc14.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// GROUPS passed
+extern "C" int printf (const char *, ...);
+extern "C" void exit(int);
+
+class A {
+public:
+ virtual ~A() {
+ printf("FAIL\n");
+ exit (1);
+ }
+};
+
+class B : public A {
+public:
+ virtual ~B() {
+ printf("PASS\n");
+ exit (0);
+ }
+};
+
+int main() {
+ B b;
+ A *ap = &b;
+ ap->~A(); // This should call the destructor virtually.
+ printf("FAIL\n");
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc2.C b/gcc/testsuite/g++.old-deja/g++.mike/misc2.C
new file mode 100644
index 000000000..8ac736768
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc2.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// { dg-options "-ansi -pedantic" }
+// GROUPS passed
+/* -ansi -pedantic-errors should catch this. */
+
+class C {
+ public:
+ extern inline int A() {// { dg-error "" } .*
+ return 1;
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc3.C b/gcc/testsuite/g++.old-deja/g++.mike/misc3.C
new file mode 100644
index 000000000..560f0c13e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc3.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+// GROUPS uncaught
+int a;// { dg-error "" } .*
+int a;// { dg-error "" } .*
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc5.C b/gcc/testsuite/g++.old-deja/g++.mike/misc5.C
new file mode 100644
index 000000000..245c9a2ca
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc5.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// GROUPS uncaught
+// Cfront bug A.3 (See Language System Release Notes for the
+// SPARCompiler C++ version 3.0)
+
+struct S1 {
+ static int S1; // { dg-error "" } uses same name 9.3
+};
+struct S2 {
+ union { int ii; float S2; }; // { dg-error "" } uses same name 9.3
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc6.C b/gcc/testsuite/g++.old-deja/g++.mike/misc6.C
new file mode 100644
index 000000000..a717483b0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc6.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-prune-output "note" }
+// { dg-options "-std=c++98 -pedantic-errors" }
+
+// GROUPS uncaught
+// Cfront bug A.4 (See Language System Release Notes for the
+// SPARCompiler C++ version 3.0)
+
+struct assign {
+ assign& operator = (const assign&);
+};
+union U {
+ assign a; // { dg-error "" } member of union cannot have op= 9.4// ERROR - .*
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc7.C b/gcc/testsuite/g++.old-deja/g++.mike/misc7.C
new file mode 100644
index 000000000..34e0d3a37
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc7.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// GROUPS passed MI
+struct S1 { };
+
+struct S2 : S1 { };
+struct S3 : S1 { };
+
+struct S4 : S3, S2 { };
+
+struct S1 *p1;
+struct S4 *p4;
+
+void foobar ()
+{
+ p1 = p4; // { dg-error "" } this is illegal// ERROR - .*
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc8.C b/gcc/testsuite/g++.old-deja/g++.mike/misc8.C
new file mode 100644
index 000000000..d8852c7d3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc8.C
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+// GROUPS passed vtable
+class T { public: virtual ~T() {} };
+template<class P> class X : public virtual T {};
+int main() { X<int> x; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc9.C b/gcc/testsuite/g++.old-deja/g++.mike/misc9.C
new file mode 100644
index 000000000..3d8858cf6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc9.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// { dg-options "-Wall -pedantic" }
+// GROUPS passed qualifiers
+class bee {
+ public:
+ int bee::bar; // { dg-error "extra" } there is an extra bee:: here
+};
+
+class foo {
+ public:
+ int bee::bar; // { dg-error "not derived" } you cannot do this
+ int me();
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net1.C b/gcc/testsuite/g++.old-deja/g++.mike/net1.C
new file mode 100644
index 000000000..72b8e72d7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net1.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// Here is a net bug
+
+class ivAllocation {
+public:
+ ivAllocation();
+ int x_;
+};
+
+class TBScrollBoxInfo {
+public:
+ ivAllocation allocation_;
+};
+
+TBScrollBoxInfo* items_;
+
+inline TBScrollBoxInfo item() {
+ return items_[0];
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net10.C b/gcc/testsuite/g++.old-deja/g++.mike/net10.C
new file mode 100644
index 000000000..f200f9527
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net10.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "-pedantic-errors" }
+
+const int ci=10, *pc = &ci, *const cpc = pc, **ppc;
+int i, *p, *const cp = &i;
+
+int main()
+{
+ i = ci;
+ *cp = ci;
+ pc++;
+ pc = cpc;
+ pc = p;
+ ppc = &pc;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net11.C b/gcc/testsuite/g++.old-deja/g++.mike/net11.C
new file mode 100644
index 000000000..c9eeec134
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net11.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// { dg-options "-pedantic-errors" }
+
+struct Foo {
+ char *p;
+ const char *q;
+ void m() const;
+};
+
+void other(char &x);
+
+void
+Foo::m() const
+{
+ other(*p); // this is legal
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net12.C b/gcc/testsuite/g++.old-deja/g++.mike/net12.C
new file mode 100644
index 000000000..59e062a78
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net12.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// { dg-options "-pedantic-errors" }
+
+struct Foo {
+ char *p;
+ const char *q;
+ void m() const;
+};
+
+void other(char &x); // { dg-error "" } reference below
+
+void
+Foo::m() const
+{
+ other(*q); // { dg-error "" } this is bad
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net13.C b/gcc/testsuite/g++.old-deja/g++.mike/net13.C
new file mode 100644
index 000000000..acf1f65ba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net13.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+// make sure extern "C" friends work.
+
+extern "C" { void func(); }
+
+struct crash {
+ int i;
+ friend void func();
+} a;
+
+void func() {
+ a.i = 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net14.C b/gcc/testsuite/g++.old-deja/g++.mike/net14.C
new file mode 100644
index 000000000..36b2b236c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net14.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// this probably does not have correct debugging info generated.
+
+typedef struct Thing {
+ Thing();
+ int x;
+} Thing;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net15.C b/gcc/testsuite/g++.old-deja/g++.mike/net15.C
new file mode 100644
index 000000000..4d7129ee9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net15.C
@@ -0,0 +1,47 @@
+// { dg-do run }
+// InterViews (ibuild) requires this to work.
+
+extern "C" void exit(int);
+
+void *old;
+
+class c1
+{
+ int i;
+public:
+ c1 () {}
+};
+
+class c2
+{
+ int j;
+public:
+ c2 () {}
+};
+
+class c3 : public c1, public c2
+{
+public:
+ c3 ()
+ {
+ old = this;
+ // printf("new object c3 at %x\n", (int)this); }
+ }
+};
+
+c2* f ()
+{
+ c2* n = new c3 ();
+ // printf ("new object c3 casted to c2 at %x\n", (int)n);
+ return n;
+}
+
+int main ()
+{
+ c3* o = (c3*)f ();
+ // printf("new object c3, upcasted from c2 at %x\n", (int)o);
+ // if old and o are not the same, fail the test case.
+ if (old != o)
+ exit(1);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net16.C b/gcc/testsuite/g++.old-deja/g++.mike/net16.C
new file mode 100644
index 000000000..0f15f7133
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net16.C
@@ -0,0 +1,8 @@
+// { dg-do run }
+// On an i386, this core dumps because the reg-stack.c code is wrong, and
+// pops an fp register that it thinks is not used, but it is.
+
+extern "C" int printf (const char*, ...);
+struct S { ~S () { } };
+double f (S) { return 5; }
+int main() { S s; double dist = f (s); printf ("%g\n", dist); return 0; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net17.C b/gcc/testsuite/g++.old-deja/g++.mike/net17.C
new file mode 100644
index 000000000..56a3c24f3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net17.C
@@ -0,0 +1,59 @@
+// { dg-do run }
+// example from the ARM page 292 and 293
+
+extern "C" int printf(const char *, ...);
+extern "C" void exit(int);
+
+int i = 0;
+
+class A {
+public:
+ A() {
+ printf("Doing A\n");
+ if (++i != 1)
+ exit(1);
+ }
+};
+
+class B {
+public:
+ B() {
+ printf("Doing B\n");
+ if (++i != 2)
+ exit(1);
+ }
+};
+
+class C : public virtual A, public virtual B {
+public:
+ C() {
+ printf("Doing C\n");
+ if (++i != 3)
+ exit(1);
+ }
+};
+
+class D : public virtual B, public virtual A {
+public:
+ D() {
+ printf("Doing D\n");
+ if (++i != 4)
+ exit(1);
+ }
+};
+
+class E : public C, public D {
+public:
+ E() {
+ printf("Doing E\n");
+ if (++i != 5)
+ exit(1);
+ }
+} e;
+
+
+int main() {
+ if (++i != 6)
+ exit(1);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net18.C b/gcc/testsuite/g++.old-deja/g++.mike/net18.C
new file mode 100644
index 000000000..2123c8152
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net18.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+class ClassA {
+public:
+ typedef ClassA& (*PMFV)(const char*);
+ static PMFV setMapper(PMFV);
+ static PMFV _mapper;
+};
+
+class ClassB {
+public:
+ typedef ClassB& (*PMFV)(const char*);
+};
+
+ClassA::PMFV ClassA::setMapper(ClassA::PMFV newFunc)
+{
+ PMFV oldFunc = _mapper;
+ _mapper = newFunc;
+
+ return oldFunc;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net19.C b/gcc/testsuite/g++.old-deja/g++.mike/net19.C
new file mode 100644
index 000000000..028316680
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net19.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// Test to make sure &<incomplete record type> works in c++
+
+struct FILE {
+ int _flags;
+};
+
+extern struct _fake_filebuf __std_filebuf_2;
+
+class Value {
+ int width;
+public:
+ Value();
+ friend Value operator&( __const Value&, __const Value&);
+};
+
+FILE* Foo ()
+{
+ return ((FILE*)&__std_filebuf_2);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net2.C b/gcc/testsuite/g++.old-deja/g++.mike/net2.C
new file mode 100644
index 000000000..dfc57e149
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net2.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Here is another program from the net.
+
+class B;
+
+class A { // { dg-message "note" } copy ctor candidate
+ private:
+ A(B *); // { dg-message "note" }
+ public:
+ A(long); // { dg-message "note" }
+};
+
+A a(0); // { dg-error "ambiguous" }
+// { dg-message "candidate" "candidate note" { target *-*-* } 13 }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net20.C b/gcc/testsuite/g++.old-deja/g++.mike/net20.C
new file mode 100644
index 000000000..e972013a0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net20.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// A pointer to member function test case.
+
+struct X
+{
+};
+
+void (X::* fee ())()
+{
+ lab: goto lab;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net21.C b/gcc/testsuite/g++.old-deja/g++.mike/net21.C
new file mode 100644
index 000000000..dab95a6fc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net21.C
@@ -0,0 +1,60 @@
+// { dg-do run }
+// Make sure we can initialize complex (MI ambiguous) vtables.
+
+extern "C" int printf(const char *, ...);
+
+struct a
+{
+ virtual void f() = 0;
+};
+
+struct b
+{
+ virtual void g() { }
+};
+
+struct c: public a, public b
+{
+ virtual void f();
+ virtual void g();
+};
+
+void c::f()
+{
+ printf("c::f()\n");
+}
+
+void c::g()
+{
+ printf("c::g()\n");
+}
+
+struct e: public b
+{
+};
+
+struct h
+{
+};
+
+struct d: public c, public e, public h
+{
+ virtual void f();
+ virtual void g();
+};
+void d::f()
+{
+ printf("d::f()\n");
+}
+
+void d::g()
+{
+ printf("d::g()\n");
+}
+
+int main(int argc, char* argv[])
+{
+ a* tmp = new d;
+ tmp->f();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net22.C b/gcc/testsuite/g++.old-deja/g++.mike/net22.C
new file mode 100644
index 000000000..604aef9bc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net22.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+class Parent {
+public:
+ Parent() {}
+ Parent( char *s ) {}
+};
+
+class Child : public Parent { // { dg-message "note" } called
+};
+
+int main() {
+ Child c( "String initializer" ); // { dg-error "match" } bad
+ // { dg-message "candidate" "candidate note" { target *-*-* } 12 }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net23.C b/gcc/testsuite/g++.old-deja/g++.mike/net23.C
new file mode 100644
index 000000000..97120ea90
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net23.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+class environment {
+public:
+ int get_font() ;
+};
+
+typedef int (environment::*INT_FUNCP)();
+
+void myfoo(INT_FUNCP a);
+
+void init_env_requests()
+{
+ myfoo(&environment::get_font);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net24.C b/gcc/testsuite/g++.old-deja/g++.mike/net24.C
new file mode 100644
index 000000000..471785ffb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net24.C
@@ -0,0 +1,3 @@
+// { dg-do assemble }
+
+ char HexDigit(unsigned char ch) { return ch < 'f'; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net25.C b/gcc/testsuite/g++.old-deja/g++.mike/net25.C
new file mode 100644
index 000000000..57b66eafa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net25.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+void shake_zero()
+{
+}
+
+void shake_one()
+{
+}
+
+void (*foo)();
+
+int main(int a, char** /*argv*/)
+{
+ foo = a ? shake_zero : shake_one;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net26.C b/gcc/testsuite/g++.old-deja/g++.mike/net26.C
new file mode 100644
index 000000000..8d03278b9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net26.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// A test case found by InterViews testing...
+
+extern "C" int printf(const char *, ...);
+
+class A {
+public:
+ int foo() { printf("ok nv\n"); return 0; }
+ virtual int vfoo() { printf("ok v\n"); return 0; }
+};
+
+struct S {
+ int (A::*pfn1)();
+ int (A::*pfn2)();
+ int (A::*pfn3)();
+};
+
+// This failed before.
+S s = { &A::foo, &A::vfoo, &A::foo };
+
+A a;
+
+int main() {
+ (a.*s.pfn1)();
+ (a.*s.pfn2)();
+ printf("PASS\n");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net27.C b/gcc/testsuite/g++.old-deja/g++.mike/net27.C
new file mode 100644
index 000000000..8b1715330
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net27.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+class path {
+public:
+ path (const path& r)
+ { "\"";
+ '\'';
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net28.C b/gcc/testsuite/g++.old-deja/g++.mike/net28.C
new file mode 100644
index 000000000..5cac8563c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net28.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+// From reinhard@ifki50.informatik.fh-muenchen.de against gcc 2.5.0.
+// shows an InterViews problem on RS6000 and i386. Doesn't happen on
+// SPARC.
+
+// From fbrowser.c.
+
+
+class test {
+};
+
+
+typedef int ( test ::* test2)(int fd);
+
+class ivFileBrowserImpl_IOCallback
+{
+ public:
+
+ int inputReady(int fd);
+ test * _obj;
+ test2 _input;
+};
+
+
+int ivFileBrowserImpl_IOCallback ::inputReady(int fd)
+{
+ return (_obj->*_input)(fd);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net29.C b/gcc/testsuite/g++.old-deja/g++.mike/net29.C
new file mode 100644
index 000000000..1cce5a296
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net29.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// This is a test case for the recent libg++ make check problem.
+
+class SubString {
+public:
+ SubString();
+ SubString(const SubString& x);
+};
+
+class String {
+public:
+ String();
+ String(const SubString& x);
+};
+
+int operator!=(const String& x, const SubString& y);
+int operator!=(const String& x, const String& y);
+
+int operator!=(const SubString& x, const String& y);
+int operator!=(const SubString& x, const SubString& y);
+
+void comparetest()
+{
+ String x;
+ SubString s;
+ x != s;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net3.C b/gcc/testsuite/g++.old-deja/g++.mike/net3.C
new file mode 100644
index 000000000..7c89facdd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net3.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// Here is another program from the net.
+
+class BOOL {
+ public:
+ int val;
+
+ BOOL(int i =0);
+ operator int();
+};
+
+BOOL& foo()
+{
+ static BOOL status;
+ return status;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net30.C b/gcc/testsuite/g++.old-deja/g++.mike/net30.C
new file mode 100644
index 000000000..2a96ed7a0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net30.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+class X {
+public:
+ void x(void);
+};
+
+class Y : public X {
+};
+
+class Z : private Y {
+public:
+ void y(void);
+};
+
+void Z::y(void) {
+ x(); // should be OK
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net31.C b/gcc/testsuite/g++.old-deja/g++.mike/net31.C
new file mode 100644
index 000000000..8bc159b13
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net31.C
@@ -0,0 +1,68 @@
+// { dg-do assemble }
+
+class foo_a {
+ protected:
+ double func(int xi) {return 0.0;}
+ public:
+ foo_a() {}
+};
+
+class foo_b {
+ public:
+ foo_b(int);
+ foo_b();
+ ~foo_b();
+ foo_b(const foo_b&);
+ double& operator()(int);
+ foo_b& operator=(foo_b&);
+ void bar_a(int);
+};
+
+foo_b& operator*(foo_b&, foo_b&);
+foo_b& operator*(double, foo_b&);
+
+template <class TP>
+class foo_c {
+ typedef double (TP::* Tmatf)(int);
+ int m;
+ Tmatf* a;
+ void foo_cinst (int mm);
+ public:
+ foo_c(int mm);
+ foo_c() {m = 0; a = 0;}
+ ~foo_c() {delete a;}
+ double (TP::*& operator()(int i))(int) {return a[i];}
+ foo_b& bug_func(int);
+};
+
+template <class TP>
+foo_b& foo_c<TP>::bug_func(int x) {
+ static foo_b retval(m);
+ retval.bar_a(m);
+ for (register int i = 0; i < m; i++)
+ retval(i) = (*(operator()(i)))(x); // { dg-error "invalid use of unary '\\\*'" }
+ return retval;
+}
+
+template <class TP>
+class foo_d {
+ protected:
+ foo_c<TP> bar_b;
+ public:
+ foo_d() {}
+ virtual ~foo_d() {}
+ virtual void setfoo_c();
+};
+
+class foo_e : public foo_a, public foo_d<foo_a> {
+ public:
+ foo_e();
+ ~foo_e() {}
+ void setfoo_c();
+};
+
+void foo_e::setfoo_c() {
+ bar_b(0) = func; // { dg-error "" }
+}
+
+template class foo_c<foo_a>;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net32.C b/gcc/testsuite/g++.old-deja/g++.mike/net32.C
new file mode 100644
index 000000000..43c1ed141
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net32.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+class Co_obj {
+public:
+ Co_obj() {}
+ };
+class Linear_list_node : virtual public Co_obj { };
+class M1 : public Linear_list_node { };
+class M2 : public Linear_list_node { };
+class New_node : public M1, public M2 { };
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net34.C b/gcc/testsuite/g++.old-deja/g++.mike/net34.C
new file mode 100644
index 000000000..19a7e16ba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net34.C
@@ -0,0 +1,41 @@
+// { dg-do run }
+// { dg-options "" }
+
+#include <iostream>
+
+class foo {
+public:
+ foo(int i) {k = i;}
+protected:
+ int k;
+};
+
+class bar_1 : public foo {
+public:
+ bar_1(int i) : foo(i) {}
+ int get_k() {return k;}
+};
+
+class bar_2 : public foo {
+public:
+ bar_2(int i) : foo(i) {}
+ int get_k() {return k;}
+};
+
+class multiple : public bar_1, public bar_2 {
+public:
+ multiple(int i1, int i2) : bar_1(i1), bar_2(i2) {}
+ void print() {
+ std::cout << "bar_1::k -> " << bar_1::k << "\n";
+ std::cout << "bar_2::k -> " << bar_2::k << "\n";
+ std::cout << "bar_1::get_k() -> " << bar_1::get_k() << "\n";
+ std::cout << "bar_2::get_k() -> " << bar_2::get_k() << "\n";
+ }
+};
+
+int main() {
+ multiple m(1,2);
+ m.print();
+}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net35.C b/gcc/testsuite/g++.old-deja/g++.mike/net35.C
new file mode 100644
index 000000000..bded913c0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net35.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+extern "C" int printf(const char *, ...);
+
+class A {
+ public:
+ char *x;
+};
+
+class B1:public virtual A { };
+
+class B2:public virtual A { };
+
+class C:public B1, public B2 {
+public:
+ C() { }
+};
+
+int main() {
+ C c;
+ printf("&c.x = %x\n", &c.x);
+ printf("&c.B1::x = %x\n", &c.B1::x);
+ printf("&c.B2::x = %x\n", &c.B2::x);
+ printf("&c.A::x = %x\n", &c.A::x);
+ if (&c.x != &c.B1::x
+ || &c.x != &c.B2::x
+ || &c.x != &c.A::x)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net36.C b/gcc/testsuite/g++.old-deja/g++.mike/net36.C
new file mode 100644
index 000000000..3ffa60e37
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net36.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+class X;
+
+class A {
+public:
+ void handlerFn(X*);
+};
+
+typedef void (A::*handler) (X*);
+
+class B {
+public:
+ void setHandler(handler);
+};
+
+void f(B* b) {
+ b->setHandler(A::handlerFn); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net37.C b/gcc/testsuite/g++.old-deja/g++.mike/net37.C
new file mode 100644
index 000000000..35f3bca40
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net37.C
@@ -0,0 +1,40 @@
+// { dg-do run }
+class B {
+public:
+ int bi;
+ void bProc ( void ) { bi = 39; }
+ };
+
+class D : public B {
+public:
+ int di;
+ void dProc (void ){ di = 42; }
+ };
+
+typedef void (B::*BPROC)(void);
+typedef void (D::*DPROC)(void);
+
+union AFX_PMSG {
+public:
+
+ AFX_PMSG () {}
+ AFX_PMSG ( BPROC bpr ) { bfn = bpr ; }
+
+ operator BPROC() { return bfn; }
+
+ BPROC bfn;
+ DPROC dfn;
+};
+
+
+int main(int argc, char *argv[]) {
+ B b;
+ D d;
+
+ BPROC bpr = &B::bProc;
+ AFX_PMSG pmsg(bpr);
+
+ BPROC ppr = pmsg;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net38.C b/gcc/testsuite/g++.old-deja/g++.mike/net38.C
new file mode 100644
index 000000000..de00a15fb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net38.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+struct A {
+ virtual int a () { return 0; }
+};
+
+struct B {
+ virtual int b () { return 0; }
+ virtual int b2 () { return 0; }
+};
+
+struct C : public A, public B {
+ virtual int a () { return 1; }
+ virtual int b () { return 2; }
+ virtual int b2 () { return 3; }
+};
+
+int (C::*vmpb) () = &C::b;
+int (C::*vmpb2) () = &C::b2;
+int (C::*vmpa) () = &C::a;
+
+int main () {
+ C c;
+ if ((c.*vmpa)() != 1)
+ return 1;
+ if ((c.*vmpb)() != 2)
+ return 1;
+ if ((c.*vmpb2)() != 3)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net39.C b/gcc/testsuite/g++.old-deja/g++.mike/net39.C
new file mode 100644
index 000000000..6554b3359
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net39.C
@@ -0,0 +1,31 @@
+// { dg-do run }
+void *vp;
+
+class silly {
+public:
+ virtual int b() { return 1; }
+};
+class solly : silly {
+public:
+ virtual int b() { return 2; }
+};
+class thing {
+public:
+ virtual int a() { return 3; }
+};
+class thong : public solly, public thing {
+public:
+ virtual int a() {
+ if (this != vp) return 4;
+ else return 0;
+ }
+};
+
+typedef int(thing::*ping)();
+ping qq = &thing::a;
+
+int main() {
+ thong b;
+ vp = &b;
+ return (b.*qq)();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net4.C b/gcc/testsuite/g++.old-deja/g++.mike/net4.C
new file mode 100644
index 000000000..cc6712f0a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net4.C
@@ -0,0 +1,32 @@
+// { dg-do assemble }
+// Message-Id: <m0lLuUK-0000fRC@nix.appli.se>
+// Date: Wed, 4 Mar 92 12:50 MET
+// From: niklas@appli.se (Niklas Hallqvist)
+// To: eichin@cygnus.com, tiemann@cygnus.com
+// Cc: gcc2@cygnus.com
+// Subject: nested type handling
+//
+// The last couple of days I've been struggling with nested types in the
+// C++ compiler. Frankly, it's a mess! Was it impossible to put the stuff
+// into the parser instead of the lexer? Well, anyway, to get the following
+// code to compile:
+//
+// struct O {
+// struct M {
+// struct I
+// {};
+// };
+// };
+// O::M::I s;
+//
+// a patch enclosed below is needed. I'm not sure if it causes any
+// unanticipated side-effects, but it seem to work well for me.
+
+
+struct O {
+ struct M {
+ struct I
+ {};
+ };
+};
+O::M::I s;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net40.C b/gcc/testsuite/g++.old-deja/g++.mike/net40.C
new file mode 100644
index 000000000..2a87a0c0e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net40.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+#include <stddef.h>
+#include <stdlib.h>
+
+class toto {
+public:
+ void * operator new (size_t t) {
+ abort();
+ }
+ void operator delete (void*p, size_t t) {
+ abort();
+ }
+};
+
+int main() {
+ toto * p;
+ p = new toto[5];
+ delete [] p;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net41.C b/gcc/testsuite/g++.old-deja/g++.mike/net41.C
new file mode 100644
index 000000000..4180778e4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net41.C
@@ -0,0 +1,4 @@
+// { dg-do run }
+int main() {
+ int i = ~ false;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net42.C b/gcc/testsuite/g++.old-deja/g++.mike/net42.C
new file mode 100644
index 000000000..1205812c9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net42.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+
+typedef void (*__sighandler_t)(int);
+
+struct sigaction {
+ __sighandler_t sa_handler;
+};
+
+struct task_struct {
+ struct sigaction sigaction[32];
+};
+
+void
+get_stat() {
+ struct task_struct ** p = 0;
+ unsigned long bit = 1;
+ unsigned long sigignore = 0;
+ int i = 0;
+ switch((__SIZE_TYPE__) (*p)->sigaction[i].sa_handler)
+ {
+ case 1:
+ sigignore |= bit;
+ break;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net43.C b/gcc/testsuite/g++.old-deja/g++.mike/net43.C
new file mode 100644
index 000000000..aadd03de9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net43.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// { dg-options "-ffriend-injection" }
+
+class foo {
+ public:
+ friend int operator ^(const foo&, const foo&);
+};
+
+int main ()
+{
+ int (*funptr) (const foo &, const foo &) = operator ^;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net44.C b/gcc/testsuite/g++.old-deja/g++.mike/net44.C
new file mode 100644
index 000000000..bc45b4878
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net44.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Make sure we don't dump core
+
+enum request { q, w, e}; // { dg-error "" }
+
+class request { // { dg-error "" }
+public:
+ int a;
+ request( int b) {
+ a = b;
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net45.C b/gcc/testsuite/g++.old-deja/g++.mike/net45.C
new file mode 100644
index 000000000..9d423aa41
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net45.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+template <class T1, class T2>
+struct pair {
+ T1 first;
+ T2 second;
+ pair(const T1& a, const T2& b) : first(a), second(b) {}
+};
+
+struct myint {
+ myint() {
+ }
+ myint(const myint& mi) {
+ }
+ myint& operator=(const myint& mi) { return *this; }
+};
+
+extern pair<const myint, myint> a;
+pair<const myint, myint> b(a);
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net46.C b/gcc/testsuite/g++.old-deja/g++.mike/net46.C
new file mode 100644
index 000000000..174022852
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net46.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+#include <iostream>
+#include <cstdlib>
+#include <cstddef>
+#include <new>
+
+int fail = 1;
+
+int in_main = 0;
+
+void *operator new(size_t size) throw (std::bad_alloc) {
+ if (!in_main) return malloc (size);
+ --fail;
+ return (void*) 0;
+}
+
+int main() {
+ std::cout << "";
+ in_main = 1;
+ new int;
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net47.C b/gcc/testsuite/g++.old-deja/g++.mike/net47.C
new file mode 100644
index 000000000..026211012
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net47.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// { dg-options "-w -fpermissive" }
+
+class foo {};
+class bar : foo {
+public:
+ bar () : () {}
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net48.C b/gcc/testsuite/g++.old-deja/g++.mike/net48.C
new file mode 100644
index 000000000..2553fab1d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net48.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+const char *a="aê";
+
+class A
+{
+public:
+ A()
+ {
+ const char *b="aê";
+ }
+};
+
+const char *c="aê";
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net6.C b/gcc/testsuite/g++.old-deja/g++.mike/net6.C
new file mode 100644
index 000000000..d96b5dd39
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net6.C
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+struct X {};
+X x = X(); // { dg-bogus "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net7.C b/gcc/testsuite/g++.old-deja/g++.mike/net7.C
new file mode 100644
index 000000000..f0ef4c0f8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net7.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+// This should compile.
+
+int foo (signed char *);
+int foo (char *);
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net8.C b/gcc/testsuite/g++.old-deja/g++.mike/net8.C
new file mode 100644
index 000000000..09f9c30a8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net8.C
@@ -0,0 +1,32 @@
+// { dg-do assemble }
+// { dg-options "-pedantic-errors" }
+
+class Base {
+public:
+ int foo;
+};
+
+class Derived : public Base {
+public:
+ int bar;
+};
+
+void func(Base&); // { dg-error "passing argument 1" }
+
+void func2(const Derived& d) {
+ func(d); // { dg-error "invalid initialization" }
+}
+
+void
+foo (int& a) // { dg-error "in passing argument 1" }
+{
+}
+
+int main ()
+{
+ int b;
+ const int*const a = &b;
+ *a = 10; // { dg-error "read-only location" }
+ foo (*a); // { dg-error "invalid initialization" }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net9.C b/gcc/testsuite/g++.old-deja/g++.mike/net9.C
new file mode 100644
index 000000000..774690c97
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net9.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "-pedantic-errors" }
+
+const int ci=10, *pc = &ci, *const cpc = pc, **ppc;
+int i, *p, *const cp = &i;
+
+int main()
+{
+ ci = 1; // { dg-error "" } bad
+ ci++; // { dg-error "" } bad
+ *pc = 2; // { dg-error "" } bad
+ cp = &ci; // { dg-error "" } bad
+ cpc++; // { dg-error "" } bad
+ p = pc; // { dg-error "" } bad
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns1.C b/gcc/testsuite/g++.old-deja/g++.mike/ns1.C
new file mode 100644
index 000000000..c92ea944a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns1.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+namespace Foo {
+ int bar() {
+ return 0;
+ }
+}
+
+using namespace Foo;
+
+int main() {
+ bar();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns10.C b/gcc/testsuite/g++.old-deja/g++.mike/ns10.C
new file mode 100644
index 000000000..73e3cfd72
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns10.C
@@ -0,0 +1,10 @@
+// { dg-do run }
+namespace Foo {
+ int bar() {
+ return 0;
+ }
+}
+
+int main() {
+ return Foo::bar();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns11.C b/gcc/testsuite/g++.old-deja/g++.mike/ns11.C
new file mode 100644
index 000000000..c9d2c7bb2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns11.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+class Foo {
+};
+
+namespace A {
+ namespace Foo {
+ int bar() {
+ return 0;
+ }
+ }
+
+ int mymain() {
+ return Foo::bar();
+ }
+}
+
+int main() {
+ return A::mymain();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns12.C b/gcc/testsuite/g++.old-deja/g++.mike/ns12.C
new file mode 100644
index 000000000..76e187243
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns12.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+namespace {
+ int i = 10;
+ enum fish { one = 1, two = 2, red = 3, blue = 4 };
+}
+extern "C" int printf (const char *, ...);
+int main(void)
+{
+ if (i != 10) {
+ return 1;
+ }
+ if (one != 1) {
+ return 2;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns13.C b/gcc/testsuite/g++.old-deja/g++.mike/ns13.C
new file mode 100644
index 000000000..23a10469a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns13.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+namespace N {
+ struct C {
+ C();
+ };
+}
+
+namespace M {
+ struct C {
+ C();
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns14.C b/gcc/testsuite/g++.old-deja/g++.mike/ns14.C
new file mode 100644
index 000000000..463131d56
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns14.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+namespace Jazz {
+ int horn( int h ) { return 1; }
+}
+
+using Jazz::horn;
+
+namespace Jazz {
+ int horn ( char c ) { return 0; }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns15.C b/gcc/testsuite/g++.old-deja/g++.mike/ns15.C
new file mode 100644
index 000000000..4e767b836
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns15.C
@@ -0,0 +1,32 @@
+// { dg-do assemble }
+// { dg-xfail-if "" { xstormy16-*-* } { "*" } { "" } }
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define MAX 256
+#define MAXSTATE 1000000
+
+struct R {
+ int count;
+ int state1;
+ int state2;
+};
+
+int cmp_d(const R* a, const R* b) {
+ return a->count > b->count;
+}
+
+namespace CXX {
+ template<class T, long i1, long i2>
+ inline void qsort (T b[i1][i2], int (*cmp)(const T*, const T*)) {
+ ::qsort ((void*)b, i1*i2, sizeof(T), (int (*)(const void *, const void *))cmp);
+ }
+}
+
+using namespace CXX;
+
+void sort_machine() {
+ struct R d[MAX][MAX];
+ qsort<R,MAX> (d, cmp_d);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns2.C b/gcc/testsuite/g++.old-deja/g++.mike/ns2.C
new file mode 100644
index 000000000..8b5aedc1c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns2.C
@@ -0,0 +1,10 @@
+// { dg-do run }
+namespace N {
+ int i;
+}
+
+using namespace N;
+
+int main() {
+ return i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns3.C b/gcc/testsuite/g++.old-deja/g++.mike/ns3.C
new file mode 100644
index 000000000..eb40fe4ae
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns3.C
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+int i; // { dg-error "" }
+
+namespace i { // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns4.C b/gcc/testsuite/g++.old-deja/g++.mike/ns4.C
new file mode 100644
index 000000000..b1e7ee9a1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns4.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+namespace i {
+}
+namespace i {
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns5.C b/gcc/testsuite/g++.old-deja/g++.mike/ns5.C
new file mode 100644
index 000000000..fd1fbffce
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns5.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+namespace A {
+ int i = 1; // { dg-message "A::i" }
+}
+
+int j = i; // { dg-error "" }
+ // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 6 }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns6.C b/gcc/testsuite/g++.old-deja/g++.mike/ns6.C
new file mode 100644
index 000000000..275e7ba85
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns6.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+namespace A {
+ int i = 1;
+}
+
+namespace A {
+ int j = i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns7.C b/gcc/testsuite/g++.old-deja/g++.mike/ns7.C
new file mode 100644
index 000000000..67d9e7741
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns7.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+namespace A {
+ int i = 1; // { dg-message "A::i" }
+}
+
+namespace B {
+ int j = i; // { dg-error "" }
+ // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 8 }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns9.C b/gcc/testsuite/g++.old-deja/g++.mike/ns9.C
new file mode 100644
index 000000000..84f7a133e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns9.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+namespace Foo {
+ int bar() {
+ return 0;
+ }
+}
+
+using Foo::bar;
+
+int main() {
+ return bar();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/offset1.C b/gcc/testsuite/g++.old-deja/g++.mike/offset1.C
new file mode 100644
index 000000000..b0ddc7b54
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/offset1.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+extern "C" int printf(const char *, ...);
+void *vp;
+int fail = 0;
+
+class Foo {
+public:
+ virtual void setName() {
+ printf("Foo at %x\n", this);
+ if (vp != (void*)this)
+ fail = 1;
+ }
+};
+
+class Bar : public Foo {
+public:
+ virtual void init(int argc, char **argv) {
+ printf("Bar's Foo at %x\n", (Foo*)this);
+ vp = (void*)(Foo*)this;
+ setName();
+ }
+};
+
+class Barf : virtual public Bar {
+public:
+ virtual void init(int argc, char **argv) { Bar::init(argc, argv); }
+};
+
+class Baz : virtual public Bar, virtual public Barf {
+public:
+ virtual void init(int argc, char **argv) { Barf::init(argc, argv); }
+};
+
+Bar *theBar = new Baz();
+
+int main(int argc, char **argv) {
+ theBar->init(argc, argv);
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/opr-as1.C b/gcc/testsuite/g++.old-deja/g++.mike/opr-as1.C
new file mode 100644
index 000000000..9133d748c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/opr-as1.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+// Shows a problem with the default op= not being an implementation...
+
+class C {
+ int i;
+};
+
+C a, b;
+
+int main() {
+ a = b;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/opr-dot1.C b/gcc/testsuite/g++.old-deja/g++.mike/opr-dot1.C
new file mode 100644
index 000000000..a761a40c2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/opr-dot1.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+
+typedef struct base1 {
+ int x;
+} base1_t;
+
+typedef struct base2 {
+ int x;
+} base2_t;
+
+class derived1 : public base1 {
+};
+
+class derived2 : public derived1, public base2 {
+};
+
+struct test {
+ derived2& fails;
+ void test1() {
+ fails.base1::x = 5;
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10148.C b/gcc/testsuite/g++.old-deja/g++.mike/p10148.C
new file mode 100644
index 000000000..2cb359c9b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p10148.C
@@ -0,0 +1,35 @@
+// { dg-do run }
+// { dg-options "" }
+// prms-id: 10148
+
+int fail = 1;
+void ok() { fail = 0; }
+
+class TC {
+ int s_;
+};
+
+class TIRD {
+ public:
+ void (*itc)();
+ TIRD() { itc = ok; }
+};
+
+class TCCB : public TC, public TIRD {
+};
+
+class TCRCB : public TCCB {
+public:
+ virtual void eat ();
+};
+
+void TCRCB::eat () {
+ void *vp = (void *)((TIRD*)this)->itc;
+ this->itc();
+}
+
+int main() {
+ TCRCB a;
+ a.eat();
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10247.C b/gcc/testsuite/g++.old-deja/g++.mike/p10247.C
new file mode 100644
index 000000000..76eaebf0e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p10247.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// prms-id: 10247
+
+class a {
+public:
+ int operator++(int) { return operator()++ ; } // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10416.C b/gcc/testsuite/g++.old-deja/g++.mike/p10416.C
new file mode 100644
index 000000000..2d21d19dd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p10416.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// { dg-xfail-if "" { sparc64-*-elf arm-*-pe } { "*" } { "" } }
+// { dg-options "-fexceptions" }
+// prms-id: 10416
+
+class not_ok {
+public:
+ void f() throw(int) { }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10511.C b/gcc/testsuite/g++.old-deja/g++.mike/p10511.C
new file mode 100644
index 000000000..2adce9131
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p10511.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// prms-id: 10511
+
+class S {
+public:
+ enum E {a, b, c};
+};
+
+class C {
+public:
+ bool f (S::E()) { return true; }
+ virtual void foo();
+};
+
+void C::foo() { }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10769b.C b/gcc/testsuite/g++.old-deja/g++.mike/p10769b.C
new file mode 100644
index 000000000..9210a452a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p10769b.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// { dg-options "" }
+// prms-id: 10769
+
+#define PMF2PF(PMF) ((void (*)())(PMF))
+
+class A {
+public:
+ void f1a() { }
+ void main();
+} a;
+
+class B {
+public:
+ void bf1() { }
+} b;
+
+void A::main() {
+ void (B::*mPtrB)(B*);
+ (*(void (*)(A*))PMF2PF(mPtrB))(&b); // { dg-error "argument passing" }
+ // { dg-warning "convert" "warn" { target *-*-* } 20 }
+}
+
+int main() {
+ void (A::*mPtr)() = &A::f1a;
+ (*(void (*)(A*))PMF2PF(mPtr))(&a); // { dg-warning "convert" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10849a.C b/gcc/testsuite/g++.old-deja/g++.mike/p10849a.C
new file mode 100644
index 000000000..96bb064b5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p10849a.C
@@ -0,0 +1,34 @@
+// { dg-do run }
+// prms-id: 10849
+
+struct A
+{
+ int comm;
+ A(int i) : comm(i) { }
+};
+
+struct S1 { char c1; };
+
+struct B : public S1, public A
+{
+ B(int i) : A(i) { }
+};
+
+struct C : public A
+{
+ C(int i) : A(i) { }
+};
+
+struct D : public B, public C
+{
+ virtual int g() {
+ int D::*pmd = (int C::*)&C::comm;
+ return (this->*pmd) == 42;
+ }
+ D() : B(41), C(42) { }
+} d;
+
+int main() {
+ if (! d.g())
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10951.C b/gcc/testsuite/g++.old-deja/g++.mike/p10951.C
new file mode 100644
index 000000000..352b1a958
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p10951.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// prms-id: 10951
+
+inline int m1(const int& a) {
+ return 1;
+}
+
+template <class T>
+class A {
+public:
+ typedef int st;
+
+ static int m2t() {
+ return m1(1);
+ }
+};
+
+A<int>::st i;
+int m3() {
+ return A<int>::m2t();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11012.C b/gcc/testsuite/g++.old-deja/g++.mike/p11012.C
new file mode 100644
index 000000000..b851f2c44
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p11012.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-Wno-pmf-conversions" }
+// prms-id: 11012
+
+class Foo {
+public:
+ int f(){ return 0; }
+};
+
+void foo() {
+ void *p1 = &Foo::f;
+ const void *p2 = &Foo::f;
+ int (*p3)() = &Foo::f;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11110.C b/gcc/testsuite/g++.old-deja/g++.mike/p11110.C
new file mode 100644
index 000000000..7e3a1ffa3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p11110.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// prms-id: 11110
+
+class data;
+
+class conatiner {
+public:
+ virtual void* first ();
+ virtual data* contents (void* i); // { dg-message "conatiner::contents|no known conversion" }
+};
+
+class user {
+public:
+ data* data1 () const;
+private:
+ conatiner& _c;
+};
+
+data* user::data1() const {
+ return (_c.contents (_c.first)); // { dg-error "match" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 20 }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11142.C b/gcc/testsuite/g++.old-deja/g++.mike/p11142.C
new file mode 100644
index 000000000..9fee770f8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p11142.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions -O -g" }
+// prms-id: 11142
+
+class RWxmsg {
+public:
+ RWxmsg();
+ virtual ~RWxmsg();
+};
+
+class RWTHRInternalError : public RWxmsg {
+public:
+ virtual ~RWTHRInternalError() { }
+};
+
+void setCount(int count) {
+ throw RWTHRInternalError();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11144.C b/gcc/testsuite/g++.old-deja/g++.mike/p11144.C
new file mode 100644
index 000000000..cd1483eba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p11144.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// { dg-options "-O" }
+// prms-id: 11144
+
+class Id {
+public:
+ int d_i;
+ Id(int i) : d_i(i) {}
+ int value() {return d_i;}
+} ID(1);
+
+Id foo() { return ID; }
+
+int main() {
+ const Id &id1 = foo();
+ const Id &id2 = foo();
+ return &id1 == &id2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11482.C b/gcc/testsuite/g++.old-deja/g++.mike/p11482.C
new file mode 100644
index 000000000..ff5e7bad2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p11482.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// prms-id: 11482
+
+void *vp;
+
+enum E { bad, ok } e;
+
+void foo() {
+ e = (E)vp; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11667.C b/gcc/testsuite/g++.old-deja/g++.mike/p11667.C
new file mode 100644
index 000000000..802c0cf9b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p11667.C
@@ -0,0 +1,62 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+// prms-id: 11667
+
+extern "C" int printf(const char *,...);
+
+template < class T >
+class LIST {
+public:
+
+ LIST() { nitems = 16; items = new T[nitems]; };
+
+ LIST(int u) { nitems = u; items = new T[nitems]; };
+
+ T& operator[](int i) const {
+ return items[i];
+ }
+
+ void grow(int n) {
+ T* newlist = new T[n];
+ T* src = items;
+ T* dst = newlist;
+ int i = nitems;
+
+ try {
+ while (i--) *dst++ = *src++;
+ } catch (...) {
+ delete[] newlist;
+ throw;
+ }
+
+ if (items) delete[] items;
+ nitems = n;
+ items = newlist;
+ }
+
+private:
+ int nitems;
+ T *items;
+};
+
+int main(int argc, char **argv) {
+ int i;
+ LIST<int> mylist(10);
+
+ printf("Start dumping initial 10 item list\n");
+ for (i = 0; i < 10 ; i++) {
+ mylist[i] = i;
+ printf("%d\n", mylist[i]);
+ }
+
+ printf("Growing list to 20\n");
+ mylist.grow(20);
+
+ printf("Start dumping grown 20 item list\n");
+ for (i = 0; i < 20; i++) {
+ mylist[i] = i;
+ printf("%d\n", mylist[i]);
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p12306.C b/gcc/testsuite/g++.old-deja/g++.mike/p12306.C
new file mode 100644
index 000000000..6309016a3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p12306.C
@@ -0,0 +1,76 @@
+// { dg-do run }
+// prms-id: 12306
+
+void *ptr1, *ptr2;
+int fail = 0;
+
+extern "C" int printf(const char *...);
+
+class RWSlist { };
+
+class RWSlistIterator {
+public:
+ RWSlist *slist;
+ RWSlistIterator(RWSlist& s) { }
+ void toLast() {
+ if (ptr1 != (RWSlistIterator*)this)
+ fail = 5;
+ if (ptr2 != &(*this).slist)
+ fail = 6;
+
+ if (0) printf("at %x %x\n", (RWSlistIterator*)this, &(*this).slist);
+ }
+};
+
+class RWCollectable {
+};
+
+class RWSlistCollectables : public RWSlist {
+public:
+ RWSlistCollectables() { }
+ RWSlistCollectables(RWCollectable* a) { }
+};
+
+class RWIterator { };
+
+class RWSlistCollectablesIterator : public RWIterator, public RWSlistIterator {
+public:
+ RWSlistCollectablesIterator(RWSlistCollectables& s) : RWSlistIterator(s) { }
+};
+
+class Sim_Event_Manager {
+public:
+ RWSlistCollectables scheduled_events_;
+ RWSlistCollectablesIterator last_posted_event_position_;
+ Sim_Event_Manager();
+ void post_event();
+};
+
+Sim_Event_Manager::Sim_Event_Manager ()
+ :last_posted_event_position_(scheduled_events_)
+{
+}
+
+void Sim_Event_Manager::post_event () {
+ ptr1 = (RWSlistIterator*)&last_posted_event_position_;
+ ptr2 = &((RWSlistIterator*)&last_posted_event_position_)->slist;
+ if (0) printf("at %x %x\n", (RWSlistIterator*)&last_posted_event_position_,
+ &((RWSlistIterator*)&last_posted_event_position_)->slist);
+ if (ptr1 != (RWSlistIterator*)&last_posted_event_position_)
+ fail = 1;
+ if (ptr2 != &((RWSlistIterator&)last_posted_event_position_).slist)
+ fail = 2;
+ if (0) printf("at %x ?%x\n", (RWSlistIterator*)&last_posted_event_position_,
+ &((RWSlistIterator&)last_posted_event_position_).slist);
+ if (ptr1 != (RWSlistIterator*)&last_posted_event_position_)
+ fail = 3;
+ if (ptr2 != &((RWSlistIterator&)last_posted_event_position_).slist)
+ fail = 4;
+ last_posted_event_position_.toLast();
+}
+
+int main(int argc, char **argv) {
+ Sim_Event_Manager foo;
+ foo.post_event();
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p12306a.C b/gcc/testsuite/g++.old-deja/g++.mike/p12306a.C
new file mode 100644
index 000000000..8e47837c6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p12306a.C
@@ -0,0 +1,36 @@
+// { dg-do run }
+// prms-id: 12306
+// a net report of the same problem as 12306
+
+class a {
+public:
+ int i;
+};
+
+class g : virtual public a {
+};
+
+class b : virtual public a {
+ int j;
+};
+
+class c : public g, public b {
+};
+
+class d {
+public:
+ virtual class b* get() {return 0;}
+};
+
+class f : public d {
+public:
+ virtual class b* get() {return &_c;}
+ c _c;
+};
+
+int main(void) {
+ f D;
+ b* bp=D.get();
+ D._c.i = 42;
+ return &D._c.i != &bp->i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1248.C b/gcc/testsuite/g++.old-deja/g++.mike/p1248.C
new file mode 100644
index 000000000..d54e555f3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p1248.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// GROUPS passed pure-virt
+extern "C" int printf (const char *, ...);
+class Base {
+public:
+ virtual ~Base() =0;
+};
+
+class Deranged : public Base {
+public:
+ int value;
+ virtual ~Deranged();
+};
+
+
+Deranged::~Deranged(){}
+
+void foo() {
+ Deranged d;
+}
+
+int main()
+{
+ foo();
+ printf("PASS\n");
+ return 0;
+}
+
+Base::~Base () { }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1567.C b/gcc/testsuite/g++.old-deja/g++.mike/p1567.C
new file mode 100644
index 000000000..4f02d84b6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p1567.C
@@ -0,0 +1,42 @@
+// { dg-do run }
+// GROUPS passed vtable
+extern "C" int printf (const char *, ...);
+extern "C" void exit(int);
+
+class A {
+public:
+ virtual const char* f1() { return "A::f1"; }
+ virtual const char* f2() { return "A::f2"; }
+ virtual const char* f3() { printf("FAIL\n"); exit(1); return "A::f3"; }
+};
+
+class B {
+public:
+ virtual const char* f2() { return "B::f2"; }
+ virtual const char* f3() { return "B::f3"; }
+};
+
+class C: public A, public B {
+public:
+ const char* f2() { return B::f2(); }
+ const char* f1() { return f2(); }
+ const char* f3() { return A::f3(); }
+};
+
+class D: public A, public B {
+public:
+ const char* f2() { return B::f2(); }
+ const char* f1() { return D :: f2(); }
+ const char* f3() { return A::f3(); }
+};
+
+int main() {
+ C* tempC = new C;
+ D* tempD = new D;
+ A* a = tempC;
+ printf("calling f1 on a C gives %s\n", a->f1());
+ a = tempD;
+ printf("calling f1 on a D gives %s\n", a->f1());
+ printf("PASS\n");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p16146.C b/gcc/testsuite/g++.old-deja/g++.mike/p16146.C
new file mode 100644
index 000000000..991a793e5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p16146.C
@@ -0,0 +1,90 @@
+// { dg-do run }
+// prms-id: 16146
+
+extern "C" int printf (const char *, ...);
+
+class myFoundation {
+protected:
+ myFoundation () { count = 0; }
+ virtual ~myFoundation () {}
+
+public:
+ void addRef () { ++count; }
+ void removeRef () { if (count > 0) --count; }
+
+private:
+ long count;
+};
+
+
+class firstIntermediate :virtual public myFoundation {
+public:
+ firstIntermediate () {}
+ ~firstIntermediate () {}
+
+ void bar () { printf ("Bar\n"); }
+};
+
+
+class firstBase : public firstIntermediate {
+public:
+ firstBase () {}
+ ~firstBase () {}
+
+ virtual void g () {}
+};
+
+
+class secondIntermediate : virtual public myFoundation {
+public:
+ secondIntermediate () {}
+ ~secondIntermediate () {}
+
+ virtual void h () {}
+};
+
+
+class secondBase : public secondIntermediate {
+public:
+ secondBase () {}
+ ~secondBase () {}
+
+ virtual void h () {}
+};
+
+
+class typeInterface : virtual public firstBase {
+public:
+ typeInterface () {}
+ ~typeInterface () {}
+
+ virtual void i () {}
+};
+
+class classServices : virtual public firstBase,
+ public secondBase {
+public:
+ classServices () {}
+ ~classServices () {}
+
+ virtual void j () {}
+};
+
+class classImplementation : public typeInterface,
+ public classServices {
+public:
+ classImplementation () {}
+ ~classImplementation () {}
+
+ void g () {}
+ void h () {}
+ void i () {}
+ void j () {}
+};
+
+int main () {
+ firstBase* fbp = new classImplementation;
+ classImplementation* cip = dynamic_cast <classImplementation*> (fbp);
+ cip->addRef();
+ myFoundation* mfp = cip;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1862.C b/gcc/testsuite/g++.old-deja/g++.mike/p1862.C
new file mode 100644
index 000000000..7765ec1ea
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p1862.C
@@ -0,0 +1,63 @@
+// { dg-do run }
+// GROUPS vtable
+extern "C" int printf (const char *, ...);
+
+class A
+{
+public:
+ virtual ~A(){}
+ virtual int type(void)
+ {
+ return -1;
+ }
+};
+
+class B
+{
+public:
+ virtual ~B(){}
+};
+
+
+class C0 : public B, public A
+{
+public:
+ virtual int type(void)
+ {
+ return 0;
+ }
+};
+
+class C1 : public C0
+{
+public:
+ virtual int type(void)
+ {
+ return 1;
+ }
+};
+
+class C2 : public C0
+{
+public:
+ virtual int type(void)
+ {
+ return 2;
+ }
+};
+
+int main()
+{
+ C1 *one = new C1;
+
+ if (one->type() == 1)
+ {
+ printf ("PASS\n");
+ return 0;
+ }
+ else
+ {
+ printf ("FAIL\n");
+ return 1;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
new file mode 100644
index 000000000..487f609a1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
@@ -0,0 +1,495 @@
+// { dg-do assemble }
+// prms-id: 1989
+
+#define TRUE true
+#define FALSE false
+typedef void *Pix;
+
+template<class T>
+struct link {
+ T item;
+ link *next;
+ link *prev;
+
+ link(const T& t): item(t), prev(0), next(0)
+ { }
+ link(const T& t, link<T> *p, link<T> *n): item(t), prev(p), next(n)
+ { }
+};
+
+template<class T>
+class List_DL {
+public:
+ List_DL();
+ List_DL(const List_DL&);
+ ~List_DL();
+
+ void append(const T& item);
+ void prepend(const T& item);
+ void insert(const T& item, Pix x, bool before);
+
+ void remove(Pix& x)
+ { T tmp; remove(x, tmp); }
+ void remove(Pix& x, T& item);
+
+ void clear();
+
+ unsigned length() const
+ { return count; }
+
+private:
+
+ unsigned count;
+ link<T> *head;
+ link<T> *tail;
+
+public:
+ Pix first() const
+ { return Pix(head); }
+ Pix last() const
+ { return Pix(tail); }
+ void next(Pix& x) const
+ { if (0 != x) x = ((link<T> *) x)->next; }
+ void prev(Pix& x) const
+ { if (0 != x) x = ((link<T> *) x)->prev; }
+ T& operator()(Pix x) const
+ { return ((link<T> *) x)->item; }
+};
+
+template<class T>
+List_DL<T>::List_DL():
+count(0),
+head(0)
+{ }
+
+template<class T>
+List_DL<T>::List_DL(const List_DL& other):
+count(0),
+head(0)
+{
+ for (Pix x=other.first(); 0 != x; other.next(x))
+ append(other(x));
+}
+
+template<class T>
+List_DL<T>::~List_DL()
+{
+ clear();
+}
+
+template<class T>
+void
+List_DL<T>::append(const T& item)
+{
+ count++;
+ if (0 == head) {
+ head = new link<T>(item);
+ tail = head;
+ } else {
+ tail->next = new link<T>(item, tail, 0);
+ tail = tail->next;
+ }
+}
+
+template<class T>
+void
+List_DL<T>::prepend(const T& item)
+{
+ count++;
+ if (0 == head) {
+ head = new link<T>(item);
+ tail = head;
+ } else {
+ head = new link<T>(item, 0, head);
+ if (tail == head)
+ tail = tail->next;
+ }
+}
+
+template<class T>
+void
+List_DL<T>::insert(const T& item, Pix x, bool before = TRUE)
+{
+ link<T> *l = (link<T> *) x;
+
+ if (before) {
+ if (0 == l || l == head) {
+ prepend(item);
+ } else {
+ link<T> *n = new link<T>(item, l->prev, l);
+ l->prev->next = n;
+ l->prev = n;
+ }
+ } else {
+ if (0 == l || l == tail) {
+ append(item);
+ } else {
+ link<T> *n = new link<T>(item, l, l->next);
+ l->next->prev = n;
+ l->prev = n;
+ }
+ }
+}
+
+template<class T>
+void
+List_DL<T>::remove(Pix& x, T& item)
+{
+ link<T> *l = (link<T> *) x;
+
+ if (0 == l)
+ return;
+
+ item = l->item;
+ if (1 == count) {
+ delete head;
+ head = 0;
+ tail = 0;
+ } else {
+ // more than one item in the list
+ if (l == head) {
+ link<T> *old = head;
+ head = head->next;
+ head->prev = 0;
+ delete old;
+ } else if (l == tail) {
+ link<T> *old = tail;
+ tail = tail->prev;
+ tail->next = 0;
+ delete old;
+ } else {
+ l->next->prev = l->prev;
+ l->prev->next = l->next;
+ delete l;
+ }
+ }
+}
+
+template<class T>
+void
+List_DL<T>::clear()
+{
+ link<T> *l, *succ;
+ for (l=head; 0 != l; l=succ) {
+ succ = l->next;
+ delete l;
+ }
+ head = 0;
+ tail = 0;
+}
+
+template<class T>
+class List_DLS: public List_DL<T> {
+public:
+ List_DLS(): List_DL<T>()
+ { }
+ List_DLS(const List_DLS& other): List_DL<T>(other)
+ { }
+
+ bool contains(const T& item) const
+ { return search(item) != 0 ? TRUE: FALSE; }
+ Pix search(const T&) const;
+};
+
+template<class T>
+Pix
+List_DLS<T>::search(const T& item) const
+{
+ for (Pix x=this->first(); 0 != x; this->next(x)) {
+ if (item == this->operator()(x)) // { dg-error "match" } const subversion
+ // { dg-message "candidate" "candidate note" { target *-*-* } 199 }
+ return x;
+ }
+ return 0;
+}
+
+template<class T>
+class List_DLSp: public List_DL<T> {
+public:
+ List_DLSp(): List_DL<T>()
+ { }
+ List_DLSp(const List_DLSp& other): List_DL<T>(other)
+ { }
+
+ bool contains(const T& item) const
+#ifndef INTERNAL_ERROR
+ ;
+#else
+ { return search(item) != 0 ? TRUE: FALSE; }
+#endif
+ Pix search(const T&) const;
+};
+
+template<class T>
+bool
+List_DLSp<T>::contains(const T& item) const
+{
+ for (Pix x=this->first(); 0 != x; this->next(x)) {
+ if (*item == *(this->operator()(x)))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+class Set {
+public:
+ Set();
+ Set(const Set& other);
+
+ virtual void add(const T& item);
+
+ void remove(const T& item)
+ { Pix x = search(item); remove(x); }
+ void remove(Pix& x)
+ { T tmp; remove(x, tmp); }
+ virtual void remove(Pix& x, T& item);
+
+ virtual void clear();
+
+ virtual bool contains(const T&) const;
+ virtual Pix search(const T&) const;
+
+ virtual unsigned length() const;
+
+ virtual Pix first() const;
+ virtual void next(Pix& x) const;
+ virtual T& operator()(Pix x) const;
+};
+
+template<class T>
+Set<T>::Set()
+{ }
+
+template<class T>
+Set<T>::Set(const Set& other)
+{ }
+
+
+template<class T>
+class Set_DL: public List_DLS<T> {
+public:
+ Set_DL();
+ Set_DL(const Set_DL& other);
+
+ void add(const T& item)
+ { list.append(item); }
+ void remove(Pix& x, T& item)
+ { list.remove(x, item); }
+
+ void clear()
+ { list.clear(); }
+
+ bool contains(const T& item) const
+ { return list.contains(item); }
+ Pix search(const T& item) const
+ { return list.search(item); }
+
+ unsigned length() const
+ { return list.length(); }
+
+ Pix first() const
+ { return list.first(); }
+ void next(Pix& x) const
+ { list.next(x); }
+ T& operator()(Pix x) const
+ { return list(x); }
+private:
+ List_DLS<T> list;
+};
+
+template<class T>
+class Set_DLp: public List_DLSp<T> {
+public:
+ Set_DLp();
+ Set_DLp(const Set_DLp& other);
+
+ void add(const T& item)
+ { list.append(item); }
+ void remove(Pix& x, T& item)
+ { list.remove(x, item); }
+
+ void clear()
+ { list.clear(); }
+
+ bool contains(const T& item) const
+ { return list.contains(item); }
+ Pix search(const T& item) const
+ { return list.search(item); }
+
+ unsigned length() const
+ { return list.length(); }
+
+ Pix first() const
+ { return list.first(); }
+ void next(Pix& x) const
+ { list.next(x); }
+ T& operator()(Pix x) const
+ { return list(x); }
+private:
+ List_DLSp<T> list;
+};
+
+template<class T>
+struct vertex {
+ T item;
+ List_DL<vertex<T> *> fanout;
+
+ vertex(): item(), fanout() // { dg-bogus "" }
+ { }
+ vertex(const T& i): item(), fanout() // { dg-bogus "" }
+ { }
+};
+
+template<class T>
+class Graph {
+public:
+ Graph();
+ Graph(const Graph&);
+ ~Graph();
+
+ void add(const T& from, const T& to);
+ bool contains(const T& from, const T& to) const;
+
+ void clear()
+ { vertices.clear(); }
+
+ unsigned lengthV() const
+ { return vertices.length(); }
+
+ Pix firstV() const
+ { return vertices.first(); }
+ void nextV(Pix& x) const
+ { vertices.next(x); }
+ T& V(Pix x) const
+ { return vertices(x).item; }
+
+ Pix firstV1(Pix vx) const;
+ void nextV1(Pix vx, Pix& x) const;
+ T& V1(Pix vx, Pix x) const;
+private:
+ vertex<T> *lookup(const T& from) const;
+ vertex<T> *lookup_new(const T& from);
+
+ List_DLS<vertex<T> > vertices;
+};
+
+template<class T>
+Graph<T>::Graph():
+vertices()
+{ }
+
+template<class T>
+Graph<T>::Graph(const Graph& other):
+vertices()
+{
+ for (Pix vx=firstV(); 0 != vx; nextV(vx)) {
+ for (Pix vx1=firstV1(vx); 0 != vx1; nextV1(vx, vx1)) {
+ add(V(vx), V1(vx, vx1));
+ }
+ }
+}
+
+template<class T>
+Graph<T>::~Graph()
+{
+ clear();
+}
+
+template<class T>
+void
+Graph<T>::add(const T& from, const T& to)
+{
+ vertex<T> *fromv = lookup_new(from);
+ if (from == to)
+ return;
+ vertex<T> *tov = lookup_new(to);
+ fromv->fanout.append(tov);
+}
+
+template<class T>
+bool
+Graph<T>::contains(const T& from, const T& to) const
+{
+ vertex<T> *fromv = lookup(from);
+ if (0 == fromv)
+ return FALSE;
+
+ for (Pix x=fromv->fanout.first(); 0 != x; fromv->fanout.next(x)) {
+ if (fromv->fanout(x)->item == to)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+template<class T>
+vertex<T> *
+Graph<T>::lookup(const T& from) const
+{
+ for (Pix x=vertices.first(); 0 != x; vertices.next(x)) {
+ if (vertices(x).item == from)
+ return &vertices(x);
+ }
+ return 0;
+}
+
+template<class T>
+vertex<T> *
+Graph<T>::lookup_new(const T& from)
+{
+ vertex<T> *v = lookup(from);
+ if (0 == v) {
+ vertices.append(from);
+ return &vertices(vertices.last());
+ }
+ return v;
+}
+
+template<class T>
+Pix
+Graph<T>::firstV1(Pix vx) const
+{
+ vertex<T> *v = (vertex<T> *) vx;
+ return v->fanout.first();
+}
+
+template<class T>
+void
+Graph<T>::nextV1(Pix vx, Pix& x) const
+{
+ vertex<T> *v = (vertex<T> *) vx;
+ return v->fanout.next(x);
+}
+
+template<class T>
+T&
+Graph<T>::V1(Pix vx, Pix x) const
+{
+ vertex<T> *v = (vertex<T> *) vx;
+ static T x1;
+ return x1;
+}
+
+class STRLIdentifier;
+
+extern int x(List_DL<STRLIdentifier *>);
+extern int x(List_DLS<STRLIdentifier *>);
+
+extern int x(Set<STRLIdentifier *>);
+extern int x(Set_DL<STRLIdentifier *>);
+extern int x(Set_DLp<STRLIdentifier *>);
+
+extern int x(Graph<STRLIdentifier *>);
+
+class STRLIdentifier {
+ char buf[10];
+};
+
+extern int operator==(vertex<STRLIdentifier*>&, vertex<STRLIdentifier*>&); // { dg-message "note" } const subversion
+extern int operator==(STRLIdentifier&, STRLIdentifier&); // { dg-message "note" } fn ref in err msg
+
+extern int x(List_DLSp<STRLIdentifier *>);
+
+template class Graph<STRLIdentifier *>;
+template class List_DLS<vertex<STRLIdentifier *> >;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2394.C b/gcc/testsuite/g++.old-deja/g++.mike/p2394.C
new file mode 100644
index 000000000..6581f9f2f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2394.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+// prms-id: 2394
+
+class Foo {
+ public:
+ int x;
+ int y;
+ Foo(int i, int j) { x = i; y = j; }
+} foo(10, 11);
+
+class Wasted { int unsed; };
+
+class Bar : Wasted, public Foo {
+public:
+ Bar() : Foo(12, 13) { }
+} bar;
+
+int
+test0() {
+ int Foo::* pmi = &Foo::y;
+ return (int)(foo.*pmi);
+}
+
+int
+test1() {
+ int Foo::* pmi = &Foo::y;
+ return (int)(bar.*pmi);
+}
+
+int
+main() {
+ if (test0() != 11)
+ return 1;
+ if (test1() != 13)
+ return 2;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2431.C b/gcc/testsuite/g++.old-deja/g++.mike/p2431.C
new file mode 100644
index 000000000..4e74899a1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2431.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// GROUPS passed infinite_loop
+class A
+{
+ public:
+ A(A &); // { dg-message "note" }
+};
+
+class B
+{
+ public:
+ operator A ();
+};
+
+class C
+{
+ public :
+ C()
+ {
+ B b;
+ A a = b;// { dg-error "match" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 21 }
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2573.C b/gcc/testsuite/g++.old-deja/g++.mike/p2573.C
new file mode 100644
index 000000000..0906979c3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2573.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// prms-id: 2573
+
+class X {
+public:
+ int key();
+ virtual int vkey();
+ char *add();
+};
+
+char *X::add() {
+ char *f1 = (char *) &key; // { dg-error "" }
+ char *f2 = (char *) &vkey; // { dg-error "" }
+ return f1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2736.C b/gcc/testsuite/g++.old-deja/g++.mike/p2736.C
new file mode 100644
index 000000000..6ae61e892
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2736.C
@@ -0,0 +1,33 @@
+// The VxWorks kernel has no implementation of atexit, so local statics
+// are never destroyed.
+// { dg-do run { xfail vxworks_kernel } }
+// This is a poor test case, it is meant to ensure that function local
+// statics are destroyed at the right time. See PR 2736 for details.
+// prms-id: 2736
+
+#include <stdlib.h>
+
+int count;
+
+struct A {
+ int which;
+ A(int i) :which(i) {
+ // printf("ctor %x\n", this);
+ }
+ ~A() {
+ // printf("dtor %x\n", this);
+ if (++count != which)
+ abort ();
+ }
+};
+
+void
+foo() {
+ static A a(1);
+}
+
+A a(2);
+
+int main() {
+ foo();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2746.C b/gcc/testsuite/g++.old-deja/g++.mike/p2746.C
new file mode 100644
index 000000000..1bc1ce359
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2746.C
@@ -0,0 +1,156 @@
+// { dg-do assemble }
+// GROUPS passed scope pt
+class Link {
+public:
+ Link();
+ Link(Link *);
+private:
+ Link *next_;
+
+friend class IListBase;
+friend class IListIterBase;
+};
+
+inline
+Link::Link() : next_(0)
+{
+}
+
+inline
+Link::Link(Link *next) : next_(next)
+{
+}
+
+class IListBase {
+public:
+ IListBase();
+ IListBase(Link *);
+ void append(Link *);
+ void insert(Link *);
+ Link *head();
+ int empty();
+ Link *get();
+ void remove(Link *);
+private:
+ Link *head_;
+friend class IListIterBase;
+};
+
+inline
+IListBase::IListBase() : head_(0)
+{
+}
+
+inline
+IListBase::IListBase(Link *head) : head_(head)
+{
+}
+
+inline
+void IListBase::insert(Link *p)
+{
+ p->next_ = head_;
+ head_ = p;
+}
+
+inline
+Link *IListBase::head()
+{
+ return head_;
+}
+
+inline
+int IListBase::empty()
+{
+ return head_ == 0;
+}
+
+inline
+Link *IListBase::get()
+{
+ Link *tem = head_;
+ head_ = head_->next_;
+ return tem;
+}
+
+template<class T> class IListIter;
+
+template<class T>
+class IList : private IListBase {
+public:
+ IList() { }
+ IList(T *p) : IListBase(p) { }
+ ~IList();
+ void append(T *p) { IListBase::append(p); }
+ void insert(T *p) { IListBase::insert(p); }
+ void remove(T *p) { IListBase::remove(p); }
+ T *head() { return (T *)IListBase::head(); }
+ T *get() { return (T *)IListBase::get(); }
+ IListBase::empty;
+friend class IListIter<T>;
+};
+
+template<class T>
+IList<T>::~IList()
+{
+ while (!empty())
+ delete get();
+}
+
+class IListIterBase {
+public:
+ IListIterBase(const IListBase &);
+ int done();
+ Link *cur();
+ void next();
+private:
+ Link *p_;
+};
+
+inline
+IListIterBase::IListIterBase(const IListBase &list) : p_(list.head_)
+{
+}
+
+inline
+int IListIterBase::done()
+{
+ return p_ == 0;
+}
+
+inline
+Link *IListIterBase::cur()
+{
+ return p_;
+}
+
+inline
+void IListIterBase::next()
+{
+ p_ = p_->next_;
+}
+
+
+template<class T>
+class IListIter : private IListIterBase {
+public:
+ IListIter(const IList<T> &list) : IListIterBase(list) { }
+ T *cur() { return (T *)IListIterBase::cur(); }
+ IListIterBase::next;
+ IListIterBase::done;
+};
+
+
+struct A {
+ IList<Link> list;
+ int x;
+ void foo();
+};
+
+
+void A::foo()
+{
+ for (IListIter<Link> iter(list); !iter.done(); iter.next())
+ ;
+ x = 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2793.C b/gcc/testsuite/g++.old-deja/g++.mike/p2793.C
new file mode 100644
index 000000000..68fee7dfd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2793.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// prms-id: 2793
+
+void f(char&) { // { dg-error "" } referenced by error below
+ f('c'); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2806.C b/gcc/testsuite/g++.old-deja/g++.mike/p2806.C
new file mode 100644
index 000000000..71d5139e1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2806.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// GROUPS passed
+template<class T>
+class List
+{
+ public:
+ List();
+ void f() const;
+};
+
+template<class T>
+void List<T>::f() const
+{
+}
+
+void func()
+{
+ List<int> list;
+ list.f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2846.C b/gcc/testsuite/g++.old-deja/g++.mike/p2846.C
new file mode 100644
index 000000000..bce20bb00
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2846.C
@@ -0,0 +1,67 @@
+// { dg-do run }
+// prms-id: 2846
+
+extern "C" int printf(const char *, ...);
+extern "C" void exit(int);
+
+class A;
+class B;
+
+int c;
+
+class A {
+public:
+
+ A(void){}
+ A(const A&){}
+ A(const B&);
+
+ virtual ~A(void){}
+
+ virtual void print(void) const {
+ printf("A::print\n");
+ printf("FAIL\n");
+ exit(1);
+ }
+ B compute(void) const;
+};
+
+class B : private A {
+friend class A;
+public:
+
+ virtual ~B(void){}
+
+ void print(void) const {
+ ++c;
+ printf("B::print\n");
+ }
+
+private:
+ B(const A& x, int){}
+};
+
+A::A(const B& s) {
+ s.print();
+}
+
+B A::compute(void) const {
+ B sub(*this, 1);
+ return sub;
+}
+
+int main ()
+{
+ A titi;
+ A toto = titi.compute();
+ if (c != 1)
+ {
+ printf ("FAIL\n");
+ return 1;
+ }
+ else
+ {
+ printf("PASS\n");
+ return 0;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2846a.C b/gcc/testsuite/g++.old-deja/g++.mike/p2846a.C
new file mode 100644
index 000000000..8825de4e8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2846a.C
@@ -0,0 +1,35 @@
+// { dg-do run }
+// Shows that problem of initializing one object's vtable pointer from
+// another object's vtable pointer when doing a default copy of it
+// and the vtable pointer involved is the main one.
+
+// Correct answer is B::print.
+// g++ prints D::print, which is wrong. Cfront gets is right.
+
+// prms-id: 2846
+
+extern "C" int printf(const char *, ...);
+extern "C" void exit(int);
+
+class B {
+public:
+ virtual void print(void) const { printf("B::print\n"); }
+};
+
+class D : public B {
+public:
+ void print(void) const { printf("D::print\n"); exit(1); }
+ B compute(void) const;
+};
+
+B D::compute(void) const
+{
+ B sub(*(B*)this);
+ return sub;
+}
+
+int main () {
+ D titi;
+ titi.compute().print();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2846b.C b/gcc/testsuite/g++.old-deja/g++.mike/p2846b.C
new file mode 100644
index 000000000..57422fe64
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2846b.C
@@ -0,0 +1,53 @@
+// { dg-do run }
+// Shows that problem of initializing one object's secondary base from
+// another object via a user defined copy constructor for that base,
+// the pointer for the secondary vtable is not set after implicit
+// copying of the outer class, but rather has the pointer to the main
+// vtable for the secondary base left over from the user defined copy
+// constructor for that base.
+
+// Correct answer is B::beefy.
+// g++ prints A::beefy, which is wrong. Cfront gets it right.
+
+// prms-id: 2846
+
+extern "C" int printf(const char *, ...);
+extern "C" void exit(int);
+
+class B;
+
+class A {
+ public:
+
+ A(void){}
+ A(const A&){}
+
+ virtual void print(void) const { }
+ B compute(void) const;
+};
+
+class C {
+public:
+ C() { }
+ C(C& o) { } // with it, things are wrong, without it, they're ok
+ virtual void beefy(void) const { printf("A::beefy\n"); exit(1); }
+};
+
+class B : private A, public C {
+public:
+ B(const A& x, int){}
+ void beefy(void) const { printf("B::beefy\n"); }
+};
+
+B A::compute(void) const
+{
+ B sub(*this, 1);
+ return sub;
+}
+
+int main ()
+{
+ A titi;
+ titi.compute().beefy();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2855.C b/gcc/testsuite/g++.old-deja/g++.mike/p2855.C
new file mode 100644
index 000000000..3f269d276
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2855.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// { dg-options "-Wcast-qual" }
+// prms-id: 2855
+
+class Ctest {
+private:
+ char* data;
+public:
+ operator const char *() const;
+};
+
+Ctest::operator const char *() const
+{
+ return data;
+}
+int main()
+{
+ Ctest obj;
+ char* temp = (char *)obj; // { dg-error "invalid cast" }
+ temp[0] = '\0';
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2960.C b/gcc/testsuite/g++.old-deja/g++.mike/p2960.C
new file mode 100644
index 000000000..510decd3d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2960.C
@@ -0,0 +1,31 @@
+// { dg-do run }
+// prms-id: 2960
+
+extern "C" int printf(const char *, ...);
+
+class Test0 {
+public:
+ virtual void f0() { } // works fine if this virtual removed
+};
+
+class Test1 : public Test0 {
+public:
+ void f1() { f2(); } // generates bus error here
+ virtual void f2() { printf("Test1::f2\n"); }
+};
+
+class Test2 {
+public:
+ virtual void f3() { }
+};
+
+class Test3 : public Test2, public Test1 { // works fine if Test1 first
+public:
+ virtual ~Test3() { f1(); } // calling f2 directly works
+ virtual void f2() { printf("Test3::f2\n"); }
+};
+
+int main() {
+ Test3 t3;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3041.C b/gcc/testsuite/g++.old-deja/g++.mike/p3041.C
new file mode 100644
index 000000000..189d2f3ba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3041.C
@@ -0,0 +1,34 @@
+// { dg-do run }
+// prms-id: 3041
+
+class A {
+public:
+ A() { }
+ virtual void a() = 0;
+ static int b(A * p) {
+ p->a();
+ return 1;
+ }
+};
+
+class B : virtual public A {
+public:
+ B() {
+ static int installed = b(this);
+ }
+ void a() { }
+};
+
+class C : virtual public B {
+public:
+ C() {
+ static int installed = b(this);
+ }
+ void a() { }
+};
+
+int main()
+{
+ C c;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3060c.C b/gcc/testsuite/g++.old-deja/g++.mike/p3060c.C
new file mode 100644
index 000000000..8d9bd2e44
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3060c.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// A new problem with my pointer to member function work.
+// prms-id: 3060
+
+class Foo
+{
+ public:
+ int x;
+ int y;
+ Foo (int i, int j) { x = i; y = j; }
+ operator int ();
+};
+
+int Foo::operator int() { return x; } // { dg-error "return" } can't specify return type
+
+Foo foo(10, 11);
+
+int
+main()
+{
+ int Foo::* pmi = &Foo::y;
+ return foo.*pmi;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3060d.C b/gcc/testsuite/g++.old-deja/g++.mike/p3060d.C
new file mode 100644
index 000000000..11ac0daa6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3060d.C
@@ -0,0 +1,35 @@
+// { dg-do run }
+// This is a test case to make sure the explicit cast on a pointer to
+// a member function works ok.
+// prms-id: 3060
+
+extern "C" int printf(const char *, ...);
+
+class Object;
+
+typedef void (Object::*VoidObjMemberFunc)(Object *tracker, void *ap);
+
+class Object {
+public:
+ int foo;
+};
+
+class Clipper: public Object {
+public:
+ int bar;
+ void Feedback(Object*, void*);
+};
+void Clipper::Feedback(Object *tracker, void *ap) {
+ printf("Doing feedback\n");
+}
+
+void vfunc(VoidObjMemberFunc of, Object *op, void *v1) {
+ (op->*of)(op, v1);
+}
+
+int main() {
+ Object o;
+
+ vfunc((VoidObjMemberFunc)&Clipper::Feedback, &o, 0);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3068.C b/gcc/testsuite/g++.old-deja/g++.mike/p3068.C
new file mode 100644
index 000000000..65dab70b0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3068.C
@@ -0,0 +1,61 @@
+// { dg-do run }
+// prms-id: 3068
+
+extern "C" int printf(const char *, ...);
+extern "C" void exit(int);
+
+class LB {
+public:
+ virtual int test() { return 0; }
+ virtual ~LB() { }
+protected:
+ LB() { }
+};
+
+class RRB {
+public:
+ virtual ~RRB() { }
+ virtual void test2(int a) { }
+};
+
+class RR : public RRB {
+public:
+ virtual ~RR() { }
+};
+
+class RL {
+public:
+ virtual void real(int a) {
+ printf("RL::real\n");
+ }
+};
+
+
+class R : public RL, public RR {
+public:
+ virtual void test3(int a) { }
+ virtual void test2(int a) { }
+};
+
+class L : public LB {
+};
+
+class C : public L, public R {
+public:
+ C() { }
+ virtual ~C() {
+ printf("C::~C\n");
+ exit(1);
+ }
+ virtual void real(int a) {
+ printf("RL::real\n");
+ }
+};
+
+int main() {
+ C& bb = *new C;
+ R& mv = bb;
+ bb.real(0);
+ mv.real(0);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3070.C b/gcc/testsuite/g++.old-deja/g++.mike/p3070.C
new file mode 100644
index 000000000..b292d4127
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3070.C
@@ -0,0 +1,32 @@
+// { dg-do assemble }
+// Caused an Internal Compiler Error. Works now.
+// prms-id: 3070
+
+class Object {
+public:
+ virtual ~Object() {}
+};
+
+class BaseView {
+protected:
+ virtual void _forwardReceiveUpdate() = 0;
+};
+
+
+class View : public BaseView {
+public:
+ virtual ~View();
+};
+
+class TestViewBaseUpdate {
+protected:
+ virtual void _receiveUpdate();
+};
+
+class TestViewBase : public TestViewBaseUpdate, private View {
+};
+
+class TestView : public Object, public TestViewBase {
+protected:
+ virtual void _receiveUpdate();
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3139.C b/gcc/testsuite/g++.old-deja/g++.mike/p3139.C
new file mode 100644
index 000000000..691017859
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3139.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// prms-id: 3139
+
+extern "C" int printf(const char *, ...);
+
+class A {
+ public:
+ A() { }
+ virtual int a() = 0;
+};
+
+class B : virtual public A {
+ public:
+ virtual int a() = 0;
+};
+
+class C : public B {
+ public:
+ int a() { return 42; }
+};
+
+int main() {
+ B * b = new C;
+ printf("%d.\n", b->a());
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3524a.C b/gcc/testsuite/g++.old-deja/g++.mike/p3524a.C
new file mode 100644
index 000000000..1b0afede5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3524a.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// Make sure we can initialize a reference to a templated type, that
+// requires a conversion from a derived type to a base type.
+
+// prms-id: 3524
+
+struct cc2Vector
+{};
+
+template <class T>
+struct ccPair
+{
+ ccPair (const cc2Vector&);
+};
+
+struct ccLine : cc2Vector
+{
+ double distToPoint (const ccPair <float> &);
+};
+
+void foo ()
+{
+ ccLine l2;
+ l2.distToPoint (l2);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C b/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C
new file mode 100644
index 000000000..34d106040
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3524b.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Make sure we can cast to a templated type, that requires a conversion by
+// constructor, from a derived type to a base type.
+
+// prms-id: 3524
+
+template <class T>
+struct ccPair {
+ ccPair () { }
+};
+
+template <class T>
+struct ccO : ccPair<T> {
+ ccO () { }
+};
+
+void foo ()
+{
+ ccO<float> r;
+ (ccPair<float>)r;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3524c.C b/gcc/testsuite/g++.old-deja/g++.mike/p3524c.C
new file mode 100644
index 000000000..2f5d23bed
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3524c.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Make sure we can cast to a templated type, that requires a conversion by
+// constructor, from a non-aggregate type.
+
+// prms-id: 3524
+
+template <class T>
+struct ccPair {
+ ccPair (int i) { }
+};
+
+void foo ()
+{
+ (ccPair<float>)1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3538a.C b/gcc/testsuite/g++.old-deja/g++.mike/p3538a.C
new file mode 100644
index 000000000..a2c985386
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3538a.C
@@ -0,0 +1,33 @@
+// { dg-do assemble }
+// This tests for the compiler_error in binfo_value.
+// prms-id: 3538
+
+class ccObjectInfo
+{
+public:
+ virtual const ccObjectInfo& repInvariant (int);
+};
+
+template<class T>
+class ccHandle : public ccObjectInfo
+{
+protected:
+ T* p;
+public:
+ virtual const ccObjectInfo& repInvariant (int);
+};
+
+template <class T>
+const ccObjectInfo& ccHandle<T>::repInvariant (int)
+{ return p->ri(1); }
+
+class ccHandleBase : public ccObjectInfo
+{};
+
+class cc_CircleHdl : public virtual ccHandleBase, public ccObjectInfo // { dg-warning "" }
+{
+public:
+ virtual const ccObjectInfo& ri (int);
+};
+
+class ccCircleHdl : public ccHandle <cc_CircleHdl> {};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3538b.C b/gcc/testsuite/g++.old-deja/g++.mike/p3538b.C
new file mode 100644
index 000000000..96ba124a1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3538b.C
@@ -0,0 +1,35 @@
+// { dg-do assemble }
+// prms-id: 3538
+
+// This tests for an ambiguous conversion of the this pointer (going
+// down to DECL_CONTEXT of a FUNCTION_DECL.
+
+class ccObjectInfo
+{
+public:
+ virtual const ccObjectInfo& repInvariant (int);
+};
+
+template<class T>
+class ccHandle : public ccObjectInfo
+{
+protected:
+ T* p;
+public:
+ virtual const ccObjectInfo& repInvariant (int);
+};
+
+template <class T>
+const ccObjectInfo& ccHandle<T>::repInvariant (int)
+{ return p->repInvariant(1); }
+
+class ccHandleBase : public ccObjectInfo
+{};
+
+class cc_CircleHdl : public virtual ccHandleBase, public ccObjectInfo // { dg-warning "" }
+{
+public:
+ virtual const ccObjectInfo& repInvariant (int);
+};
+
+class ccCircleHdl : public ccHandle <cc_CircleHdl> {};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3570.C b/gcc/testsuite/g++.old-deja/g++.mike/p3570.C
new file mode 100644
index 000000000..e8502d535
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3570.C
@@ -0,0 +1,30 @@
+// { dg-do run }
+// prms-id: 3570
+
+extern "C" int printf(const char *, ...);
+
+struct A {
+ void print() {printf("A");}
+};
+
+struct B : A {
+ typedef A superB;
+ void print() {superB::print(); printf("B");}
+};
+
+struct C : B {
+ typedef B superC;
+ void print() {superC::print(); printf("C");}
+};
+
+int main ()
+{
+ A a;
+ B b;
+ C c;
+
+ a.print(); printf("\n");
+ b.print(); printf("\n");
+ c.print(); printf("\n");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3579.C b/gcc/testsuite/g++.old-deja/g++.mike/p3579.C
new file mode 100644
index 000000000..90a134446
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3579.C
@@ -0,0 +1,40 @@
+// { dg-do run }
+// prms-id: 3579
+
+extern "C" int printf(const char *, ...);
+
+int num_x;
+
+class Y {
+public:
+ Y () { printf("Y() this: %x\n", this); }
+ ~Y () { printf("~Y() this: %x\n", this); }
+};
+
+class X {
+public:
+ X () {
+ ++num_x;
+ printf("X() this: %x\n", this);
+ Y y;
+ *this = (X) y;
+ }
+
+ X (const Y & yy) { printf("X(const Y&) this: %x\n", this); ++num_x; }
+ X & operator = (const X & xx) {
+ printf("X.op=(X&) this: %x\n", this);
+ return *this;
+ }
+
+ ~X () { printf("~X() this: %x\n", this); --num_x; }
+};
+
+int main (int, char **) {
+ { X anX; }
+ if (num_x) {
+ printf("FAIL\n");
+ return 1;
+ }
+ printf("PASS\n");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3708.C b/gcc/testsuite/g++.old-deja/g++.mike/p3708.C
new file mode 100644
index 000000000..56e4bcbe2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3708.C
@@ -0,0 +1,87 @@
+// { dg-do run }
+// prms-id: 3708
+
+extern "C" int printf (const char *, ...);
+extern "C" int atoi (const char *);
+
+void *ptr;
+
+class A {
+public:
+ A() { printf ("A is constructed.\n"); }
+ virtual void xx(int doit) { printf ("A is destructed.\n"); }
+};
+
+class A1 {
+public:
+ A1() { printf ("A1 is constructed.\n"); }
+ virtual void xx(int doit) { printf ("A1 is destructed.\n"); }
+};
+
+class B : public virtual A, public A1 {
+public:
+ B() { printf ("B is constructed.\n"); }
+ virtual void xx(int doit) {
+ printf ("B is destructed.\n");
+ A1::xx (1);
+ if (doit) A::xx (1);
+ }
+};
+
+int num;
+
+class C : public virtual A, public B {
+public:
+ C() { ++num; printf ("C is constructed.\n");
+ ptr = this;
+ }
+ virtual void xx(int doit) {
+ --num;
+ if (ptr != this)
+ printf("FAIL\n%x != %x\n", ptr, this);
+ printf ("C is destructed.\n");
+ B::xx (0);
+ if (doit) A::xx (1);
+ }
+};
+
+void fooA(A *a) {
+ printf ("Casting to A!\n");
+ a->xx (1);
+}
+void fooA1(A1 *a) {
+ printf ("Casting to A1!\n");
+ a->xx (1);
+}
+
+void fooB(B *b) {
+ printf ("Casting to B!\n");
+ b->xx (1);
+}
+
+void fooC(C *c) {
+ printf ("Casting to C!\n");
+ c->xx (1);
+}
+
+int main(int argc, char *argv[]) {
+ printf ("*** Construct C object!\n");
+ C *c = new C();
+
+ int i = 0;
+
+ printf ("*** Try to delete the casting pointer!\n");
+ switch (i)
+ {
+ case 0: fooA1(c);
+ break;
+ case 1: fooA(c);
+ break;
+ case 2: fooB(c);
+ break;
+ case 3: fooC(c);
+ break;
+ }
+
+ return num!=0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C b/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C
new file mode 100644
index 000000000..dff53b553
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3708a.C
@@ -0,0 +1,87 @@
+// { dg-do run }
+// prms-id: 3708
+
+extern "C" int printf (const char *, ...);
+extern "C" int atoi (const char *);
+
+void *ptr;
+
+class A {
+public:
+ A() { printf ("A is constructed.\n"); }
+ virtual void xx(int doit) { printf ("A is destructed.\n"); }
+};
+
+class A1 {
+public:
+ A1() { printf ("A1 is constructed.\n"); }
+ virtual void xx(int doit) { printf ("A1 is destructed.\n"); }
+};
+
+class B : public A1, public virtual A {
+public:
+ B() { printf ("B is constructed.\n"); }
+ virtual void xx(int doit) {
+ printf ("B is destructed.\n");
+ A1::xx (1);
+ if (doit) A::xx (1);
+ }
+};
+
+int num;
+
+class C : public virtual A, public B {
+public:
+ C() { ++num; printf ("C is constructed.\n");
+ ptr = this;
+ }
+ virtual void xx(int doit) {
+ --num;
+ if (ptr != this)
+ printf("FAIL\n%x != %x\n", ptr, this);
+ printf ("C is destructed.\n");
+ B::xx (0);
+ if (doit) A::xx (1);
+ }
+};
+
+void fooA(A *a) {
+ printf ("Casting to A!\n");
+ a->xx (1);
+}
+void fooA1(A1 *a) {
+ printf ("Casting to A1!\n");
+ a->xx (1);
+}
+
+void fooB(B *b) {
+ printf ("Casting to B!\n");
+ b->xx (1);
+}
+
+void fooC(C *c) {
+ printf ("Casting to C!\n");
+ c->xx (1);
+}
+
+int main(int argc, char *argv[]) {
+ printf ("*** Construct C object!\n");
+ C *c = new C();
+
+ int i = 0;
+
+ printf ("*** Try to delete the casting pointer!\n");
+ switch (i)
+ {
+ case 0: fooA1(c);
+ break;
+ case 1: fooA(c);
+ break;
+ case 2: fooB(c);
+ break;
+ case 3: fooC(c);
+ break;
+ }
+
+ return num!=0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C b/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C
new file mode 100644
index 000000000..2cccc4691
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3708b.C
@@ -0,0 +1,86 @@
+// { dg-do run }
+// prms-id: 3708
+
+extern "C" int printf (const char *, ...);
+extern "C" void exit(int);
+
+void *ptr;
+
+class A {
+public:
+ A() { printf ("A is constructed.\n"); }
+ virtual void xx(int doit) { printf ("A is destructed.\n"); }
+};
+
+class A1 {
+public:
+ A1() { printf ("A1 is constructed.\n"); }
+ virtual void xx(int doit) { printf ("A1 is destructed.\n"); }
+};
+
+class B : public virtual A, public A1 {
+public:
+ B() { printf ("B is constructed.\n"); }
+ virtual void xx(int doit) {
+ printf ("B is destructed.\n");
+ A1::xx (1);
+ if (doit) A::xx (1);
+ }
+};
+
+int num;
+
+class C : public virtual A {
+public:
+ C() { printf ("C is constructed.\n");
+ }
+ virtual void xx(int doit) {
+ printf ("C is destructed.\n");
+ if (doit) A::xx (1);
+ }
+};
+
+class D : public C, public B {
+public:
+ D() { ++num; printf ("D is constructed.\n");
+ ptr = this;
+ }
+ virtual void xx(int doit) {
+ --num;
+ if (ptr != this) {
+ printf("FAIL\n%x != %x\n", ptr, this);
+ exit(1);
+ }
+ printf ("D is destructed.\n");
+ C::xx (0);
+ B::xx (0);
+ }
+};
+
+void fooA(A *a) {
+ printf ("Casting to A!\n");
+ a->xx (1);
+}
+void fooA1(A1 *a) {
+ printf ("Casting to A1!\n");
+ a->xx (1);
+}
+
+void fooB(B *b) {
+ printf ("Casting to B!\n");
+ b->xx (1);
+}
+
+void fooC(C *c) {
+ printf ("Casting to C!\n");
+ c->xx (1);
+}
+
+int main(int argc, char *argv[]) {
+ printf ("*** Construct D object!\n");
+ D *d = new D();
+
+ printf ("*** Try to delete the casting pointer!\n");
+ fooA1(d);
+ return num!=0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3764.C b/gcc/testsuite/g++.old-deja/g++.mike/p3764.C
new file mode 100644
index 000000000..5a833b32f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3764.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// prms-id: 3764
+
+class Menu;
+class MenuItem;
+
+class MenuAction {
+public:
+ virtual void execute (Menu& menu, MenuItem& menuItem) = 0;
+protected:
+ MenuAction () {}
+};
+
+class Test {
+ class MenuCBA : public MenuAction {
+ public:
+ typedef void (Test::* MenuCBA_Member) (Menu& menu, MenuItem& menuItem) ;
+ MenuCBA(Test& instance, MenuCBA_Member member)
+ : _instance(&instance), _member(member) { }
+ void execute(Menu& menu, MenuItem& menuItem);
+ private:
+ MenuCBA_Member _member;
+ Test *_instance;
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p3836.C b/gcc/testsuite/g++.old-deja/g++.mike/p3836.C
new file mode 100644
index 000000000..77f859b2c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p3836.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// prms-id: 3836
+
+void f(int &i) { // { dg-error "" } ref line
+ i = 10;
+}
+
+int main()
+{
+ int i=1, j=2;
+ f(i);
+ f((int)j); // { dg-error "" } passing in to non-const
+ if (j != 2)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4068.C b/gcc/testsuite/g++.old-deja/g++.mike/p4068.C
new file mode 100644
index 000000000..1e65adce4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4068.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+// prms-id: 4068
+
+struct A {
+ A();
+ typedef void (A::*F)();
+ void d();
+ void foo() { }
+ F& f() { return f_; }
+ F f_;
+};
+
+A::A() : f_(&A::foo) {
+}
+
+void A::d() {
+ (this->*(f()))();
+}
+
+int main() {
+ A a;
+ a.d();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4104.C b/gcc/testsuite/g++.old-deja/g++.mike/p4104.C
new file mode 100644
index 000000000..0f61cd27f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4104.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+// prms-id: 4104
+
+template <class T>
+void F(T &a, void (*P)(T &temp)) {
+ (*P)(a);
+}
+
+template <class T>
+void G(T &a) {
+}
+
+int main() {
+ int a;
+ F(a, G);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4173.C b/gcc/testsuite/g++.old-deja/g++.mike/p4173.C
new file mode 100644
index 000000000..e07bc0695
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4173.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// { dg-options "-Wall -ansi -pedantic-errors" }
+// This error happens because lvalue is not done well in the C++ front-end.
+// NOPs should be lvalues if their arguments are.
+// NON_LVALUE_EXPRs shouldn't be.
+
+// prms-id: 4173
+
+enum TypeKind {
+ RecordTypeKind
+};
+struct Type
+{
+ enum TypeKind kind : 8;
+ unsigned char prefixLen;
+};
+
+Type a;
+Type b;
+TypeKind c;
+
+int
+main() {
+ a.kind = b.kind = c;
+ (a.kind = c) = b.kind; // { dg-bogus "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p418.C b/gcc/testsuite/g++.old-deja/g++.mike/p418.C
new file mode 100644
index 000000000..412884071
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p418.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// prms-id: 418
+
+class Base {
+public:
+ int foo;
+};
+
+class Derived : public Base {
+public:
+ int bar;
+};
+
+void func(Base&); // { dg-error "" } referenced by error below
+
+void func2(const Derived& d) {
+ func(d); // { dg-error "" } should be error because of const
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4238.C b/gcc/testsuite/g++.old-deja/g++.mike/p4238.C
new file mode 100644
index 000000000..48d30ce7f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4238.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// This showed a problem with default op=
+// prms-id: 4238
+
+struct sigcontext {
+ int sc_wbuf[31][25];
+}; // { dg-bogus "" } default op= seems broken
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4246.C b/gcc/testsuite/g++.old-deja/g++.mike/p4246.C
new file mode 100644
index 000000000..c81ae7571
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4246.C
@@ -0,0 +1,49 @@
+// { dg-do run }
+// prms-id: 4246
+
+extern "C" void abort ();
+int num_d;
+
+class A
+{
+ public:
+ A() { }
+ virtual ~A() { }
+ virtual void id() { }
+};
+
+class B
+{
+ public:
+ B() { }
+ virtual ~B() { }
+ virtual void id() { }
+};
+
+class C : public A, public B
+{
+ public:
+ C() { }
+ virtual ~C() { }
+ void id() { abort(); }
+};
+
+class D : public C
+{
+ public:
+ D() { ++num_d; }
+ virtual ~D() { -- num_d; }
+ void id() { }
+};
+
+int main()
+{
+ D* dp2 = new D;
+ ((B*)dp2)->id();
+ delete (B*) dp2;
+
+ B* bp1 = new D;
+ bp1->id();
+ delete bp1;
+ return num_d != 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4263.C b/gcc/testsuite/g++.old-deja/g++.mike/p4263.C
new file mode 100644
index 000000000..7a49c2ba7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4263.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// prms-id: 4263
+
+enum OT {A_type, B_Type};
+enum AT {A, B};
+
+/* These are not ok. */
+OT t = A; // { dg-error "" }
+OT e2 = 1; // { dg-error "" }
+OT e3 = 1.1; // { dg-error "" }
+
+/* These are ok. */
+int i = A;
+double d = A;
+OT e4 = A_type;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p438.C b/gcc/testsuite/g++.old-deja/g++.mike/p438.C
new file mode 100644
index 000000000..6e78af165
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p438.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// prms-id: 438
+
+class D;
+
+class C
+{
+ public:
+ void test() const;
+};
+
+class D
+{
+ public:
+ void a(C& b); // { dg-message "D::a|no known conversion" }
+};
+
+void C::test() const
+{
+ D d;
+
+ d.a(*this); // { dg-error "match" } *this is const, so should get error
+ // { dg-message "candidate" "candidate note" { target *-*-* } 22 }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4484.C b/gcc/testsuite/g++.old-deja/g++.mike/p4484.C
new file mode 100644
index 000000000..b0ec0c9fc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4484.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// prms-id: 4484
+
+class A {
+ char buf[64];
+};
+
+typedef void (A::*pmf)();
+typedef void (A::*pmfc)() const;
+
+pmfc p = (pmfc)(pmf)0;
+
+class B {
+};
+
+class D : public A, public B {
+};
+
+typedef int (B::*bmfp)();
+typedef int (D::*dmfp)();
+
+bmfp foo;
+
+void bar(dmfp a) {
+ bar(foo);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4511.C b/gcc/testsuite/g++.old-deja/g++.mike/p4511.C
new file mode 100644
index 000000000..25348f463
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4511.C
@@ -0,0 +1,34 @@
+// { dg-do run }
+// prms-id: 4511
+
+int bad;
+
+class A {
+public:
+ virtual void dummy (){}
+};
+
+class B {
+public:
+ virtual void f(void) = 0;
+};
+
+class C : public A, public B {
+public:
+ void f(void) { bad=1; }
+};
+
+class D : public C {
+public:
+ void f(void) { }
+};
+
+class E : public D { };
+
+int main() {
+ E e;
+ e.f();
+ E * ep = &e;
+ ep->f();
+ return bad;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4619.C b/gcc/testsuite/g++.old-deja/g++.mike/p4619.C
new file mode 100644
index 000000000..866146a56
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4619.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// prms-id: 4619
+
+int main() {
+ int i = 3;
+ int (*p)[10] = new int [20][10];
+ int (*p1)[5][7][13][10] = new int [i][5][7][13][10];
+ delete [] p1;
+ delete [] p;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4623.C b/gcc/testsuite/g++.old-deja/g++.mike/p4623.C
new file mode 100644
index 000000000..f602c9fdf
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4623.C
@@ -0,0 +1,36 @@
+// { dg-do run }
+// prms-id: 4623
+
+class base {
+public:
+ int b_data;
+ base( int i=0 ) { b_data = i; }
+ void b_print() { }
+};
+
+class base1: virtual public base {
+public:
+ int b1_data;
+ base1( int i = 0 ) { b1_data = i; b_data++; }
+ void b1_print() { }
+};
+
+class base2: virtual public base {
+public:
+ int b2_data;
+ base2( int i = 0 ) { b2_data = i; b_data++; }
+ void b2_print() { }
+};
+
+class base3: public base {};
+
+class derived: public base3, public base1, public base2 {
+public:
+ int d_data;
+ derived( int i ) { d_data = i; ((base3 *)this)->b_data++; }
+ void d_print() { }
+};
+
+int main() {
+ derived d(1); d.d_print(); return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4667.C b/gcc/testsuite/g++.old-deja/g++.mike/p4667.C
new file mode 100644
index 000000000..e8eee21be
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4667.C
@@ -0,0 +1,32 @@
+// { dg-do run }
+// prms-id: 4667
+
+int counter = 0;
+int a = 0;
+int b = 0;
+int c = 0;
+
+struct A {
+ A() { a = counter++; }
+};
+
+struct B {
+ B() { b = counter++; }
+};
+
+struct C : public virtual B {
+ C() { c = counter++; }
+};
+
+struct D : public virtual A, public virtual C { };
+
+extern "C" int printf(const char*,...);
+int main(void) {
+ D d;
+
+ if (!(a == 0 && b == 1 && c == 2)) {
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4671.C b/gcc/testsuite/g++.old-deja/g++.mike/p4671.C
new file mode 100644
index 000000000..54b182c2b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4671.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// prms-id: 4671
+
+class ccUnwind {
+public:
+ virtual void _c_getInfo() const;
+ virtual ~ccUnwind ();
+};
+class ccTransmittable {
+public:
+ virtual ~ccTransmittable();
+};
+class ccCommand : public ccUnwind, public ccTransmittable {
+};
+class foo : public ccCommand {
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4677.C b/gcc/testsuite/g++.old-deja/g++.mike/p4677.C
new file mode 100644
index 000000000..92f0f397a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4677.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// prms-id: 4677
+
+struct A {
+ A(double d) { }
+};
+
+struct B { B(A) { } } bad = 1; // { dg-error "" }
+B good (1);
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4693.C b/gcc/testsuite/g++.old-deja/g++.mike/p4693.C
new file mode 100644
index 000000000..67d040e91
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4693.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// prms-id: 4693
+
+class a {
+public:
+ virtual ~a();
+};
+
+class b {
+public:
+ virtual void set_var() = 0;
+};
+
+class c : public b, public a { };
+
+class d : public c {
+public:
+ void set_var() { }
+};
+
+int main() {
+ d * test;
+ test = new d;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4736a.C b/gcc/testsuite/g++.old-deja/g++.mike/p4736a.C
new file mode 100644
index 000000000..f50dbcdb3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4736a.C
@@ -0,0 +1,40 @@
+// { dg-do run }
+// prms-id: 4736
+
+int did_fail = 1;
+
+class O {
+public:
+ virtual void of() { }
+};
+
+class A : public O {
+public:
+ virtual void vf() { }
+};
+
+class W {
+public:
+ virtual void vf() { }
+};
+
+class X : public W, public A {
+public:
+ virtual void vf() { }
+};
+
+class Z : public X {
+public:
+ virtual void vf() { did_fail = 0; }
+};
+
+Z sz;
+
+void fail1(W* w) {
+ w->vf();
+}
+
+int main() {
+ fail1 (&sz);
+ return did_fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4736b.C b/gcc/testsuite/g++.old-deja/g++.mike/p4736b.C
new file mode 100644
index 000000000..c2fce17b4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4736b.C
@@ -0,0 +1,49 @@
+// { dg-do run }
+// prms-id: 4736
+
+class Rep {
+public:
+ virtual int foo() { return 1; }
+};
+
+class Rep_1 : public Rep {
+};
+
+class VBaseMain {
+public:
+ virtual int foo() { return 2; }
+};
+
+class OtherVBase {
+public:
+ virtual int foo() { return 3; }
+};
+
+class Rep_2 : public Rep {
+};
+
+class DVBase : public VBaseMain, public Rep_2, public OtherVBase {
+public:
+ virtual int foo() { return 4; }
+};
+
+class Main : public Rep_1, virtual public DVBase {
+public:
+ virtual int foo() { return 5; }
+};
+
+int main() {
+ Main m;
+ if (m.foo() != 5)
+ return 1;
+ if (((Rep*)(Rep_1*)&m)->foo() != 5)
+ return 2;
+ if (((DVBase*)&m)->foo() != 5)
+ return 3;
+ if (((VBaseMain*)(DVBase*)&m)->foo() != 5)
+ return 4;
+ if (((Rep*)(Rep_2*)(DVBase*)&m)->foo() != 5)
+ return 5;
+ if (((OtherVBase*)(DVBase*)&m)->foo() != 5)
+ return 6;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4736c.C b/gcc/testsuite/g++.old-deja/g++.mike/p4736c.C
new file mode 100644
index 000000000..d260b3afe
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4736c.C
@@ -0,0 +1,63 @@
+// { dg-do run }
+// prms-id: 4736
+
+int did_fail;
+
+class Rep {
+public:
+ virtual ~Rep() { }
+};
+
+class Rep_1 : public Rep {
+};
+
+class VBaseMain {
+public:
+ virtual ~VBaseMain() { }
+};
+
+class OtherVBase {
+public:
+ virtual ~OtherVBase() { }
+};
+
+class Rep_2 : public Rep {
+};
+
+class DVBase : public VBaseMain, public Rep_2, public OtherVBase {
+public:
+ virtual ~DVBase() { }
+};
+
+class Main : public Rep_1, virtual public DVBase {
+public:
+ virtual ~Main() { did_fail = 0; }
+};
+
+int main() {
+ Main* m;
+ did_fail = 1;
+ delete new Main;
+ if (did_fail)
+ return 1;
+ did_fail = 1;
+ delete (Rep*)(Rep_1*)new Main;
+ if (did_fail)
+ return 2;
+ did_fail = 1;
+ delete (DVBase*)new Main;
+ if (did_fail)
+ return 3;
+ did_fail = 1;
+ delete (VBaseMain*)(DVBase*)new Main;
+ if (did_fail)
+ return 4;
+ did_fail = 1;
+ delete (Rep*)(Rep_2*)(DVBase*)new Main;
+ if (did_fail)
+ return 5;
+ did_fail = 1;
+ delete (OtherVBase*)(DVBase*)new Main;
+ if (did_fail)
+ return 6;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4750.C b/gcc/testsuite/g++.old-deja/g++.mike/p4750.C
new file mode 100644
index 000000000..ccf462be0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p4750.C
@@ -0,0 +1,10 @@
+// { dg-do assemble { target native } }
+// { dg-options "-fpic -pedantic-errors -S" }
+// prms-id: 4750
+
+extern const int FRAME_VEC_MAX;
+
+const int FRAME_VEC_MAX = 12;
+int frame_vec_sizes[FRAME_VEC_MAX+1] = {
+ 0, 1, 3, 3, 6, 6, 6, 9, 9, 9, 12, 12, 12
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5469.C b/gcc/testsuite/g++.old-deja/g++.mike/p5469.C
new file mode 100644
index 000000000..8c82c7e3d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5469.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// prms-id: 5469
+
+int count;
+
+class A {
+ A();
+ A(const A&);
+public:
+ A(int) { ++count; }
+ ~A() { --count; }
+ int operator== (const A& r) { return 0; }
+};
+
+int main() {
+ {
+ A a (1);
+ if (a == 2 && a == 1)
+ ;
+ }
+ return count;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C b/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C
new file mode 100644
index 000000000..03a398469
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// prms-id: 5469
+
+int count;
+
+class A {
+ A();
+ A(const A&);
+public:
+ A(int) { ++count; }
+ ~A() { --count; }
+ int operator== (const A& r) { return 1; }
+};
+
+int main() {
+ {
+ A a (1);
+ if (a == 2 || a == 1)
+ ;
+ }
+ return count;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5571.C b/gcc/testsuite/g++.old-deja/g++.mike/p5571.C
new file mode 100644
index 000000000..b03675fbf
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5571.C
@@ -0,0 +1,71 @@
+// { dg-do run }
+// prms-id: 5571
+
+int e = 0;
+void *vp = 0;
+
+class ParentOne {
+public:
+ ParentOne() {}
+#ifdef MAKE_WORK
+ virtual ~ParentOne() {}
+#endif
+private:
+ char SomeData[101];
+};
+
+class ParentTwo {
+public:
+ ParentTwo() {}
+ virtual ~ParentTwo() {}
+private:
+ int MoreData[12];
+ virtual int foo() { return 0; }
+};
+
+struct Child : public ParentOne, public ParentTwo {
+ int ChildsToy;
+ virtual void PrintThis() = 0;
+};
+
+struct Student : public Child {
+ int StudentsBook;
+ void PrintThis() {
+ if (vp == 0)
+ vp = (void *)this;
+ else
+ {
+ if (vp != (void *)this)
+ ++e;
+ }
+ }
+ void LocalPrintThis() {
+ if (vp == 0)
+ vp = (void *)this;
+ else
+ {
+ if (vp != (void *)this)
+ ++e;
+ }
+ PrintThis();
+ }
+ void ForcedPrintThis() {
+ if (vp == 0)
+ vp = (void *)this;
+ else
+ {
+ if (vp != (void *)this)
+ ++e;
+ }
+ Student::PrintThis();
+ }
+};
+
+int main() {
+ Student o;
+ o.LocalPrintThis();
+ o.ForcedPrintThis();
+ Child* pX = &o;
+ pX->PrintThis();
+ return e;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5611.C b/gcc/testsuite/g++.old-deja/g++.mike/p5611.C
new file mode 100644
index 000000000..b5c180658
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5611.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+// prms-id: 5611
+
+int main(void)
+{
+ struct B
+ {
+ virtual void b1() { }
+ };
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5673.C b/gcc/testsuite/g++.old-deja/g++.mike/p5673.C
new file mode 100644
index 000000000..759d5d8b6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5673.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// prms-id: 5673
+
+class A {
+public:
+ operator int () {
+ return 7;
+ }
+ ~A();
+};
+
+int foo() {
+ return A();
+}
+
+int main() {
+ return foo() != 7;
+}
+
+A::~A() {
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5718.C b/gcc/testsuite/g++.old-deja/g++.mike/p5718.C
new file mode 100644
index 000000000..d0acbb9bd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5718.C
@@ -0,0 +1,38 @@
+// { dg-do run }
+// prms-id: 5718
+
+class Base {
+ int i;
+public:
+ Base() { i = 42; }
+};
+
+
+class Mixin {
+ int j;
+public:
+ Mixin() { j = 42; }
+};
+
+
+class Derived : public Base, public Mixin {
+public:
+ Derived() { }
+ Derived & operator=(Mixin & m) { return *this; }
+};
+
+
+void
+testFunct(Derived * arg) {
+ Mixin temp;
+
+ (Mixin &)(*arg) = temp; // { dg-bogus "" }
+}
+
+
+int
+main(int argc, char *argv[]) {
+ Derived temp;
+
+ testFunct(&temp);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5793.C b/gcc/testsuite/g++.old-deja/g++.mike/p5793.C
new file mode 100644
index 000000000..db6e658aa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5793.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// prms-id: 5793
+
+class temp_string {
+ public:
+ temp_string (const int);
+ temp_string (const char * const);
+};
+
+class Range {
+ public:
+ Range ( const int);
+ operator int () const ;
+};
+
+int operator == (const int, temp_string );
+
+void CheckArrayConstraints(void) {
+ if (Range(0L) == 0L)
+ ;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5840.C b/gcc/testsuite/g++.old-deja/g++.mike/p5840.C
new file mode 100644
index 000000000..1cd033005
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5840.C
@@ -0,0 +1,36 @@
+// { dg-do run }
+// prms-id: 5840
+
+class Signal {
+public:
+ int Name(void) { return 1; }
+};
+
+class Derived : public Signal {
+public:
+ int Name(void) { return 2; }
+};
+
+template <class Foo , int (Foo::*Id)(void)>
+class Bar
+{
+public:
+ int value (Foo* a) { return (a->*Id)(); }
+};
+
+/* The following line is illegal under the new rules for non-type
+ template arguments in the standard, so it is commented out. */
+/* template class Bar <Derived, &Signal::Name>; */
+template class Bar <Signal, &Signal::Name>;
+template class Bar <Derived, &Derived::Name>;
+
+Derived a;
+
+/* Bar<Derived, &Signal::Name> dispatcher1; */
+Bar<Derived, &Derived::Name> dispatcher2;
+
+int main() {
+ /* int i1 = dispatcher1.value(&a); */
+ int i2 = dispatcher2.value(&a);
+ return /* i1 != 1 || */ i2 != 2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5958.C b/gcc/testsuite/g++.old-deja/g++.mike/p5958.C
new file mode 100644
index 000000000..666a44945
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5958.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// { dg-options "-ansi" }
+// prms-id: 5958
+
+class A { };
+
+main() {
+ int i = 1;
+ if (1 not_eq 1)
+ return 1;
+ if (not (1 and 1))
+ return 1;
+ if (not (1 or 1))
+ return 1;
+ if (compl ~0)
+ return 1;
+ if (1 bitand 2)
+ return 1;
+ if (not (1 bitor 2))
+ return 1;
+ if (1 xor 1)
+ return 1;
+ i and_eq 1;
+ i or_eq 2;
+ i xor_eq 4;
+ if (i not_eq 7)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6004.C b/gcc/testsuite/g++.old-deja/g++.mike/p6004.C
new file mode 100644
index 000000000..2b262bdb0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6004.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// { dg-options "" }
+// prms-id: 6004
+
+class A {
+public:
+ static int foo() asm("_my_routine");
+};
+
+int bar1() asm("foo__1A");
+int bar2() asm("_foo__1A");
+int bar3() asm("__foo__1A");
+int bar1() { return 45; }
+int bar2() { return 44; }
+int bar3() { return 43; }
+
+int A::foo() { return 42; }
+
+main() {
+ return A::foo() - 42;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6058.C b/gcc/testsuite/g++.old-deja/g++.mike/p6058.C
new file mode 100644
index 000000000..3146e542a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6058.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-fexceptions -pedantic-errors" }
+// prms-id: 6058
+
+void bar(struct s1 { } a) { (void)a; } // { dg-error "" }
+
+struct s2*fooey()
+{
+ try {
+ static_cast<struct s3 { } *>(0); // { dg-error "" }
+ const_cast<struct s4 { } *>((s4*)0); // { dg-error "" }
+ reinterpret_cast<struct s5 { } *>((s3*)0); // { dg-error "" }
+ dynamic_cast<struct s6 { } *>((s6*)0); // { dg-error "" }
+ (struct s7 { } *)(int*)0xffedec; // { dg-error "" }
+ } catch (struct s8 { } s) { // { dg-error "" }
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6149.C b/gcc/testsuite/g++.old-deja/g++.mike/p6149.C
new file mode 100644
index 000000000..d7b819637
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6149.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+// prms-id: 6149
+
+int a[3 - sizeof(double)]; // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6311.C b/gcc/testsuite/g++.old-deja/g++.mike/p6311.C
new file mode 100644
index 000000000..309a083ad
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6311.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// prms-id: 6311
+
+struct Foo {
+ int member;
+} a = { 42 }, *ptra = &a;
+
+int Foo::*pmd = &Foo::member;
+
+int main() {
+ if (pmd == 0)
+ return 1;
+ if (a.*pmd != 42)
+ return 2;
+ if (ptra->*pmd != 42)
+ return 3;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p646.C b/gcc/testsuite/g++.old-deja/g++.mike/p646.C
new file mode 100644
index 000000000..4f7807d11
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p646.C
@@ -0,0 +1,163 @@
+// { dg-do assemble }
+// { dg-options "-Wno-deprecated -Wreturn-type" }
+// GROUPS passed i960
+/*
+ Bug Id: bnr
+ PMRS Id: p0000646
+ Bug is: Urgent Code Generation Problem in gcc-i960 V 1.95
+*/
+
+
+
+extern "C"
+{
+ int printf (const char *, ...);
+ void abort ();
+}
+
+struct foo
+{
+ static int si;
+ int i;
+ foo ();
+ foo (const foo&);
+ ~foo ();
+};
+
+int
+foo_parm_returns_i (foo foo_arg)
+{
+ return foo_arg.i;
+}
+
+int foo::si = 0;
+
+foo::foo ()
+{
+ si++;
+ printf ("new foo @ 0x%x; now %d foos\n", this, si);
+}
+
+foo::foo (const foo &other)
+{
+ si++;
+ printf ("another foo @ 0x%x; now %d foos\n", this, si);
+ *this = other;
+}
+
+foo::~foo ()
+{
+ si--;
+ printf ("deleted foo @ 0x%x; now %d foos\n", this, si);
+}
+
+int
+return_1 ()
+{
+ foo f;
+ printf ("returning 1\n");
+ return 1;
+}
+
+int
+return_arg (int arg)
+{
+ foo f;
+ printf ("returning %d\n", arg);
+ return arg;
+}
+
+int
+return_sum (int x, int y)
+{
+ foo f;
+ printf ("returning %d+%d\n", x, y);
+ return x + y;
+}
+
+foo
+return_foo ()
+{
+ foo f;
+ printf ("returning foo\n");
+ return f;
+}
+
+foo
+foo_parm_returns_foo (foo f)
+{
+ return f;
+}
+
+void
+abort_because (const char *str)
+{
+ printf ("aborting because %s\n", str);
+ abort ();
+}
+
+int
+warn_return_1 ()
+{
+ foo f;
+ printf ("returning 1\n");
+} // { dg-warning "" } control reaches end
+
+int
+warn_return_arg (int arg)
+{
+ foo f;
+ printf ("returning %d\n", arg);
+ arg;
+} // { dg-warning "" } control reaches end
+
+int
+warn_return_sum (int x, int y)
+{
+ foo f;
+ printf ("returning %d+%d\n", x, y);
+ x + y;
+} // { dg-warning "" } control reaches end
+
+foo
+warn_return_foo ()
+{
+ foo f;
+ printf ("returning foo\n");
+} // { dg-warning "" } control reaches end
+
+foo
+warn_foo_parm_returns_foo (foo f)
+{
+ f;
+} // { dg-warning "" } control reaches end
+
+main () // { dg-warning "" } no type
+{
+ int ii = return_1 ();
+ if (ii != 1)
+ abort_because ("wrong value returned");
+ int j = return_arg (42);
+ if (j != 42)
+ abort_because ("wrong value returned");
+ int k = return_sum (-69, 69);
+ if (k != 0)
+ abort_because ("wrong value returned");
+ foo f1 = return_foo ();
+ if (foo::si != 1)
+ abort_because ("wrong number of foos");
+ f1.i = 5;
+ int l = foo_parm_returns_i (f1);
+ if (l != 5)
+ abort_because ("l != 5");
+ foo f2 = foo_parm_returns_foo (f1);
+ if (foo::si != 2)
+ abort_because ("wrong number of foos");
+ if (f2.i != 5)
+ abort_because ("f2.i != 5");
+ foo f3 = return_foo ();
+ if (foo::si != 3)
+ abort_because ("wrong number of foos");
+ printf("PASS\n");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6578.C b/gcc/testsuite/g++.old-deja/g++.mike/p6578.C
new file mode 100644
index 000000000..d738f3cf1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6578.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// prms-id: 6578
+
+struct A {
+ operator int ();
+};
+
+int i = A();
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p658.C b/gcc/testsuite/g++.old-deja/g++.mike/p658.C
new file mode 100644
index 000000000..8fc7cd51b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p658.C
@@ -0,0 +1,109 @@
+// { dg-do run }
+// prms-id: 658
+
+#include <iostream>
+#include <cstdlib>
+
+/* We may not find the libg++ <bool.h>. */
+#ifndef FALSE
+#define FALSE false
+#endif
+#ifndef TRUE
+#define TRUE true
+#endif
+
+// The VxWorks kernel-mode headers define a macro named "OK", which is not
+// ISO-compliant, but is part of the VxWorks API.
+#if defined __vxworks && !defined __RTP__
+#undef OK
+#endif
+
+class Object {
+public:
+ Object();
+ Object(const Object&);
+ ~Object();
+
+ void OK() const;
+private:
+ bool _destructed;
+};
+
+class Char: public Object {
+public:
+ Char();
+ Char(char);
+ Char(const Char&);
+ ~Char();
+
+ operator char () const;
+private:
+ char _c;
+};
+
+int main()
+{
+ Char r, s;
+
+ r = Char('r');
+ s = Char('s');
+}
+
+//
+// Object stuff
+//
+Object::Object():
+_destructed(FALSE)
+{}
+
+Object::Object(const Object& other):
+_destructed(FALSE)
+{
+ other.OK();
+}
+
+Object::~Object()
+{
+ OK();
+ _destructed = TRUE;
+}
+
+void
+Object::OK() const
+{
+ if (_destructed) {
+ std::cerr << "FAILURE - reference was made to a destructed object\n";
+ std::abort();
+ }
+}
+
+//
+// Char stuff
+//
+
+Char::Char():
+Object(),
+_c('a')
+{ }
+
+Char::Char(char c):
+Object(),
+_c(c)
+{ }
+
+Char::Char(const Char& other):
+Object(other),
+_c(other._c)
+{ }
+
+Char::~Char()
+{
+ OK();
+}
+
+Char::operator char () const
+{
+ return _c;
+}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6610a.C b/gcc/testsuite/g++.old-deja/g++.mike/p6610a.C
new file mode 100644
index 000000000..4870e074d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6610a.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+// prms-id: 6610
+// There is a bug in vtable thunks with multiple/virtual inheritance.
+
+int fail = 1;
+struct B;
+struct A { virtual int f(const B*) = 0; int g(const B*); };
+int A::g(const B* t) { return f(t); }
+struct B : virtual A { B(); int f(const B*); B* B_this; };
+B::B() { if (g(this)) fail = 0; }
+int B::f(const B* t) { return t == this; }
+struct C : B { int f(const B*); int x; };
+int C::f(const B*) { return 0; }
+
+int main() { C c; return fail; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6610b.C b/gcc/testsuite/g++.old-deja/g++.mike/p6610b.C
new file mode 100644
index 000000000..664a0ca03
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6610b.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+// prms-id: 6610
+
+int fail = 1;
+struct B;
+struct A { virtual int f(const B*) = 0; int g(const B*); };
+int A::g(const B* t) { return f(t); }
+struct B : virtual A { int f(const B*); B* B_this; };
+int B::f(const B* t) { return t == this; }
+struct S1 { };
+struct C : virtual S1, virtual B, virtual A { C(); };
+C::C() { if (g(this)) fail = 0; }
+struct D : virtual B, virtual A, C { };
+
+int main() { D d; return fail; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6611.C b/gcc/testsuite/g++.old-deja/g++.mike/p6611.C
new file mode 100644
index 000000000..9a2a28ed1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6611.C
@@ -0,0 +1,27 @@
+// { dg-do run }
+// prms-id: 6611
+
+class COMPLEX {
+public:
+ COMPLEX(double a, double b=0) { re = a; im = b; }
+ void print() const { }
+private:
+ double re;
+ double im;
+};
+
+int main(void)
+{
+ COMPLEX a[3][3] = {
+ { 1, COMPLEX(2,3), COMPLEX(3,4), },
+ { 1, COMPLEX(2,3), COMPLEX(3,4), },
+ { 1, COMPLEX(2,3), COMPLEX(3,4), },
+ };
+ int i,j;
+
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++) {
+ a[i][j].print();
+ }
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6746.C b/gcc/testsuite/g++.old-deja/g++.mike/p6746.C
new file mode 100644
index 000000000..09809a801
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6746.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// prms-id: 6746
+
+class call_trace {
+public:
+ call_trace(const char* fcn_name);
+ ~call_trace();
+};
+
+static char * last_tree;
+extern "C" void prt();
+
+char * smt_mark_stree() {
+ const char* _my_name = "smt_mark_stree" ;
+ call_trace _t(_my_name);
+
+ return last_tree = 0 ? (char*)0 : (prt(), (char*)0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6901.C b/gcc/testsuite/g++.old-deja/g++.mike/p6901.C
new file mode 100644
index 000000000..0d55c8d96
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6901.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// prms-id: 6901
+
+void green() {
+ for (int i = 0; i < 10; i++) {}
+ for (int i = 0; i < 10; i++) {}
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6927.C b/gcc/testsuite/g++.old-deja/g++.mike/p6927.C
new file mode 100644
index 000000000..22b4875e3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p6927.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// prms-id: 6927
+
+class Object {
+public:
+ Object();
+ int Value;
+};
+
+Object::Object() : Value(-1) { }
+
+Object *pArr = new Object[2];
+
+int main() {
+ if (pArr[0].Value != -1 || pArr[1].Value != -1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p700.C b/gcc/testsuite/g++.old-deja/g++.mike/p700.C
new file mode 100644
index 000000000..1fef5c855
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p700.C
@@ -0,0 +1,2386 @@
+// { dg-do assemble }
+// { dg-options "-Wno-deprecated" }
+// { dg-error "limited range of data type" "16-bit target" { target xstormy16-*-* } 0 }
+// prms-id: 700
+
+//# 1 "../../../../libg++/etc/benchmarks/dhrystone.cc"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 1 "../../../../libg++/etc/benchmarks/Int.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class Int
+{
+protected:
+ int rep;
+
+
+
+public:
+ Int ();
+ Int (const int b);
+ Int (const Int& b);
+ ~Int();
+
+ operator int() const;
+
+ inline virtual int val() const;
+
+ inline virtual void operator = (const int);
+ inline virtual void operator = (const Int&);
+
+ inline virtual void negate();
+ inline virtual void complement();
+ inline virtual void operator ++ ();
+ inline virtual void operator -- ();
+
+ inline virtual void operator += (const Int & );
+ inline virtual void operator -= (const Int & );
+ inline virtual void operator *= (const Int & );
+ inline virtual void operator /= (const Int & );
+ inline virtual void operator %= (const Int & );
+ inline virtual void operator |= (const Int & );
+ inline virtual void operator &= (const Int & );
+ inline virtual void operator ^= (const Int & );
+ inline virtual void operator <<=(const Int & );
+ inline virtual void operator >>=(const Int & );
+
+
+ inline virtual void operator += (const int);
+ inline virtual void operator -= (const int);
+ inline virtual void operator *= (const int);
+ inline virtual void operator /= (const int);
+ inline virtual void operator %= (const int);
+ inline virtual void operator |= (const int);
+ inline virtual void operator &= (const int);
+ inline virtual void operator ^= (const int);
+ inline virtual void operator <<=(const int);
+ inline virtual void operator >>=(const int);
+
+
+};
+
+inline int Int::val() const { return rep; }
+inline Int::operator int() const { return val(); }
+
+inline Int::Int () :rep(0) {}
+inline Int::Int (const int b) :rep(b) {}
+inline Int::Int (const Int& b) :rep(b.Int::val()) {}
+inline Int::~Int() {}
+
+inline void Int::operator = (const int b)
+{ rep = b; ; }
+inline void Int::operator = (const Int& b)
+{ rep = b.Int::val(); ; }
+
+inline void Int::complement()
+{ rep = ~rep; ; }
+inline void Int::negate()
+{ rep = -rep; ; }
+inline void Int::operator ++ ()
+{ ++rep; ; }
+inline void Int::operator -- ()
+{ --rep; ; }
+
+inline void Int::operator += (const Int & b)
+{ rep += b.Int::val(); ; }
+inline void Int::operator -= (const Int & b)
+{ rep -= b.Int::val(); ; }
+inline void Int::operator *= (const Int & b)
+{ rep *= b.Int::val(); ; }
+inline void Int::operator /= (const Int & b)
+{ rep /= b.Int::val(); ; }
+inline void Int::operator %= (const Int & b)
+{ rep %= b.Int::val(); ; }
+inline void Int::operator |= (const Int & b)
+{ rep |= b.Int::val(); ; }
+inline void Int::operator &= (const Int & b)
+{ rep &= b.Int::val(); ; }
+inline void Int::operator ^= (const Int & b)
+{ rep ^= b.Int::val(); ; }
+inline void Int::operator <<=(const Int & b)
+{ rep <<= b.Int::val(); ; }
+inline void Int::operator >>=(const Int & b)
+{ rep >>= b.Int::val(); ; }
+
+
+
+inline void Int::operator += (const int b)
+{ rep += b; ; }
+inline void Int::operator -= (const int b)
+{ rep -= b; ; }
+inline void Int::operator *= (const int b)
+{ rep *= b; ; }
+inline void Int::operator /= (const int b)
+{ rep /= b; ; }
+inline void Int::operator %= (const int b)
+{ rep %= b; ; }
+inline void Int::operator |= (const int b)
+{ rep |= b; ; }
+inline void Int::operator &= (const int b)
+{ rep &= b; ; }
+inline void Int::operator ^= (const int b)
+{ rep ^= b; ; }
+inline void Int::operator <<=(const int b)
+{ rep <<= b; ; }
+inline void Int::operator >>=(const int b)
+{ rep >>= b; ; }
+
+
+inline int& operator = (int& a, const Int & b) // { dg-error "" }
+{ a = b.Int::val(); return a;}
+inline int& operator += (int& a, const Int & b)
+{ a += b.Int::val(); return a; }
+inline int& operator -= (int& a, const Int & b)
+{ a -= b.Int::val(); return a;}
+inline int& operator *= (int& a, const Int & b)
+{ a *= b.Int::val(); return a;}
+inline int& operator /= (int& a, const Int & b)
+{ a /= b.Int::val(); return a;}
+inline int& operator %= (int& a, const Int & b)
+{ a %= b.Int::val(); return a;}
+inline int& operator |= (int& a, const Int & b)
+{ a |= b.Int::val(); return a;}
+inline int& operator &= (int& a, const Int & b)
+{ a &= b.Int::val(); return a;}
+inline int& operator ^= (int& a, const Int & b)
+{ a ^= b.Int::val(); return a;}
+inline int& operator <<=(int& a, const Int & b)
+{ a <<= b.Int::val(); return a;}
+inline int& operator >>=(int& a, const Int & b)
+{ a >>= b.Int::val(); return a;}
+
+
+
+//# 289 "../../../../libg++/etc/benchmarks/Int.h"
+
+
+inline Int operator - (const Int & a) return r(a) // { dg-error "" }
+{ r.negate(); } // { dg-error "" }
+inline Int operator ~ (const Int & a) return r(a) // { dg-error "" }
+{ r.complement(); } // { dg-error "" }
+
+inline Int operator + (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r += b.Int::val(); } // { dg-error "" }
+inline Int operator - (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r -= b.Int::val(); } // { dg-error "" }
+inline Int operator * (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r *= b.Int::val(); } // { dg-error "" }
+inline Int operator / (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r /= b.Int::val(); } // { dg-error "" }
+inline Int operator % (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r %= b.Int::val(); } // { dg-error "" }
+inline Int operator << (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r <<= b.Int::val(); } // { dg-error "" }
+inline Int operator >> (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r >>= b.Int::val(); } // { dg-error "" }
+inline Int operator & (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r &= b.Int::val(); } // { dg-error "" }
+inline Int operator | (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r |= b.Int::val(); } // { dg-error "" }
+inline Int operator ^ (const Int & a, const Int & b) return r(a) // { dg-error "" }
+{ r ^= b.Int::val(); } // { dg-error "" }
+
+inline Int operator + (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r += b; } // { dg-error "" }
+inline Int operator - (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r -= b; } // { dg-error "" }
+inline Int operator * (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r *= b; } // { dg-error "" }
+inline Int operator / (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r /= b; } // { dg-error "" }
+inline Int operator % (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r %= b; } // { dg-error "" }
+inline Int operator << (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r <<= b; } // { dg-error "" }
+inline Int operator >> (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r >>= b; } // { dg-error "" }
+inline Int operator & (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r &= b; } // { dg-error "" }
+inline Int operator | (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r |= b; } // { dg-error "" }
+inline Int operator ^ (const Int & a, const int b) return r(a) // { dg-error "" }
+{ r ^= b; } // { dg-error "" }
+
+inline Int operator + (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r += b.Int::val(); } // { dg-error "" }
+inline Int operator - (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r -= b.Int::val(); } // { dg-error "" }
+inline Int operator * (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r *= b.Int::val(); } // { dg-error "" }
+inline Int operator / (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r /= b.Int::val(); } // { dg-error "" }
+inline Int operator % (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r %= b.Int::val(); } // { dg-error "" }
+inline Int operator << (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r <<= b.Int::val(); } // { dg-error "" }
+inline Int operator >> (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r >>= b.Int::val(); } // { dg-error "" }
+inline Int operator & (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r &= b.Int::val(); } // { dg-error "" }
+inline Int operator | (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r |= b.Int::val(); } // { dg-error "" }
+inline Int operator ^ (const int a, const Int & b) return r(a) // { dg-error "" }
+{ r ^= b.Int::val(); } // { dg-error "" }
+
+
+
+inline int operator ! (const Int & a) { return !a.Int::val(); }
+
+inline int operator == (const Int & a, const Int & b)
+{ return a.Int::val() == b.Int::val(); }
+inline int operator != (const Int & a, const Int & b)
+{ return a.Int::val() != b.Int::val(); }
+inline int operator < (const Int & a, const Int & b)
+{ return a.Int::val() < b.Int::val(); }
+inline int operator <= (const Int & a, const Int & b)
+{ return a.Int::val() <= b.Int::val(); }
+inline int operator > (const Int & a, const Int & b)
+{ return a.Int::val() > b.Int::val(); }
+inline int operator >= (const Int & a, const Int & b)
+{ return a.Int::val() >= b.Int::val(); }
+
+inline int operator == (const Int & a, const int b)
+{ return a.Int::val() == b; }
+inline int operator != (const Int & a, const int b)
+{ return a.Int::val() != b; }
+inline int operator < (const Int & a, const int b)
+{ return a.Int::val() < b; }
+inline int operator <= (const Int & a, const int b)
+{ return a.Int::val() <= b; }
+inline int operator > (const Int & a, const int b)
+{ return a.Int::val() > b; }
+inline int operator >= (const Int & a, const int b)
+{ return a.Int::val() >= b; }
+
+inline int operator == (const int a, const Int & b)
+{ return a == b.Int::val(); }
+inline int operator != (const int a, const Int & b)
+{ return a != b.Int::val(); }
+inline int operator < (const int a, const Int & b)
+{ return a < b.Int::val(); }
+inline int operator <= (const int a, const Int & b)
+{ return a <= b.Int::val(); }
+inline int operator > (const int a, const Int & b)
+{ return a > b.Int::val(); }
+inline int operator >= (const int a, const Int & b)
+{ return a >= b.Int::val(); }
+
+
+
+//# 26 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2
+
+//# 1 "../../../../libg++/etc/benchmarks/Char.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class Char
+{
+protected:
+ char rep;
+
+
+
+public:
+ Char ();
+ Char (const char b);
+ Char (const Char& b);
+ ~Char();
+
+ operator char() const;
+
+ inline virtual char val() const;
+
+ inline virtual void operator = (const char);
+ inline virtual void operator = (const Char&);
+
+ inline virtual void negate();
+ inline virtual void complement();
+ inline virtual void operator ++ ();
+ inline virtual void operator -- ();
+
+ inline virtual void operator += (const Char & );
+ inline virtual void operator -= (const Char & );
+ inline virtual void operator *= (const Char & );
+ inline virtual void operator /= (const Char & );
+ inline virtual void operator %= (const Char & );
+ inline virtual void operator |= (const Char & );
+ inline virtual void operator &= (const Char & );
+ inline virtual void operator ^= (const Char & );
+ inline virtual void operator <<=(const Char & );
+ inline virtual void operator >>=(const Char & );
+
+
+ inline virtual void operator += (const char);
+ inline virtual void operator -= (const char);
+ inline virtual void operator *= (const char);
+ inline virtual void operator /= (const char);
+ inline virtual void operator %= (const char);
+ inline virtual void operator |= (const char);
+ inline virtual void operator &= (const char);
+ inline virtual void operator ^= (const char);
+ inline virtual void operator <<=(const char);
+ inline virtual void operator >>=(const char);
+
+
+};
+
+inline char Char::val() const { return rep; }
+inline Char::operator char() const { return val(); }
+
+inline Char::Char () :rep(0) {}
+inline Char::Char (const char b) :rep(b) {}
+inline Char::Char (const Char& b) :rep(b.Char::val()) {}
+inline Char::~Char() {}
+
+inline void Char::operator = (const char b)
+{ rep = b; ; }
+inline void Char::operator = (const Char& b)
+{ rep = b.Char::val(); ; }
+
+inline void Char::complement()
+{ rep = ~rep; ; }
+inline void Char::negate()
+{ rep = -rep; ; }
+inline void Char::operator ++ ()
+{ ++rep; ; }
+inline void Char::operator -- ()
+{ --rep; ; }
+
+inline void Char::operator += (const Char & b)
+{ rep += b.Char::val(); ; }
+inline void Char::operator -= (const Char & b)
+{ rep -= b.Char::val(); ; }
+inline void Char::operator *= (const Char & b)
+{ rep *= b.Char::val(); ; }
+inline void Char::operator /= (const Char & b)
+{ rep /= b.Char::val(); ; }
+inline void Char::operator %= (const Char & b)
+{ rep %= b.Char::val(); ; }
+inline void Char::operator |= (const Char & b)
+{ rep |= b.Char::val(); ; }
+inline void Char::operator &= (const Char & b)
+{ rep &= b.Char::val(); ; }
+inline void Char::operator ^= (const Char & b)
+{ rep ^= b.Char::val(); ; }
+inline void Char::operator <<=(const Char & b)
+{ rep <<= b.Char::val(); ; }
+inline void Char::operator >>=(const Char & b)
+{ rep >>= b.Char::val(); ; }
+
+
+
+inline void Char::operator += (const char b)
+{ rep += b; ; }
+inline void Char::operator -= (const char b)
+{ rep -= b; ; }
+inline void Char::operator *= (const char b)
+{ rep *= b; ; }
+inline void Char::operator /= (const char b)
+{ rep /= b; ; }
+inline void Char::operator %= (const char b)
+{ rep %= b; ; }
+inline void Char::operator |= (const char b)
+{ rep |= b; ; }
+inline void Char::operator &= (const char b)
+{ rep &= b; ; }
+inline void Char::operator ^= (const char b)
+{ rep ^= b; ; }
+inline void Char::operator <<=(const char b)
+{ rep <<= b; ; }
+inline void Char::operator >>=(const char b)
+{ rep >>= b; ; }
+
+
+inline char& operator = (char& a, const Char & b) // { dg-error "" }
+{ a = b.Char::val(); return a;}
+inline char& operator += (char& a, const Char & b)
+{ a += b.Char::val(); return a; }
+inline char& operator -= (char& a, const Char & b)
+{ a -= b.Char::val(); return a;}
+inline char& operator *= (char& a, const Char & b)
+{ a *= b.Char::val(); return a;}
+inline char& operator /= (char& a, const Char & b)
+{ a /= b.Char::val(); return a;}
+inline char& operator %= (char& a, const Char & b)
+{ a %= b.Char::val(); return a;}
+inline char& operator |= (char& a, const Char & b)
+{ a |= b.Char::val(); return a;}
+inline char& operator &= (char& a, const Char & b)
+{ a &= b.Char::val(); return a;}
+inline char& operator ^= (char& a, const Char & b)
+{ a ^= b.Char::val(); return a;}
+inline char& operator <<=(char& a, const Char & b)
+{ a <<= b.Char::val(); return a;}
+inline char& operator >>=(char& a, const Char & b)
+{ a >>= b.Char::val(); return a;}
+
+
+
+//# 291 "../../../../libg++/etc/benchmarks/Char.h"
+
+
+inline Char operator - (const Char & a) return r(a) // { dg-error "" }
+{ r.negate(); } // { dg-error "" }
+inline Char operator ~ (const Char & a) return r(a) // { dg-error "" }
+{ r.complement(); } // { dg-error "" }
+
+inline Char operator + (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r += b.Char::val(); } // { dg-error "" }
+inline Char operator - (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r -= b.Char::val(); } // { dg-error "" }
+inline Char operator * (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r *= b.Char::val(); } // { dg-error "" }
+inline Char operator / (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r /= b.Char::val(); } // { dg-error "" }
+inline Char operator % (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r %= b.Char::val(); } // { dg-error "" }
+inline Char operator << (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r <<= b.Char::val(); } // { dg-error "" }
+inline Char operator >> (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r >>= b.Char::val(); } // { dg-error "" }
+inline Char operator & (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r &= b.Char::val(); } // { dg-error "" }
+inline Char operator | (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r |= b.Char::val(); } // { dg-error "" }
+inline Char operator ^ (const Char & a, const Char & b) return r(a) // { dg-error "" }
+{ r ^= b.Char::val(); } // { dg-error "" }
+
+inline Char operator + (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r += b; } // { dg-error "" }
+inline Char operator - (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r -= b; } // { dg-error "" }
+inline Char operator * (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r *= b; } // { dg-error "" }
+inline Char operator / (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r /= b; } // { dg-error "" }
+inline Char operator % (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r %= b; } // { dg-error "" }
+inline Char operator << (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r <<= b; } // { dg-error "" }
+inline Char operator >> (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r >>= b; } // { dg-error "" }
+inline Char operator & (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r &= b; } // { dg-error "" }
+inline Char operator | (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r |= b; } // { dg-error "" }
+inline Char operator ^ (const Char & a, const char b) return r(a) // { dg-error "" }
+{ r ^= b; } // { dg-error "" }
+
+inline Char operator + (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r += b.Char::val(); } // { dg-error "" }
+inline Char operator - (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r -= b.Char::val(); } // { dg-error "" }
+inline Char operator * (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r *= b.Char::val(); } // { dg-error "" }
+inline Char operator / (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r /= b.Char::val(); } // { dg-error "" }
+inline Char operator % (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r %= b.Char::val(); } // { dg-error "" }
+inline Char operator << (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r <<= b.Char::val(); } // { dg-error "" }
+inline Char operator >> (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r >>= b.Char::val(); } // { dg-error "" }
+inline Char operator & (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r &= b.Char::val(); } // { dg-error "" }
+inline Char operator | (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r |= b.Char::val(); } // { dg-error "" }
+inline Char operator ^ (const char a, const Char & b) return r(a) // { dg-error "" }
+{ r ^= b.Char::val(); } // { dg-error "" }
+
+
+
+inline char operator ! (const Char & a) { return !a.Char::val(); }
+
+inline char operator == (const Char & a, const Char & b)
+{ return a.Char::val() == b.Char::val(); }
+inline char operator != (const Char & a, const Char & b)
+{ return a.Char::val() != b.Char::val(); }
+inline char operator < (const Char & a, const Char & b)
+{ return a.Char::val() < b.Char::val(); }
+inline char operator <= (const Char & a, const Char & b)
+{ return a.Char::val() <= b.Char::val(); }
+inline char operator > (const Char & a, const Char & b)
+{ return a.Char::val() > b.Char::val(); }
+inline char operator >= (const Char & a, const Char & b)
+{ return a.Char::val() >= b.Char::val(); }
+
+inline char operator == (const Char & a, const char b)
+{ return a.Char::val() == b; }
+inline char operator != (const Char & a, const char b)
+{ return a.Char::val() != b; }
+inline char operator < (const Char & a, const char b)
+{ return a.Char::val() < b; }
+inline char operator <= (const Char & a, const char b)
+{ return a.Char::val() <= b; }
+inline char operator > (const Char & a, const char b)
+{ return a.Char::val() > b; }
+inline char operator >= (const Char & a, const char b)
+{ return a.Char::val() >= b; }
+
+inline char operator == (const char a, const Char & b)
+{ return a == b.Char::val(); }
+inline char operator != (const char a, const Char & b)
+{ return a != b.Char::val(); }
+inline char operator < (const char a, const Char & b)
+{ return a < b.Char::val(); }
+inline char operator <= (const char a, const Char & b)
+{ return a <= b.Char::val(); }
+inline char operator > (const char a, const Char & b)
+{ return a > b.Char::val(); }
+inline char operator >= (const char a, const Char & b)
+{ return a >= b.Char::val(); }
+
+
+
+//# 27 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1
+
+
+//# 1 "/giga/hgs/lib/g++-include/stddef.h" 1
+
+extern "C" {
+//# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int ptrdiff_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int size_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 3 "/giga/hgs/lib/g++-include/stddef.h" 2
+
+}
+//# 73 "/giga/hgs/lib/g++-include/stddef.h"
+
+//# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2
+
+
+
+
+extern "C"
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 1 "/usr/include/sys/types.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 1 "/usr/include/sys/stdtypes.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int sigset_t;
+
+typedef unsigned int speed_t;
+typedef unsigned long tcflag_t;
+typedef unsigned char cc_t;
+typedef int pid_t;
+
+typedef unsigned short mode_t;
+typedef short nlink_t;
+
+typedef long clock_t;
+typedef long time_t;
+
+typedef int size_t;
+typedef int ptrdiff_t;
+
+
+//# 16 "/usr/include/sys/types.h" 2
+
+
+
+//# 1 "/usr/include/sys/sysmacros.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 19 "/usr/include/sys/types.h" 2
+
+
+
+
+
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct _physadr_t { int r[1]; } *physadr_t;
+typedef struct label_t {
+ int val[2];
+} label_t;
+
+
+
+
+
+
+
+typedef struct _quad_t { long val[2]; } quad_t;
+typedef long daddr_t;
+typedef char * caddr_t;
+typedef unsigned long ino_t;
+typedef short dev_t;
+typedef long off_t;
+typedef unsigned short uid_t;
+typedef unsigned short gid_t;
+typedef long key_t;
+typedef char * addr_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef long fd_mask;
+
+
+
+
+
+
+
+
+
+typedef struct fd_set {
+ fd_mask fds_bits[(((256 )+(( (sizeof (fd_mask) * 8 ) )-1))/( (sizeof (fd_mask) * 8 ) )) ];
+} fd_set;
+
+
+
+
+
+
+
+//# 113 "/usr/include/sys/types.h"
+
+
+
+//# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
+
+//# 310 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2
+
+//# 1 "/giga/hgs/lib/g++-include/sys/times.h" 1
+//# 1 "/giga/hgs/lib/g++-include/time.h" 1
+
+
+
+
+
+//# 1 "/giga/hgs/lib/g++-include/stddef.h" 1
+
+extern "C" {
+//# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1
+//# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h"
+
+//# 3 "/giga/hgs/lib/g++-include/stddef.h" 2
+
+}
+//# 73 "/giga/hgs/lib/g++-include/stddef.h"
+
+//# 6 "/giga/hgs/lib/g++-include/time.h" 2
+
+//# 1 "/giga/hgs/lib/g++-include/stdio.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//#pragma interface
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 80 "/giga/hgs/lib/g++-include/stdio.h"
+
+
+
+//# 117 "/giga/hgs/lib/g++-include/stdio.h"
+
+
+
+
+
+//# 153 "/giga/hgs/lib/g++-include/stdio.h"
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 1 "/usr/include/stdio.h" 1
+
+
+
+
+
+extern struct _iobuf {
+ int _cnt;
+ unsigned char *_ptr;
+ unsigned char *_base;
+ int _bufsiz;
+ short _flag;
+ char _file;
+} _iob[];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern struct _iobuf *c_proto_fopen ();
+extern struct _iobuf *c_proto_fdopen ();
+extern struct _iobuf *c_proto_freopen ();
+extern struct _iobuf *c_proto_popen ();
+extern struct _iobuf *tmpfile();
+extern long ftell(_iobuf *);
+extern char *fgets(char *, int, _iobuf *);
+extern char *gets(char *);
+extern char *c_proto_sprintf ();
+extern char *ctermid();
+extern char *cuserid();
+extern char *c_proto_tempnam ();
+extern char *tmpnam();
+
+
+
+
+
+
+//# 185 "/giga/hgs/lib/g++-include/stdio.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+//# 417 "/giga/hgs/lib/g++-include/stdio.h"
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+int _doprnt(const char*, void*, struct _iobuf *);
+int _doscan(struct _iobuf *, const char*, ...);
+int _filbuf(struct _iobuf *);
+int _flsbuf(unsigned, struct _iobuf *);
+
+int fclose(struct _iobuf *);
+struct _iobuf * fdopen(int, const char*);
+int fflush(struct _iobuf *);
+int fgetc(struct _iobuf *);
+char* fgets(char*, int, struct _iobuf *);
+struct _iobuf * fopen(const char*, const char*);
+int fprintf(struct _iobuf *, const char* ...);
+int fputc(int, struct _iobuf *);
+int fputs(const char*, struct _iobuf *);
+int fread(void*, int, int, struct _iobuf *);
+
+
+
+struct _iobuf * freopen(const char*, const char*, struct _iobuf *);
+
+int fscanf(struct _iobuf *, const char* ...);
+int fseek(struct _iobuf *, long, int);
+long ftell(struct _iobuf *);
+int fwrite(const void*, int, int, struct _iobuf *);
+char* gets(char*);
+int getw(struct _iobuf *);
+int pclose(struct _iobuf *);
+void perror(const char*);
+struct _iobuf * popen(const char*, const char*);
+int printf(const char* ...);
+int puts(const char*);
+int putw(int, struct _iobuf *);
+int rewind(struct _iobuf *);
+int scanf(const char* ...);
+int setbuf(struct _iobuf *, char*);
+int setbuffer(struct _iobuf *, char*, int);
+int setlinebuf(struct _iobuf *);
+int setvbuf(struct _iobuf *, char*, int, int);
+int sscanf(char*, const char* ...);
+struct _iobuf * tmpfile();
+int ungetc(int, struct _iobuf *);
+int vfprintf(struct _iobuf *, const char*, ...);
+
+
+
+
+int vprintf(const char*, ... );
+
+
+
+
+
+int sprintf(char*, const char*, ...);
+char* vsprintf(char*, const char*, ...);
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 7 "/giga/hgs/lib/g++-include/time.h" 2
+
+
+//# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1
+
+
+//# 1 "/giga/hgs/lib/g++-include/stddef.h" 1
+
+extern "C" {
+//# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1
+//# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h"
+
+//# 3 "/giga/hgs/lib/g++-include/stddef.h" 2
+
+}
+//# 73 "/giga/hgs/lib/g++-include/stddef.h"
+
+//# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2
+
+
+
+
+extern "C"
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 1 "/usr/include/sys/types.h" 1
+
+
+
+
+
+
+
+
+//# 115 "/usr/include/sys/types.h"
+
+//# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
+
+//# 9 "/giga/hgs/lib/g++-include/time.h" 2
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 42 "/giga/hgs/lib/g++-include/time.h"
+
+
+
+
+
+
+
+//# 1 "/usr/include/time.h" 1
+
+
+
+
+
+//# 1 "/usr/include/sys/stdtypes.h" 1
+
+
+
+
+
+
+
+
+
+
+//# 32 "/usr/include/sys/stdtypes.h"
+
+//# 6 "/usr/include/time.h" 2
+
+
+
+
+struct tm {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+ char *tm_zone;
+ long tm_gmtoff;
+};
+
+extern struct tm *c_proto_gmtime (), *c_proto_localtime ();
+extern char *c_proto_asctime (), *c_proto_ctime ();
+extern void c_proto_tzset (), c_proto_tzsetwall ();
+extern int dysize(int);
+extern time_t timelocal(), timegm();
+
+
+//# 49 "/giga/hgs/lib/g++-include/time.h" 2
+
+
+//# 1 "/usr/include/sys/times.h" 1
+
+
+
+
+
+
+
+
+
+//# 1 "/giga/hgs/lib/g++-include/sys/types.h" 1
+
+
+//# 1 "/giga/hgs/lib/g++-include/stddef.h" 1
+
+extern "C" {
+//# 1 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h" 1
+//# 94 "/giga/hgs/lib/gcc/sun4/cygnus-1.96/include/stddef.h"
+
+//# 3 "/giga/hgs/lib/g++-include/stddef.h" 2
+
+}
+//# 73 "/giga/hgs/lib/g++-include/stddef.h"
+
+//# 3 "/giga/hgs/lib/g++-include/sys/types.h" 2
+
+
+
+
+extern "C"
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 1 "/usr/include/sys/types.h" 1
+
+
+
+
+
+
+
+
+//# 115 "/usr/include/sys/types.h"
+
+//# 35 "/giga/hgs/lib/g++-include/sys/types.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
+
+//# 10 "/usr/include/sys/times.h" 2
+
+
+struct tms {
+ clock_t tms_utime;
+ clock_t tms_stime;
+ clock_t tms_cutime;
+ clock_t tms_cstime;
+};
+
+
+clock_t times(tms * );
+
+
+
+//# 51 "/giga/hgs/lib/g++-include/time.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern struct tm* localtime(long*);
+extern struct tm* gmtime(long*);
+extern char* ctime(long*);
+extern char* asctime(struct tm*);
+extern void tzset();
+extern void tzsetwall();
+
+
+
+
+
+
+extern long times(struct tms*);
+
+
+//# 97 "/giga/hgs/lib/g++-include/time.h"
+
+extern char* timezone(int, int);
+extern int getitimer(int, struct itimerval*);
+extern int setitimer(int, struct itimerval*, struct itimerval*);
+extern int gettimeofday(struct timeval*, struct timezone*);
+extern int settimeofday(struct timeval*, struct timezone*);
+extern int stime(long*);
+int dysize(int);
+
+
+
+
+
+
+
+
+long clock(void);
+
+long time(long*);
+unsigned ualarm(unsigned, unsigned);
+unsigned usleep(unsigned);
+int profil(char*, int, int, int);
+
+}
+
+
+
+//# 1 "/giga/hgs/lib/g++-include/sys/times.h" 2
+
+//# 311 "../../../../libg++/etc/benchmarks/dhrystone.cc" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef enum {Ident1, Ident2, Ident3, Ident4, Ident5} Enumeration;
+
+
+
+
+typedef Int OneToThirty;
+typedef Int OneToFifty;
+typedef Char CapitalLetter;
+typedef Char String30[31];
+typedef Int Array1Dim[51];
+typedef Int Array2Dim[51][51];
+
+struct Record
+{
+ struct Record *PtrComp;
+ Enumeration Discr;
+ Enumeration EnumComp;
+ OneToFifty IntComp;
+ String30 StringComp;
+};
+
+typedef struct Record RecordType;
+typedef RecordType * RecordPtr;
+typedef int boolean;
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+extern int printf(const char* ...);
+extern void exit(int);
+}
+
+void Proc0();
+void Proc1(RecordPtr PtrParIn);
+void Proc2(OneToFifty *IntParIO);
+void Proc3(RecordPtr *PtrParOut);
+void Proc4();
+void Proc5();
+boolean Func3(Enumeration EnumParIn);
+void Proc6( Enumeration EnumParIn, Enumeration *EnumParOut);
+void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty *IntParOut);
+void Proc8(Array1Dim Array1Par,
+ Array2Dim Array2Par,
+ OneToFifty IntParI1,
+ OneToFifty IntParI2);
+Enumeration Func1(CapitalLetter CharPar1, CapitalLetter CharPar2);
+boolean Func2(String30 StrParI1, String30 StrParI2);
+boolean Func3(Enumeration EnumParIn);
+
+void mystrcpy(String30 s, const char* t)
+{
+ for (; *t != '\0'; ++s, ++t) *s = *t;
+ *s = '\0';
+}
+
+char mystrcmp(String30 s, String30 t)
+{
+ for (; *s == *t; ++s, ++t) if (*s == '\0') return 0;
+ return char(*s - *t);
+}
+
+
+
+main()
+{
+ Proc0();
+ exit(0);
+}
+
+
+
+
+Int IntGlob;
+boolean BoolGlob;
+char Char1Glob;
+char Char2Glob;
+Array1Dim Array1Glob;
+Array2Dim Array2Glob;
+RecordPtr PtrGlb;
+RecordPtr PtrGlbNext;
+
+void Proc0()
+{
+ OneToFifty IntLoc1;
+ OneToFifty IntLoc2;
+ OneToFifty IntLoc3;
+ char CharLoc;
+ char CharIndex;
+ Enumeration EnumLoc;
+ String30 String1Loc;
+ String30 String2Loc;
+
+//# 445 "../../../../libg++/etc/benchmarks/dhrystone.cc"
+
+
+ time_t starttime;
+ time_t benchtime;
+ time_t nulltime;
+ struct tms Tms;
+ register unsigned int i;
+
+ times(&Tms); starttime = Tms.tms_utime;
+ for (i = 0; i < 500000 ; ++i);
+ times(&Tms);
+ nulltime = Tms.tms_utime - starttime;
+
+
+ PtrGlbNext = new Record;
+ PtrGlb = new Record;
+ PtrGlb->PtrComp = PtrGlbNext;
+ PtrGlb->Discr = Ident1;
+ PtrGlb->EnumComp = Ident3;
+ PtrGlb->IntComp = 40;
+ mystrcpy(PtrGlb->StringComp, "DHRYSTONE PROGRAM, SOME STRING");
+ mystrcpy(String1Loc, "JUST INITIALIZED TO SOME JUNK.");
+
+
+
+
+
+
+
+
+ times(&Tms); starttime = Tms.tms_utime;
+
+ for (i = 0; i < 500000 ; ++i)
+ {
+
+ Proc5();
+ Proc4();
+ IntLoc1 = 2;
+ IntLoc2 = 3;
+ mystrcpy(String2Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
+ EnumLoc = Ident2;
+ BoolGlob = ! Func2(String1Loc, String2Loc);
+ while (IntLoc1 < IntLoc2)
+ {
+ IntLoc3 = 5 * IntLoc1 - IntLoc2;
+ Proc7(IntLoc1, IntLoc2, &IntLoc3);
+ ++IntLoc1;
+ }
+ Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3);
+ Proc1(PtrGlb);
+ for (CharIndex = 'A'; CharIndex <= Char2Glob; ++CharIndex)
+ if (EnumLoc == Func1(CharIndex, 'C'))
+ Proc6(Ident1, &EnumLoc);
+ IntLoc3 = IntLoc2 * IntLoc1;
+ IntLoc2 = IntLoc3 / IntLoc1;
+ IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1;
+ Proc2(&IntLoc1);
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ times(&Tms);
+ benchtime = Tms.tms_utime - starttime - nulltime;
+ printf("Dhrystone time for %ld passes = %ld\n",
+ (long) 500000 , benchtime/60 );
+ printf("This machine benchmarks at %ld dhrystones/second\n",
+ ((long) 500000 ) * 60 / benchtime);
+
+
+}
+
+void Proc1(RecordPtr PtrParIn)
+{
+
+
+ (*(PtrParIn->PtrComp)) = *PtrGlb ;
+ PtrParIn->IntComp = 5;
+ (*(PtrParIn->PtrComp)) .IntComp = PtrParIn->IntComp;
+ (*(PtrParIn->PtrComp)) .PtrComp = PtrParIn->PtrComp;
+
+ Proc3(&((*(PtrParIn->PtrComp)) .PtrComp));
+ if ((*(PtrParIn->PtrComp)) .Discr == Ident1)
+ {
+ (*(PtrParIn->PtrComp)) .IntComp = 6;
+ Proc6(PtrParIn->EnumComp, &(*(PtrParIn->PtrComp)) .EnumComp);
+ (*(PtrParIn->PtrComp)) .PtrComp = PtrGlb->PtrComp;
+ Proc7((*(PtrParIn->PtrComp)) .IntComp, 10, &(*(PtrParIn->PtrComp)) .IntComp);
+ }
+ else
+ *PtrParIn = (*(PtrParIn->PtrComp)) ;
+
+
+}
+
+void Proc2(OneToFifty *IntParIO)
+{
+ OneToFifty IntLoc;
+ Enumeration EnumLoc;
+
+ IntLoc = *IntParIO + 10;
+ for(;;)
+ {
+ if (Char1Glob == 'A')
+ {
+ --IntLoc;
+ *IntParIO = IntLoc - IntGlob;
+ EnumLoc = Ident1;
+ }
+ if (EnumLoc == Ident1)
+ break;
+ }
+}
+
+void Proc3(RecordPtr *PtrParOut)
+{
+ if (PtrGlb != 0 )
+ *PtrParOut = PtrGlb->PtrComp;
+ else
+ IntGlob = 100;
+ Proc7(10, IntGlob, &PtrGlb->IntComp);
+}
+
+void Proc4()
+{
+ boolean BoolLoc;
+
+ BoolLoc = Char1Glob == 'A';
+ BoolLoc |= BoolGlob;
+ Char2Glob = 'B';
+}
+
+void Proc5()
+{
+ Char1Glob = 'A';
+ BoolGlob = 0 ;
+}
+
+
+
+
+void Proc6( Enumeration EnumParIn, Enumeration *EnumParOut)
+{
+ *EnumParOut = EnumParIn;
+ if (! Func3(EnumParIn) )
+ *EnumParOut = Ident4;
+ switch (EnumParIn)
+ {
+ case Ident1: *EnumParOut = Ident1; break;
+ case Ident2: if (IntGlob > 100) *EnumParOut = Ident1;
+ else *EnumParOut = Ident4;
+ break;
+ case Ident3: *EnumParOut = Ident2; break;
+ case Ident4: break;
+ case Ident5: *EnumParOut = Ident3;
+ }
+}
+
+void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty *IntParOut)
+{
+ OneToFifty IntLoc;
+
+ IntLoc = IntParI1 + 2;
+ *IntParOut = IntParI2 + IntLoc;
+}
+
+void Proc8(Array1Dim Array1Par,
+ Array2Dim Array2Par,
+ OneToFifty IntParI1,
+ OneToFifty IntParI2)
+{
+ OneToFifty IntLoc;
+ OneToFifty IntIndex;
+
+ IntLoc = IntParI1 + 5;
+ Array1Par[IntLoc] = IntParI2;
+ Array1Par[IntLoc+1] = Array1Par[IntLoc];
+ Array1Par[IntLoc+30] = IntLoc;
+ for (IntIndex = IntLoc; IntIndex <= (IntLoc+1); ++IntIndex)
+ Array2Par[IntLoc][IntIndex] = IntLoc;
+ ++Array2Par[IntLoc][IntLoc-1];
+ Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc];
+ IntGlob = 5;
+}
+
+Enumeration Func1(CapitalLetter CharPar1, CapitalLetter CharPar2)
+{
+ CapitalLetter CharLoc1;
+ CapitalLetter CharLoc2;
+
+ CharLoc1 = CharPar1;
+ CharLoc2 = CharLoc1;
+ if (CharLoc2 != CharPar2)
+ return (Ident1);
+ else
+ return (Ident2);
+}
+
+boolean Func2(String30 StrParI1, String30 StrParI2)
+{
+ OneToThirty IntLoc;
+ CapitalLetter CharLoc;
+
+ IntLoc = 1;
+ while (IntLoc <= 1)
+ if (Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1)
+ {
+ CharLoc = 'A';
+ ++IntLoc;
+ }
+ if (CharLoc >= 'W' && CharLoc <= 'Z')
+ IntLoc = 7;
+ if (CharLoc == 'X')
+ return( 1 );
+ else
+ {
+ if (mystrcmp(StrParI1, StrParI2) > 0)
+ {
+ IntLoc += 7;
+ return ( 1 );
+ }
+ else
+ return ( 0 );
+ }
+}
+
+boolean Func3(Enumeration EnumParIn)
+{
+ Enumeration EnumLoc;
+
+ EnumLoc = EnumParIn;
+ if (EnumLoc == Ident3) return ( 1 );
+ return ( 0 );
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p701.C b/gcc/testsuite/g++.old-deja/g++.mike/p701.C
new file mode 100644
index 000000000..6a5259104
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p701.C
@@ -0,0 +1,34 @@
+// { dg-do assemble }
+// prms-id: 701
+
+extern "C"
+{
+ int printf(const char *, ...);
+}
+
+
+void Munge(int& x) // { dg-error "passing argument 1" }
+{
+ x = 2;
+}
+
+
+class A
+{
+ public:
+ int i;
+ A(int x) : i(x) {}
+ void Safe() const;
+};
+
+void
+A::Safe() const
+{
+ Munge(i); // { dg-error "invalid initialization" }
+}
+
+int main()
+{
+ const A a(1);
+ a.Safe();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p710.C b/gcc/testsuite/g++.old-deja/g++.mike/p710.C
new file mode 100644
index 000000000..7fdd5b022
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p710.C
@@ -0,0 +1,43 @@
+// { dg-do assemble }
+// GROUPS passed delete
+/*
+ Bug Id:
+ PRMS Id: p0000710
+ Bug is : overloading operator delete in class def not allowed
+*/
+
+/*
+ In addition to this bug, the compiler permits overloading operator
+ delete in the class definition. This is verboten, and should be
+ caught by a regression suite. In other words, the following is also a
+ bug that's not caught:
+*/
+
+
+#include <stdlib.h>
+
+extern "C"
+{
+ int printf(const char*, ...);
+}
+
+
+
+class B
+{
+ public:
+ int x;
+ virtual ~B() {}
+ void operator delete(void*,size_t s)
+ {
+ printf("B::delete() %d\n",s);
+ }
+ void operator delete(void*){}
+};
+
+int main()
+{
+ B* p = new B;
+ delete p;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7180.C b/gcc/testsuite/g++.old-deja/g++.mike/p7180.C
new file mode 100644
index 000000000..55b7e1006
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p7180.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// prms-id: 7180
+
+class String {
+public:
+ String(const char*);
+ ~String();
+};
+
+String::String(const char* str = "") {
+}
+
+String::~String(void) {
+}
+
+int main() {
+ const String array[] = {"3"};
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7476.C b/gcc/testsuite/g++.old-deja/g++.mike/p7476.C
new file mode 100644
index 000000000..04d77880f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p7476.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// prms-id: 7476
+
+class HeapTracked {
+public:
+ virtual ~HeapTracked() { }
+ static void isObjectAllocation(const HeapTracked *ptr);
+ static void isObjectAllocation(HeapTracked *ptr);
+};
+
+void HeapTracked::isObjectAllocation(HeapTracked *ptr)
+{
+ dynamic_cast<const void*>(ptr);
+ dynamic_cast<void*>(ptr);
+}
+void HeapTracked::isObjectAllocation(const HeapTracked *ptr)
+{
+ const_cast<void*>(dynamic_cast<const void*>(ptr));
+ dynamic_cast<void*>(ptr); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p755.C b/gcc/testsuite/g++.old-deja/g++.mike/p755.C
new file mode 100644
index 000000000..28eeefad4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p755.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+// It checks to see if you can define your own global new operator.
+// prms-id: 755
+
+#include <new>
+
+extern "C" void _exit(int);
+
+void* operator new(std::size_t sz) throw (std::bad_alloc) {
+ void* p = 0;
+ _exit(0);
+ return p;
+}
+
+int main () {
+ int* i = new int;
+ delete i;
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p755a.C b/gcc/testsuite/g++.old-deja/g++.mike/p755a.C
new file mode 100644
index 000000000..bc23d579e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p755a.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+// It checks to see if you can define your own global delete operator.
+// prms-id: 755
+
+extern "C" void _exit(int);
+
+void operator delete(void *p) throw() {
+ _exit(0);
+}
+
+int main () {
+ int* i = new int;
+ delete i;
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7626.C b/gcc/testsuite/g++.old-deja/g++.mike/p7626.C
new file mode 100644
index 000000000..32c950df2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p7626.C
@@ -0,0 +1,43 @@
+// { dg-do assemble }
+// prms-id: 7626
+
+int fail;
+
+typedef unsigned int UINT;
+
+class CObject{};
+
+class CCmdTarget : public CObject {
+};
+
+typedef void (CCmdTarget::*AFX_PMSG)(void);
+
+struct AFX_MSGMAP_ENTRY {
+ AFX_PMSG pfn;
+};
+
+class CWnd : public CCmdTarget {
+public:
+ void OnMyMsg() { fail = 1; } // If this one is called, something is wrong.
+ static AFX_MSGMAP_ENTRY _messageEntries[];
+};
+
+typedef void (CWnd::*AFX_PMSGW)(void);
+
+class CDialog : public CWnd
+{
+public:
+ void OnMyMsg() { }
+ static AFX_MSGMAP_ENTRY _messageEntries[];
+};
+
+AFX_MSGMAP_ENTRY CDialog ::_messageEntries[] = {
+ { (AFX_PMSG)(AFX_PMSGW)(void (CWnd::*)())&CDialog::OnMyMsg },
+ { (AFX_PMSG)0 }
+};
+
+int main() {
+ CDialog d;
+ (d.*((CDialog::_messageEntries)[0]).pfn)(); // This should call CDialog::OnMyMsg
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7635.C b/gcc/testsuite/g++.old-deja/g++.mike/p7635.C
new file mode 100644
index 000000000..ac31af202
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p7635.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// prms-id: 7635
+
+class DaycountBasis {
+ mutable const int * p;
+ mutable int * const q; // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7651.C b/gcc/testsuite/g++.old-deja/g++.mike/p7651.C
new file mode 100644
index 000000000..6e0aede0d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p7651.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// prms-id: 7651
+
+int fail = 0;
+
+class Foo {
+public:
+ Foo(double i) : data(i) { if (data != 1.0) fail = 1; }
+ ~Foo() { if (data != 1.0) fail = 1; }
+private:
+ volatile double data;
+};
+
+int DingDong(double A) {
+ volatile Foo a(A);
+
+ if ( A != 0.0 ) {
+ return 1;
+ }
+ return 0;
+}
+
+
+int main() {
+ DingDong(1.0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p783.C b/gcc/testsuite/g++.old-deja/g++.mike/p783.C
new file mode 100644
index 000000000..0c04d643f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p783.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+// prms-id: 783
+
+extern "C" int printf (const char *, ...);
+
+class C {
+public:
+ C() { }
+ ~C() { }
+};
+
+int main(int argc, char**argv) {
+ C c,d;
+ c = (argc&1) ? C() : d;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p783a.C b/gcc/testsuite/g++.old-deja/g++.mike/p783a.C
new file mode 100644
index 000000000..17609d583
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p783a.C
@@ -0,0 +1,27 @@
+// { dg-do run }
+// Copying into an object directly is a lose according to tiemann.
+// Deleting an object many times is a lose.
+// prms-id: 783
+
+extern "C" int printf (const char *, ...);
+extern "C" void exit (int);
+
+class C {
+ int i;
+public:
+ C() {
+ i = 1;
+ }
+ ~C() {
+ if (i != 1) {
+ exit(1);
+ }
+ i = 0;
+ }
+};
+
+int main(int argc, char**argv) {
+ C c;
+ c = C();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p783b.C b/gcc/testsuite/g++.old-deja/g++.mike/p783b.C
new file mode 100644
index 000000000..0aacb3285
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p783b.C
@@ -0,0 +1,38 @@
+// { dg-do run }
+// This one check for objects being destroyed twice. The bug it is
+// looking for is the extra dtor call on C() even though it is never
+// built.
+// prms-id: 783
+
+extern "C" int printf (const char *, ...);
+extern "C" void exit (int);
+
+class C {
+ int i;
+public:
+// C() {printf ("C ctor at %x\n", this);}
+// ~C() {printf ("C dtor at %x\n", this);}
+ C() {
+ i = 1;
+ }
+ ~C() {
+ if (i != 1) {
+ exit(1);
+ }
+ i = 0;
+ }
+};
+
+C g;
+
+C func() {
+ return g;
+}
+
+int main(int argc, char**argv) {
+ C c,d;
+// printf ("\n");
+ c = (argc != 1) ? C() : d;
+// printf ("\n");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p784.C b/gcc/testsuite/g++.old-deja/g++.mike/p784.C
new file mode 100644
index 000000000..04a70c2ee
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p784.C
@@ -0,0 +1,3658 @@
+// { dg-do assemble }
+// { dg-require-effective-target ilp32 } */
+// { dg-options "-w" }
+// prms-id: 784
+
+//# 1 "GctSymbol.GctSymbol.CHMap.cc"
+// This may look like C code, but it is really -*- C++ -*-
+/*
+Copyright (C) 1988, 2000, 2002 Free Software Foundation
+ written by Doug Lea (dl@rocky.oswego.edu)
+
+This file is part of the GNU C++ Library. This library is free
+software; you can redistribute it and/or modify it under the terms of
+the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your
+option) any later version. This library is distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU Library General Public License for more details.
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+//#pragma implementation
+
+//# 1 "GctSymbol.GctSymbol.CHMap.h" 1
+// This may look like C code, but it is really -*- C++ -*-
+/*
+Copyright (C) 1988 Free Software Foundation
+ written by Doug Lea (dl@rocky.oswego.edu)
+
+This file is part of the GNU C++ Library. This library is free
+software; you can redistribute it and/or modify it under the terms of
+the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your
+option) any later version. This library is distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU Library General Public License for more details.
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "GctSymbol.GctSymbol.Map.h" 1
+// This may look like C code, but it is really -*- C++ -*-
+/*
+Copyright (C) 1988 Free Software Foundation
+ written by Doug Lea (dl@rocky.oswego.edu)
+
+This file is part of the GNU C++ Library. This library is free
+software; you can redistribute it and/or modify it under the terms of
+the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your
+option) any later version. This library is distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU Library General Public License for more details.
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/Pix.h" 1
+
+
+
+typedef void* Pix;
+
+//# 26 "GctSymbol.GctSymbol.Map.h" 2
+
+//# 1 "GctSymbol.defs.h" 1
+// This may look like C code, but it is really -*- C++ -*-
+/*
+Copyright (C) 1988 Free Software Foundation
+ written by Doug Lea (dl@rocky.oswego.edu)
+
+This file is part of the GNU C++ Library. This library is free
+software; you can redistribute it and/or modify it under the terms of
+the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your
+option) any later version. This library is distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU Library General Public License for more details.
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+
+
+
+
+
+//# 1 "../../GctSymbol.h" 1
+// -*- C++ -*-
+
+
+
+//
+// GctSymbol class
+//
+// Expects to be included by Gct.h
+//
+// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU)
+//
+
+
+
+
+
+//#pragma interface
+
+
+
+
+
+//# 25 "../../GctSymbol.h" 2
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" 1
+// This may look like C code, but it is really -*- C++ -*-
+/*
+Copyright (C) 1988 Free Software Foundation
+ written by Doug Lea (dl@rocky.oswego.edu)
+
+This file is part of the GNU C++ Library. This library is free
+software; you can redistribute it and/or modify it under the terms of
+the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your
+option) any later version. This library is distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU Library General Public License for more details.
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/stream.h" 1
+
+
+
+// Compatibility with old library.
+
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1
+// This is part of the iostream library, providing -*- C++ -*- input/output.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+
+//#pragma interface
+
+
+
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/streambuf.h" 1
+// This is part of the iostream library, providing -*- C++ -*- input/output.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+
+
+//#pragma interface
+
+
+/* KLUDGES!! */
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/stddef.h" 1
+
+
+extern "C" {
+
+
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/mips/lib/gcc/decstatn/cygnus-1.96/include/stddef.h" 1
+
+
+
+
+
+
+/* This avoids lossage on Sunos but only if stdtypes.h comes first.
+ There's no way to win with the other order! Sun lossage. */
+
+/* In case nobody has defined these types, but we aren't running under
+ GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and
+ __WCHAR_TYPE__ have reasonable values. This can happen if the
+ parts of GCC is compiled by an older compiler, that actually
+ include gstddef.h, such as collect2. */
+
+/* Signed type of difference of two pointers. */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef long int ptrdiff_t;
+
+
+
+
+
+
+/* Unsigned type of `sizeof' something. */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned int size_t;
+
+
+
+
+
+
+/* Data type for wide chars. */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/* A null pointer constant. */
+
+
+
+
+/* Offset of member MEMBER in a struct of type TYPE. */
+
+
+
+
+
+//# 7 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/stddef.h" 2
+
+
+
+
+}
+
+//# 25 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/streambuf.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class ostream; class streambuf;
+
+typedef long streamoff, streampos;
+
+struct _ios_fields { // The data members of an ios.
+ streambuf *_strbuf;
+ ostream* _tie;
+ long _width;
+ unsigned long _flags;
+ char _fill;
+ unsigned char _state;
+ unsigned short _precision;
+};
+
+
+enum state_value { _good = 0, _eof = 1, _fail = 2, _bad = 4 };
+
+
+class ios : public _ios_fields {
+ public:
+ enum io_state { goodbit=0, eofbit=1, failbit=2, badbit=4 };
+ enum open_mode {
+ in=1,
+ out=2,
+ ate=4,
+ app=8,
+ trunc=16,
+ nocreate=32,
+ noreplace=64 };
+ enum seek_dir { beg, cur, end};
+ enum { skipws=01, left=02, right=04, internal=010,
+ dec=020, oct=040, hex=0100,
+ showbase=0200, showpoint=0400, uppercase=01000, showpos=02000,
+ scientific=04000, fixed=0100000, unitbuf=020000, stdio=040000,
+ dont_close=0x80000000 //Don't close streambuf when destroying stream
+ };
+
+ ostream* tie() { return _tie; }
+ ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
+
+ // Methods to change the format state.
+ char fill() { return _fill; }
+ char fill(char newf) { char oldf = _fill; _fill = newf; return oldf; }
+ unsigned long flags() { return _flags; }
+ unsigned long flags(unsigned long new_val) {
+ unsigned long old_val = _flags; _flags = new_val; return old_val; }
+ unsigned short precision() { return _precision; }
+ unsigned short precision(int newp) {
+ unsigned short oldp = _precision; _precision = (unsigned short)newp;
+ return oldp; }
+ unsigned long setf(unsigned long val) {
+ unsigned long oldbits = _flags;
+ _flags |= val; return oldbits; }
+ unsigned long setf(unsigned long val, unsigned long mask) {
+ unsigned long oldbits = _flags;
+ _flags = (_flags & ~mask) | (val & mask); return oldbits; }
+ unsigned long unsetf(unsigned long mask) {
+ unsigned long oldbits = _flags & mask;
+ _flags &= ~mask; return oldbits; }
+ long width() { return _width; }
+ long width(long val) { long save = _width; _width = val; return save; }
+
+ static const unsigned long basefield;
+ static const unsigned long adjustfield;
+ static const unsigned long floatfield;
+
+ streambuf* rdbuf() { return _strbuf; }
+ void clear(int state = 0) { _state = state; }
+ int good() { return _state == 0; }
+ int eof() { return _state & ios::eofbit; }
+ int fail() { return _state & (ios::badbit|ios::failbit); }
+ int bad() { return _state & ios::badbit; }
+ int rdstate() { return _state; }
+ void set(int flag) { _state |= flag; }
+ operator void*() { return fail() ? (void*)0 : (void*)this; }
+ int operator!() { return fail(); }
+
+
+ void unset(state_value flag) { _state &= ~flag; }
+ void close();
+ int is_open();
+ int readable();
+ int writable();
+
+
+ protected:
+ ios(streambuf*sb) { _strbuf=sb; _state=0; _width=0; _fill=' ';
+ _flags=ios::skipws; _precision=6; }
+};
+
+
+
+
+typedef ios::seek_dir _seek_dir;
+
+
+// Magic numbers and bits for the _flags field.
+// The magic numbers use the high-order bits of _flags;
+// the remaining bits are abailable for variable flags.
+// Note: The magic numbers must all be negative if stdio
+// emulation is desired.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct __streambuf {
+ // NOTE: If this is changed, also change __FILE in stdio/stdio.h!
+ int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
+ char* _gptr; /* Current get pointer */
+ char* _egptr; /* End of get area. */
+ char* _eback; /* Start of putback+get area. */
+ char* _pbase; /* Start of put area. */
+ char* _pptr; /* Current put pointer. */
+ char* _epptr; /* End of put area. */
+ char* _base; /* Start of reserve area. */
+ char* _ebuf; /* End of reserve area. */
+ struct streambuf *_chain;
+};
+
+struct streambuf : private __streambuf {
+ friend class ios;
+ friend class istream;
+ friend class ostream;
+ protected:
+ static streambuf* _list_all; /* List of open streambufs. */
+ streambuf*& xchain() { return _chain; }
+ void _un_link();
+ void _link_in();
+ char* gptr() const { return _gptr; }
+ char* pptr() const { return _pptr; }
+ char* egptr() const { return _egptr; }
+ char* epptr() const { return _epptr; }
+ char* pbase() const { return _pbase; }
+ char* eback() const { return _eback; }
+ char* ebuf() const { return _ebuf; }
+ char* base() const { return _base; }
+ void xput_char(char c) { *_pptr++ = c; }
+ int xflags() { return _flags; }
+ int xflags(int f) { int fl = _flags; _flags = f; return fl; }
+ void xsetflags(int f) { _flags |= f; }
+ void gbump(int n) { _gptr += n; }
+ void pbump(int n) { _pptr += n; }
+ void setb(char* b, char* eb, int a=0);
+ void setp(char* p, char* ep) { _pbase=_pptr=p; _epptr=ep; }
+ void setg(char* eb, char* g, char *eg) { _eback=eb; _gptr=g; _egptr=eg; }
+ public:
+ static int flush_all();
+ static void flush_all_linebuffered(); // Flush all line buffered files.
+ virtual int underflow(); // Leave public for now
+ virtual int overflow(int c = (-1) ); // Leave public for now
+ virtual int doallocate();
+ virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
+ virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
+ int sputbackc(char c);
+ int sungetc();
+ streambuf();
+ virtual ~streambuf();
+ int unbuffered() { return _flags & 2 ? 1 : 0; }
+ int linebuffered() { return _flags & 0x4000 ? 1 : 0; }
+ void unbuffered(int i)
+ { if (i) _flags |= 2 ; else _flags &= ~2 ; }
+ void linebuffered(int i)
+ { if (i) _flags |= 0x4000 ; else _flags &= ~0x4000 ; }
+ int allocate() {
+ if (base() || unbuffered()) return 0;
+ else return doallocate(); }
+ virtual int sync();
+ virtual int pbackfail(int c);
+ virtual int ungetfail();
+ virtual streambuf* setbuf(char* p, int len);
+ int in_avail() { return _egptr - _gptr; }
+ int out_waiting() { return _pptr - _pbase; }
+ virtual int sputn(const char* s, int n);
+ virtual int sgetn(char* s, int n);
+ long sgetline(char* buf, size_t n, char delim, int putback_delim);
+ int sbumpc() {
+ if (_gptr >= _egptr && underflow() == (-1) ) return (-1) ;
+ else return *(unsigned char*)_gptr++; }
+ int sgetc() {
+ if (_gptr >= _egptr && underflow() == (-1) ) return (-1) ;
+ else return *(unsigned char*)_gptr; }
+ int snextc() {
+ if (++_gptr >= _egptr && underflow() == (-1) ) return (-1) ;
+ else return *(unsigned char*)_gptr; }
+ int sputc(int c) {
+ if (_pptr >= _epptr) return overflow(c);
+ return *_pptr++ = c, (unsigned char)c; }
+ int vscan(char const *fmt0, char* ap);
+ int vform(char const *fmt0, char* ap);
+};
+
+struct __file_fields {
+ char _fake;
+ char _shortbuf[1];
+ short _fileno;
+ int _blksize;
+ char* _save_gptr;
+ char* _save_egptr;
+ long _offset;
+};
+
+class filebuf : public streambuf {
+ struct __file_fields _fb;
+ void init();
+ public:
+ filebuf();
+ filebuf(int fd);
+ filebuf(int fd, char* p, int len);
+ ~filebuf();
+ filebuf* attach(int fd);
+ filebuf* open(const char *filename, const char *mode);
+ filebuf* open(const char *filename, int mode, int prot = 0664);
+ virtual int underflow();
+ virtual int overflow(int c = (-1) );
+ int is_open() { return _fb._fileno >= 0; }
+ int fd() { return is_open() ? _fb._fileno : (-1) ; }
+ filebuf* close();
+ virtual int doallocate();
+ virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
+ int sputn(const char* s, int n);
+ int sgetn(char* s, int n);
+ protected: // See documentation in filebuf.C.
+ virtual int pbackfail(int c);
+ virtual int sync();
+ int is_reading() { return eback() != egptr(); }
+ char* cur_ptr() { return is_reading() ? gptr() : pptr(); }
+ /* System's idea of pointer */
+ char* file_ptr() { return _fb._save_gptr ? _fb._save_egptr : egptr(); }
+ int do_flush();
+ // Low-level operations (Usually invoke system calls.)
+ virtual int sys_read(char* buf, size_t size);
+ virtual long sys_seek(long , _seek_dir);
+ virtual long sys_write(const void*, long);
+ virtual int sys_stat(void*); // Actually, a (struct stat*)
+ virtual int sys_close();
+};
+
+
+inline int ios::readable() { return rdbuf()->_flags & 4 ; }
+inline int ios::writable() { return rdbuf()->_flags & 8 ; }
+inline int ios::is_open() {return rdbuf()->_flags & 4 +8 ;}
+
+
+
+
+//# 25 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 2
+
+
+class istream; class ostream;
+typedef istream& (*__imanip)(istream&);
+typedef ostream& (*__omanip)(ostream&);
+
+extern istream& ws(istream& ins);
+extern ostream& flush(ostream& outs);
+extern ostream& endl(ostream& outs);
+extern ostream& ends(ostream& outs);
+
+class ostream : public ios
+{
+ void do_osfx();
+ public:
+ ostream();
+ ostream(streambuf* sb, ostream* tied=(__null) );
+ ~ostream();
+
+ int opfx() { if (!good()) return 0; if (_tie) _tie->flush(); return 1; }
+ void osfx() { if (flags() & (ios::unitbuf|ios::stdio))
+ do_osfx(); }
+ streambuf* ostreambuf() const { return _strbuf; }
+ ostream& flush();
+ ostream& put(char c);
+ ostream& write(const char *s, int n);
+ ostream& write(const unsigned char *s, int n) { return write((char*)s, n);}
+ ostream& write(const void *s, int n) { return write((char*)s, n);}
+ ostream& seekp(streampos);
+ ostream& seekp(streamoff, _seek_dir);
+ streampos tellp();
+ ostream& form(const char *format ...);
+ ostream& vform(const char *format, char* args);
+};
+
+ostream& operator<<(ostream&, char c);
+ostream& operator<<(ostream& os, unsigned char c) { return os << (char)c; }
+//ostream& operator<<(ostream &os, signed char c) { return os << (char)c; }
+extern ostream& operator<<(ostream&, const char *s);
+inline ostream& operator<<(ostream& os, const unsigned char *s)
+{ return os << (const char*)s; }
+//inline ostream& operator<<(ostream& os, const signed char *s)
+//{ return os << (const char*)s; }
+ostream& operator<<(ostream&, void *p);
+ostream& operator<<(ostream&, int n);
+ostream& operator<<(ostream&, long n);
+ostream& operator<<(ostream&, unsigned int n);
+ostream& operator<<(ostream&, unsigned long n);
+ostream& operator<<(ostream& os, short n) {return os << (int)n;}
+ostream& operator<<(ostream& os, unsigned short n)
+{return os << (unsigned int)n;}
+ostream& operator<<(ostream&, float n);
+ostream& operator<<(ostream&, double n);
+ostream& operator<<(ostream& os, __omanip func) { return (*func)(os); }
+ostream& operator<<(ostream&, streambuf*);
+
+class istream : public ios
+{
+ size_t _gcount;
+ public:
+ istream();
+ istream(streambuf* sb, ostream*tied=(__null) );
+ ~istream();
+ streambuf* istreambuf() const { return _strbuf; }
+ istream& get(char& c);
+ istream& get(unsigned char& c);
+ istream& read(char *ptr, int n);
+ istream& read(unsigned char *ptr, int n) { return read((char*)ptr, n); }
+ istream& read(void *ptr, int n) { return read((char*)ptr, n); }
+ int get() { return _strbuf->sbumpc(); }
+ istream& getline(char* ptr, int len, char delim = '\n');
+ istream& get(char* ptr, int len, char delim = '\n');
+ istream& gets(char **s, char delim = '\n');
+ int ipfx(int need) {
+ if (!good()) { set(ios::failbit); return 0; }
+ if (_tie && (need == 0 || rdbuf()->in_avail())) ; //??? THIS LINE IS QUESTIONABLE */
+ if (!need && (flags() & ios::skipws) && !ws(*this)) return 0;
+ return 1;
+ }
+ int ipfx0() { // Optimized version of ipfx(0).
+ if (!good()) { set(ios::failbit); return 0; }
+ if (_tie) _tie->flush();
+ if ((flags() & ios::skipws) && !ws(*this)) return 0;
+ return 1;
+ }
+ int ipfx1() { // Optimized version of ipfx(1).
+ if (!good()) { set(ios::failbit); return 0; }
+ if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
+ return 1;
+ }
+ size_t gcount() { return _gcount; }
+ istream& seekg(streampos);
+ istream& seekg(streamoff, _seek_dir);
+ streampos tellg();
+ istream& putback(char ch) {
+ if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit);
+ return *this;}
+ istream& unget() {
+ if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit);
+ return *this;}
+
+ istream& unget(char ch) { return putback(ch); }
+ int skip(int i);
+
+};
+
+istream& operator>>(istream&, char*);
+istream& operator>>(istream& is, unsigned char* p) { return is >> (char*)p; }
+//istream& operator>>(istream& is, signed char* p) { return is >> (char*)p; }
+istream& operator>>(istream&, char& c);
+istream& operator>>(istream&, unsigned char& c);
+//istream& operator>>(istream&, signed char& c);
+istream& operator>>(istream&, int&);
+istream& operator>>(istream&, long&);
+istream& operator>>(istream&, short&);
+istream& operator>>(istream&, unsigned int&);
+istream& operator>>(istream&, unsigned long&);
+istream& operator>>(istream&, unsigned short&);
+istream& operator>>(istream&, float&);
+istream& operator>>(istream&, double&);
+istream& operator>>(istream& is, __imanip func) { return (*func)(is); }
+
+class iostream : public ios {
+ size_t _gcount;
+ public:
+ iostream();
+ operator istream&() { return *(istream*)this; }
+ operator ostream&() { return *(ostream*)this; }
+ ~iostream();
+ // NOTE: These duplicate istream methods.
+ istream& get(char& c) { return ((istream*)this)->get(c); }
+ istream& get(unsigned char& c) { return ((istream*)this)->get(c); }
+ istream& read(char *ptr, int n) { return ((istream*)this)->read(ptr, n); }
+ istream& read(unsigned char *ptr, int n)
+ { return ((istream*)this)->read((char*)ptr, n); }
+ istream& read(void *ptr, int n)
+ { return ((istream*)this)->read((char*)ptr, n); }
+ int get() { return _strbuf->sbumpc(); }
+ istream& getline(char* ptr, int len, char delim = '\n')
+ { return ((istream*)this)->getline(ptr, len, delim); }
+ istream& get(char* ptr, int len, char delim = '\n')
+ { return ((istream*)this)->get(ptr, len, delim); }
+ istream& gets(char **s, char delim = '\n')
+ { return ((istream*)this)->gets(s, delim); }
+ int ipfx(int need) { return ((istream*)this)->ipfx(need); }
+ int ipfx0() { return ((istream*)this)->ipfx0(); }
+ int ipfx1() { return ((istream*)this)->ipfx1(); }
+ size_t gcount() { return _gcount; }
+ istream& putback(char ch) { return ((istream*)this)->putback(ch); }
+ istream& unget() { return ((istream*)this)->unget(); }
+ istream& seekg(streampos pos) { return ((istream*)this)->seekg(pos); }
+ istream& seekg(streamoff off, _seek_dir dir)
+ { return ((istream*)this)->seekg(off, dir); }
+ streampos tellg() { return ((istream*)this)->tellg(); }
+
+ istream& unget(char ch) { return putback(ch); }
+
+
+ // NOTE: These duplicate ostream methods.
+ int opfx() { return ((ostream*)this)->opfx(); }
+ void osfx() { ((ostream*)this)->osfx(); }
+ ostream& flush() { return ((ostream*)this)->flush(); }
+ ostream& put(char c) { return ((ostream*)this)->put(c); }
+ ostream& write(const char *s, int n)
+ { return ((ostream*)this)->write(s, n); }
+ ostream& write(const unsigned char *s, int n)
+ { return ((ostream*)this)->write((char*)s, n); }
+ ostream& write(const void *s, int n)
+ { return ((ostream*)this)->write((char*)s, n); }
+ ostream& form(const char *format ...);
+ ostream& vform(const char *format, char* args)
+ { return ((ostream*)this)->vform(format, args); }
+ ostream& seekp(streampos pos) { return ((ostream*)this)->seekp(pos); }
+ ostream& seekp(streamoff off, _seek_dir dir)
+ { return ((ostream*)this)->seekp(off, dir); }
+ streampos tellp() { return ((ostream*)this)->tellp(); }
+};
+
+extern istream cin;
+extern ostream cout, cerr, clog; // clog->rdbuf() == cerr->rdbuf()
+
+inline ostream& ostream::put(char c) { _strbuf->sputc(c); return *this; }
+
+struct Iostream_init { } ; // Compatibility hack for AT&T libraray.
+
+
+//# 7 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/stream.h" 2
+
+
+extern char* form(char*, ...);
+
+extern char* dec(long, int=0);
+extern char* dec(int, int=0);
+extern char* dec(unsigned long, int=0);
+extern char* dec(unsigned int, int=0);
+
+extern char* hex(long, int=0);
+extern char* hex(int, int=0);
+extern char* hex(unsigned long, int=0);
+extern char* hex(unsigned int, int=0);
+
+extern char* oct(long, int=0);
+extern char* oct(int, int=0);
+extern char* oct(unsigned long, int=0);
+extern char* oct(unsigned int, int=0);
+
+inline istream& WS(istream& str) { return ws(str); }
+
+
+//# 26 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" 2
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/Regex.h" 1
+// This may look like C code, but it is really -*- C++ -*-
+/*
+Copyright (C) 1988 Free Software Foundation
+ written by Doug Lea (dl@rocky.oswego.edu)
+
+This file is part of the GNU C++ Library. This library is free
+software; you can redistribute it and/or modify it under the terms of
+the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your
+option) any later version. This library is distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU Library General Public License for more details.
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+
+
+//#pragma interface
+
+
+
+
+
+
+
+
+
+struct re_pattern_buffer; // defined elsewhere
+struct re_registers;
+
+class Regex
+{
+private:
+
+ Regex(const Regex&) {} // no X(X&)
+ void operator = (const Regex&) {} // no assignment
+
+protected:
+ re_pattern_buffer* buf;
+ re_registers* reg;
+
+public:
+ Regex(const char* t,
+ int fast = 0,
+ int bufsize = 40,
+ const char* transtable = 0);
+
+ ~Regex();
+
+ int match(const char* s, int len, int pos = 0) const;
+ int search(const char* s, int len,
+ int& matchlen, int startpos = 0) const;
+ int match_info(int& start, int& length, int nth = 0) const;
+
+ int OK() const; // representation invariant
+};
+
+// some built in regular expressions
+
+extern const Regex RXwhite; // = "[ \n\t\r\v\f]+"
+extern const Regex RXint; // = "-?[0-9]+"
+extern const Regex RXdouble; // = "-?\\(\\([0-9]+\\.[0-9]*\\)\\|
+ // \\([0-9]+\\)\\|\\(\\.[0-9]+\\)\\)
+ // \\([eE][---+]?[0-9]+\\)?"
+extern const Regex RXalpha; // = "[A-Za-z]+"
+extern const Regex RXlowercase; // = "[a-z]+"
+extern const Regex RXuppercase; // = "[A-Z]+"
+extern const Regex RXalphanum; // = "[0-9A-Za-z]+"
+extern const Regex RXidentifier; // = "[A-Za-z_][A-Za-z0-9_]*"
+
+
+
+//# 27 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" 2
+
+
+struct StrRep // internal String representations
+{
+ unsigned short len; // string length
+ unsigned short sz; // allocated space
+ char s[1]; // the string starts here
+ // (at least 1 char for trailing null)
+ // allocated & expanded via non-public fcts
+};
+
+// primitive ops on StrReps -- nearly all String fns go through these.
+
+StrRep* Salloc(StrRep*, const char*, int, int);
+StrRep* Scopy(StrRep*, StrRep*);
+StrRep* Sresize(StrRep*, int);
+StrRep* Scat(StrRep*, const char*, int, const char*, int);
+StrRep* Scat(StrRep*, const char*, int,const char*,int, const char*,int);
+StrRep* Sprepend(StrRep*, const char*, int);
+StrRep* Sreverse(StrRep*, StrRep*);
+StrRep* Supcase(StrRep*, StrRep*);
+StrRep* Sdowncase(StrRep*, StrRep*);
+StrRep* Scapitalize(StrRep*, StrRep*);
+
+// These classes need to be defined in the order given
+
+class String;
+class SubString;
+
+class SubString
+{
+ friend class String;
+protected:
+
+ String& S; // The String I'm a substring of
+ unsigned short pos; // starting position in S's rep
+ unsigned short len; // length of substring
+
+ void assign(StrRep*, const char*, int = -1);
+ SubString(String& x, int p, int l);
+ SubString(const SubString& x);
+
+public:
+
+// Note there are no public constructors. SubStrings are always
+// created via String operations
+
+ ~SubString();
+
+ void operator = (const String& y);
+ void operator = (const SubString& y);
+ void operator = (const char* t);
+ void operator = (char c);
+
+// return 1 if target appears anywhere in SubString; else 0
+
+ int contains(char c) const;
+ int contains(const String& y) const;
+ int contains(const SubString& y) const;
+ int contains(const char* t) const;
+ int contains(const Regex& r) const;
+
+// return 1 if target matches entire SubString
+
+ int matches(const Regex& r) const;
+
+// IO
+
+ friend ostream& operator<<(ostream& s, const SubString& x);
+
+// status
+
+ unsigned int length() const;
+ int empty() const;
+ const char* chars() const;
+
+ int OK() const;
+
+};
+
+
+class String
+{
+ friend class SubString;
+
+protected:
+ StrRep* rep; // Strings are pointers to their representations
+
+// some helper functions
+
+ int search(int, int, const char*, int = -1) const;
+ int search(int, int, char) const;
+ int match(int, int, int, const char*, int = -1) const;
+ int _gsub(const char*, int, const char* ,int);
+ int _gsub(const Regex&, const char*, int);
+ SubString _substr(int, int);
+
+public:
+
+// constructors & assignment
+
+ String();
+ String(const String& x);
+ String(const SubString& x);
+ String(const char* t);
+ String(const char* t, int len);
+ String(char c);
+
+ ~String();
+
+ void operator = (const String& y);
+ void operator = (const char* y);
+ void operator = (char c);
+ void operator = (const SubString& y);
+
+// concatenation
+
+ void operator += (const String& y);
+ void operator += (const SubString& y);
+ void operator += (const char* t);
+ void operator += (char c);
+
+ void prepend(const String& y);
+ void prepend(const SubString& y);
+ void prepend(const char* t);
+ void prepend(char c);
+
+
+// procedural versions:
+// concatenate first 2 args, store result in last arg
+
+ friend void cat(const String&, const String&, String&);
+ friend void cat(const String&, const SubString&, String&);
+ friend void cat(const String&, const char*, String&);
+ friend void cat(const String&, char, String&);
+
+ friend void cat(const SubString&, const String&, String&);
+ friend void cat(const SubString&, const SubString&, String&);
+ friend void cat(const SubString&, const char*, String&);
+ friend void cat(const SubString&, char, String&);
+
+ friend void cat(const char*, const String&, String&);
+ friend void cat(const char*, const SubString&, String&);
+ friend void cat(const char*, const char*, String&);
+ friend void cat(const char*, char, String&);
+
+// double concatenation, by request. (yes, there are too many versions,
+// but if one is supported, then the others should be too...)
+// Concatenate first 3 args, store in last arg
+
+ friend void cat(const String&,const String&, const String&,String&);
+ friend void cat(const String&,const String&,const SubString&,String&);
+ friend void cat(const String&,const String&, const char*, String&);
+ friend void cat(const String&,const String&, char, String&);
+ friend void cat(const String&,const SubString&,const String&,String&);
+ friend void cat(const String&,const SubString&,const SubString&,String&);
+ friend void cat(const String&,const SubString&, const char*, String&);
+ friend void cat(const String&,const SubString&, char, String&);
+ friend void cat(const String&,const char*, const String&, String&);
+ friend void cat(const String&,const char*, const SubString&, String&);
+ friend void cat(const String&,const char*, const char*, String&);
+ friend void cat(const String&,const char*, char, String&);
+
+ friend void cat(const char*, const String&, const String&,String&);
+ friend void cat(const char*,const String&,const SubString&,String&);
+ friend void cat(const char*,const String&, const char*, String&);
+ friend void cat(const char*,const String&, char, String&);
+ friend void cat(const char*,const SubString&,const String&,String&);
+ friend void cat(const char*,const SubString&,const SubString&,String&);
+ friend void cat(const char*,const SubString&, const char*, String&);
+ friend void cat(const char*,const SubString&, char, String&);
+ friend void cat(const char*,const char*, const String&, String&);
+ friend void cat(const char*,const char*, const SubString&, String&);
+ friend void cat(const char*,const char*, const char*, String&);
+ friend void cat(const char*,const char*, char, String&);
+
+
+// searching & matching
+
+// return position of target in string or -1 for failure
+
+ int index(char c, int startpos = 0) const;
+ int index(const String& y, int startpos = 0) const;
+ int index(const SubString& y, int startpos = 0) const;
+ int index(const char* t, int startpos = 0) const;
+ int index(const Regex& r, int startpos = 0) const;
+
+// return 1 if target appears anyhere in String; else 0
+
+ int contains(char c) const;
+ int contains(const String& y) const;
+ int contains(const SubString& y) const;
+ int contains(const char* t) const;
+ int contains(const Regex& r) const;
+
+// return 1 if target appears anywhere after position pos
+// (or before, if pos is negative) in String; else 0
+
+ int contains(char c, int pos) const;
+ int contains(const String& y, int pos) const;
+ int contains(const SubString& y, int pos) const;
+ int contains(const char* t, int pos) const;
+ int contains(const Regex& r, int pos) const;
+
+// return 1 if target appears at position pos in String; else 0
+
+ int matches(char c, int pos = 0) const;
+ int matches(const String& y, int pos = 0) const;
+ int matches(const SubString& y, int pos = 0) const;
+ int matches(const char* t, int pos = 0) const;
+ int matches(const Regex& r, int pos = 0) const;
+
+// return number of occurences of target in String
+
+ int freq(char c) const;
+ int freq(const String& y) const;
+ int freq(const SubString& y) const;
+ int freq(const char* t) const;
+
+// SubString extraction
+
+// Note that you can't take a substring of a const String, since
+// this leaves open the possiblility of indirectly modifying the
+// String through the SubString
+
+ SubString at(int pos, int len);
+ SubString operator () (int pos, int len); // synonym for at
+
+ SubString at(const String& x, int startpos = 0);
+ SubString at(const SubString& x, int startpos = 0);
+ SubString at(const char* t, int startpos = 0);
+ SubString at(char c, int startpos = 0);
+ SubString at(const Regex& r, int startpos = 0);
+
+ SubString before(int pos);
+ SubString before(const String& x, int startpos = 0);
+ SubString before(const SubString& x, int startpos = 0);
+ SubString before(const char* t, int startpos = 0);
+ SubString before(char c, int startpos = 0);
+ SubString before(const Regex& r, int startpos = 0);
+
+ SubString through(int pos);
+ SubString through(const String& x, int startpos = 0);
+ SubString through(const SubString& x, int startpos = 0);
+ SubString through(const char* t, int startpos = 0);
+ SubString through(char c, int startpos = 0);
+ SubString through(const Regex& r, int startpos = 0);
+
+ SubString from(int pos);
+ SubString from(const String& x, int startpos = 0);
+ SubString from(const SubString& x, int startpos = 0);
+ SubString from(const char* t, int startpos = 0);
+ SubString from(char c, int startpos = 0);
+ SubString from(const Regex& r, int startpos = 0);
+
+ SubString after(int pos);
+ SubString after(const String& x, int startpos = 0);
+ SubString after(const SubString& x, int startpos = 0);
+ SubString after(const char* t, int startpos = 0);
+ SubString after(char c, int startpos = 0);
+ SubString after(const Regex& r, int startpos = 0);
+
+
+// deletion
+
+// delete len chars starting at pos
+ void del(int pos, int len);
+
+// delete the first occurrence of target after startpos
+
+ void del(const String& y, int startpos = 0);
+ void del(const SubString& y, int startpos = 0);
+ void del(const char* t, int startpos = 0);
+ void del(char c, int startpos = 0);
+ void del(const Regex& r, int startpos = 0);
+
+// global substitution: substitute all occurrences of pat with repl
+
+ int gsub(const String& pat, const String& repl);
+ int gsub(const SubString& pat, const String& repl);
+ int gsub(const char* pat, const String& repl);
+ int gsub(const char* pat, const char* repl);
+ int gsub(const Regex& pat, const String& repl);
+
+// friends & utilities
+
+// split string into array res at separators; return number of elements
+
+ friend int split(const String& x, String res[], int maxn,
+ const String& sep);
+ friend int split(const String& x, String res[], int maxn,
+ const Regex& sep);
+
+ friend String common_prefix(const String& x, const String& y,
+ int startpos = 0);
+ friend String common_suffix(const String& x, const String& y,
+ int startpos = -1);
+ friend String replicate(char c, int n);
+ friend String replicate(const String& y, int n);
+ friend String join(String src[], int n, const String& sep);
+
+// simple builtin transformations
+
+ friend String reverse(const String& x);
+ friend String upcase(const String& x);
+ friend String downcase(const String& x);
+ friend String capitalize(const String& x);
+
+// in-place versions of above
+
+ void reverse();
+ void upcase();
+ void downcase();
+ void capitalize();
+
+// element extraction
+
+ char& operator [] (int i);
+ char elem(int i) const;
+ char firstchar() const;
+ char lastchar() const;
+
+// conversion
+
+ operator const char*() const;
+ const char* chars() const;
+
+
+// IO
+
+ friend ostream& operator<<(ostream& s, const String& x);
+ friend ostream& operator<<(ostream& s, const SubString& x);
+ friend istream& operator>>(istream& s, String& x);
+
+ friend int readline(istream& s, String& x,
+ char terminator = '\n',
+ int discard_terminator = 1);
+
+// status
+
+ unsigned int length() const;
+ int empty() const;
+
+// preallocate some space for String
+ void alloc(int newsize);
+
+// report current allocation (not length!)
+
+ int allocation() const;
+
+
+ volatile void error(const char* msg) const;
+
+ int OK() const;
+};
+
+typedef String StrTmp; // for backward compatibility
+
+// other externs
+
+int compare(const String& x, const String& y);
+int compare(const String& x, const SubString& y);
+int compare(const String& x, const char* y);
+int compare(const SubString& x, const String& y);
+int compare(const SubString& x, const SubString& y);
+int compare(const SubString& x, const char* y);
+int fcompare(const String& x, const String& y); // ignore case
+
+extern StrRep _nilStrRep;
+extern String _nilString;
+
+// other inlines
+
+String operator + (const String& x, const String& y);
+String operator + (const String& x, const SubString& y);
+String operator + (const String& x, const char* y);
+String operator + (const String& x, char y);
+String operator + (const SubString& x, const String& y);
+String operator + (const SubString& x, const SubString& y);
+String operator + (const SubString& x, const char* y);
+String operator + (const SubString& x, char y);
+String operator + (const char* x, const String& y);
+String operator + (const char* x, const SubString& y);
+
+int operator==(const String& x, const String& y);
+int operator!=(const String& x, const String& y);
+int operator> (const String& x, const String& y);
+int operator>=(const String& x, const String& y);
+int operator< (const String& x, const String& y);
+int operator<=(const String& x, const String& y);
+int operator==(const String& x, const SubString& y);
+int operator!=(const String& x, const SubString& y);
+int operator> (const String& x, const SubString& y);
+int operator>=(const String& x, const SubString& y);
+int operator< (const String& x, const SubString& y);
+int operator<=(const String& x, const SubString& y);
+int operator==(const String& x, const char* t);
+int operator!=(const String& x, const char* t);
+int operator> (const String& x, const char* t);
+int operator>=(const String& x, const char* t);
+int operator< (const String& x, const char* t);
+int operator<=(const String& x, const char* t);
+int operator==(const SubString& x, const String& y);
+int operator!=(const SubString& x, const String& y);
+int operator> (const SubString& x, const String& y);
+int operator>=(const SubString& x, const String& y);
+int operator< (const SubString& x, const String& y);
+int operator<=(const SubString& x, const String& y);
+int operator==(const SubString& x, const SubString& y);
+int operator!=(const SubString& x, const SubString& y);
+int operator> (const SubString& x, const SubString& y);
+int operator>=(const SubString& x, const SubString& y);
+int operator< (const SubString& x, const SubString& y);
+int operator<=(const SubString& x, const SubString& y);
+int operator==(const SubString& x, const char* t);
+int operator!=(const SubString& x, const char* t);
+int operator> (const SubString& x, const char* t);
+int operator>=(const SubString& x, const char* t);
+int operator< (const SubString& x, const char* t);
+int operator<=(const SubString& x, const char* t);
+
+
+
+
+// status reports, needed before defining other things
+
+inline unsigned int String::length() const { return rep->len; }
+inline int String::empty() const { return rep->len == 0; }
+inline const char* String::chars() const { return &(rep->s[0]); }
+inline int String::allocation() const { return rep->sz; }
+inline void String::alloc(int newsize) { rep = Sresize(rep, newsize); }
+
+inline unsigned int SubString::length() const { return len; }
+inline int SubString::empty() const { return len == 0; }
+inline const char* SubString::chars() const { return &(S.rep->s[pos]); }
+
+
+// constructors
+
+inline String::String()
+ : rep(&_nilStrRep) {}
+inline String::String(const String& x)
+ : rep(Scopy(0, x.rep)) {}
+inline String::String(const char* t)
+ : rep(Salloc(0, t, -1, -1)) {}
+inline String::String(const char* t, int tlen)
+ : rep(Salloc(0, t, tlen, tlen)) {}
+inline String::String(const SubString& y)
+ : rep(Salloc(0, y.chars(), y.length(), y.length())) {}
+inline String::String(char c)
+ : rep(Salloc(0, &c, 1, 1)) {}
+
+inline String::~String() { if (rep != &_nilStrRep) delete rep; }
+
+inline SubString::SubString(const SubString& x)
+ :S(x.S), pos(x.pos), len(x.len) {}
+inline SubString::SubString(String& x, int first, int l)
+ :S(x), pos(first), len(l) {}
+
+inline SubString::~SubString() {}
+
+// assignment
+
+inline void String::operator = (const String& y)
+{
+ rep = Scopy(rep, y.rep);
+}
+
+inline void String::operator=(const char* t)
+{
+ rep = Salloc(rep, t, -1, -1);
+}
+
+inline void String::operator=(const SubString& y)
+{
+ rep = Salloc(rep, y.chars(), y.length(), y.length());
+}
+
+inline void String::operator=(char c)
+{
+ rep = Salloc(rep, &c, 1, 1);
+}
+
+
+inline void SubString::operator = (const char* ys)
+{
+ assign(0, ys);
+}
+
+inline void SubString::operator = (char ch)
+{
+ assign(0, &ch, 1);
+}
+
+inline void SubString::operator = (const String& y)
+{
+ assign(y.rep, y.chars(), y.length());
+}
+
+inline void SubString::operator = (const SubString& y)
+{
+ assign(y.S.rep, y.chars(), y.length());
+}
+
+// Zillions of cats...
+
+inline void cat(const String& x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const String& x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const String& x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, x.chars(), x.length(), y, -1);
+}
+
+inline void cat(const String& x, char y, String& r)
+{
+ r.rep = Scat(r.rep, x.chars(), x.length(), &y, 1);
+}
+
+inline void cat(const SubString& x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const SubString& x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const SubString& x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, x.chars(), x.length(), y, -1);
+}
+
+inline void cat(const SubString& x, char y, String& r)
+{
+ r.rep = Scat(r.rep, x.chars(), x.length(), &y, 1);
+}
+
+inline void cat(const char* x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, x, -1, y.chars(), y.length());
+}
+
+inline void cat(const char* x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, x, -1, y.chars(), y.length());
+}
+
+inline void cat(const char* x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, x, -1, y, -1);
+}
+
+inline void cat(const char* x, char y, String& r)
+{
+ r.rep = Scat(r.rep, x, -1, &y, 1);
+}
+
+inline void cat(const String& a, const String& x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const String& a, const String& x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const String& a, const String& x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y, -1);
+}
+
+inline void cat(const String& a, const String& x, char y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), &y, 1);
+}
+
+inline void cat(const String& a, const SubString& x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const String& a, const SubString& x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const String& a, const SubString& x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y, -1);
+}
+
+inline void cat(const String& a, const SubString& x, char y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), &y, 1);
+}
+
+inline void cat(const String& a, const char* x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y.chars(), y.length());
+}
+
+inline void cat(const String& a, const char* x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y.chars(), y.length());
+}
+
+inline void cat(const String& a, const char* x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y, -1);
+}
+
+inline void cat(const String& a, const char* x, char y, String& r)
+{
+ r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, &y, 1);
+}
+
+
+inline void cat(const char* a, const String& x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const char* a, const String& x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const char* a, const String& x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y, -1);
+}
+
+inline void cat(const char* a, const String& x, char y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), &y, 1);
+}
+
+inline void cat(const char* a, const SubString& x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const char* a, const SubString& x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length());
+}
+
+inline void cat(const char* a, const SubString& x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y, -1);
+}
+
+inline void cat(const char* a, const SubString& x, char y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), &y, 1);
+}
+
+inline void cat(const char* a, const char* x, const String& y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x, -1, y.chars(), y.length());
+}
+
+inline void cat(const char* a, const char* x, const SubString& y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x, -1, y.chars(), y.length());
+}
+
+inline void cat(const char* a, const char* x, const char* y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x, -1, y, -1);
+}
+
+inline void cat(const char* a, const char* x, char y, String& r)
+{
+ r.rep = Scat(r.rep, a, -1, x, -1, &y, 1);
+}
+
+
+// operator versions
+
+inline void String::operator +=(const String& y)
+{
+ cat(*this, y, *this);
+}
+
+inline void String::operator +=(const SubString& y)
+{
+ cat(*this, y, *this);
+}
+
+inline void String::operator += (const char* y)
+{
+ cat(*this, y, *this);
+}
+
+inline void String:: operator +=(char y)
+{
+ cat(*this, y, *this);
+}
+
+// constructive concatenation
+
+
+
+inline String operator + (const String& x, const String& y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const String& x, const SubString& y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const String& x, const char* y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const String& x, char y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const SubString& x, const String& y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const SubString& x, const SubString& y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const SubString& x, const char* y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const SubString& x, char y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const char* x, const String& y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String operator + (const char* x, const SubString& y) return r; // { dg-error "" }
+{
+ cat(x, y, r); // { dg-error "" }
+}
+
+inline String reverse(const String& x) return r; // { dg-error "" }
+{
+ r.rep = Sreverse(x.rep, r.rep); // { dg-error "" }
+}
+
+inline String upcase(const String& x) return r; // { dg-error "" }
+{
+ r.rep = Supcase(x.rep, r.rep); // { dg-error "" }
+}
+
+inline String downcase(const String& x) return r; // { dg-error "" }
+{
+ r.rep = Sdowncase(x.rep, r.rep); // { dg-error "" }
+}
+
+inline String capitalize(const String& x) return r; // { dg-error "" }
+{
+ r.rep = Scapitalize(x.rep, r.rep); // { dg-error "" }
+}
+
+//# 883 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h"
+
+
+// prepend
+
+inline void String::prepend(const String& y)
+{
+ rep = Sprepend(rep, y.chars(), y.length());
+}
+
+inline void String::prepend(const char* y)
+{
+ rep = Sprepend(rep, y, -1);
+}
+
+inline void String::prepend(char y)
+{
+ rep = Sprepend(rep, &y, 1);
+}
+
+inline void String::prepend(const SubString& y)
+{
+ rep = Sprepend(rep, y.chars(), y.length());
+}
+
+// misc transformations
+
+
+inline void String::reverse()
+{
+ rep = Sreverse(rep, rep);
+}
+
+
+inline void String::upcase()
+{
+ rep = Supcase(rep, rep);
+}
+
+
+inline void String::downcase()
+{
+ rep = Sdowncase(rep, rep);
+}
+
+
+inline void String::capitalize()
+{
+ rep = Scapitalize(rep, rep);
+}
+
+// element extraction
+
+inline char& String::operator [] (int i)
+{
+ if (((unsigned)i) >= length()) error("invalid index");
+ return rep->s[i];
+}
+
+inline char String::elem (int i) const
+{
+ if (((unsigned)i) >= length()) error("invalid index");
+ return rep->s[i];
+}
+
+inline char String::firstchar() const
+{
+ return elem(0);
+}
+
+inline char String::lastchar() const
+{
+ return elem(length() - 1);
+}
+
+// searching
+
+inline int String::index(char c, int startpos) const
+{
+ return search(startpos, length(), c);
+}
+
+inline int String::index(const char* t, int startpos) const
+{
+ return search(startpos, length(), t);
+}
+
+inline int String::index(const String& y, int startpos) const
+{
+ return search(startpos, length(), y.chars(), y.length());
+}
+
+inline int String::index(const SubString& y, int startpos) const
+{
+ return search(startpos, length(), y.chars(), y.length());
+}
+
+inline int String::index(const Regex& r, int startpos) const
+{
+ int unused; return r.search(chars(), length(), unused, startpos);
+}
+
+inline int String::contains(char c) const
+{
+ return search(0, length(), c) >= 0;
+}
+
+inline int String::contains(const char* t) const
+{
+ return search(0, length(), t) >= 0;
+}
+
+inline int String::contains(const String& y) const
+{
+ return search(0, length(), y.chars(), y.length()) >= 0;
+}
+
+inline int String::contains(const SubString& y) const
+{
+ return search(0, length(), y.chars(), y.length()) >= 0;
+}
+
+inline int String::contains(char c, int p) const
+{
+ return match(p, length(), 0, &c, 1) >= 0;
+}
+
+inline int String::contains(const char* t, int p) const
+{
+ return match(p, length(), 0, t) >= 0;
+}
+
+inline int String::contains(const String& y, int p) const
+{
+ return match(p, length(), 0, y.chars(), y.length()) >= 0;
+}
+
+inline int String::contains(const SubString& y, int p) const
+{
+ return match(p, length(), 0, y.chars(), y.length()) >= 0;
+}
+
+inline int String::contains(const Regex& r) const
+{
+ int unused; return r.search(chars(), length(), unused, 0) >= 0;
+}
+
+inline int String::contains(const Regex& r, int p) const
+{
+ return r.match(chars(), length(), p) >= 0;
+}
+
+
+inline int String::matches(const SubString& y, int p) const
+{
+ return match(p, length(), 1, y.chars(), y.length()) >= 0;
+}
+
+inline int String::matches(const String& y, int p) const
+{
+ return match(p, length(), 1, y.chars(), y.length()) >= 0;
+}
+
+inline int String::matches(const char* t, int p) const
+{
+ return match(p, length(), 1, t) >= 0;
+}
+
+inline int String::matches(char c, int p) const
+{
+ return match(p, length(), 1, &c, 1) >= 0;
+}
+
+inline int String::matches(const Regex& r, int p) const
+{
+ int l = (p < 0)? -p : length() - p;
+ return r.match(chars(), length(), p) == l;
+}
+
+
+inline int SubString::contains(const char* t) const
+{
+ return S.search(pos, pos+len, t) >= 0;
+}
+
+inline int SubString::contains(const String& y) const
+{
+ return S.search(pos, pos+len, y.chars(), y.length()) >= 0;
+}
+
+inline int SubString::contains(const SubString& y) const
+{
+ return S.search(pos, pos+len, y.chars(), y.length()) >= 0;
+}
+
+inline int SubString::contains(char c) const
+{
+ return S.search(pos, pos+len, 0, c) >= 0;
+}
+
+inline int SubString::contains(const Regex& r) const
+{
+ int unused; return r.search(chars(), len, unused, 0) >= 0;
+}
+
+inline int SubString::matches(const Regex& r) const
+{
+ return r.match(chars(), len, 0) == len;
+}
+
+
+inline int String::gsub(const String& pat, const String& r)
+{
+ return _gsub(pat.chars(), pat.length(), r.chars(), r.length());
+}
+
+inline int String::gsub(const SubString& pat, const String& r)
+{
+ return _gsub(pat.chars(), pat.length(), r.chars(), r.length());
+}
+
+inline int String::gsub(const Regex& pat, const String& r)
+{
+ return _gsub(pat, r.chars(), r.length());
+}
+
+inline int String::gsub(const char* pat, const String& r)
+{
+ return _gsub(pat, -1, r.chars(), r.length());
+}
+
+inline int String::gsub(const char* pat, const char* r)
+{
+ return _gsub(pat, -1, r, -1);
+}
+
+
+
+inline ostream& operator<<(ostream& s, const String& x)
+{
+ s << x.chars(); return s;
+}
+
+// a zillion comparison operators
+
+inline int operator==(const String& x, const String& y)
+{
+ return compare(x, y) == 0;
+}
+
+inline int operator!=(const String& x, const String& y)
+{
+ return compare(x, y) != 0;
+}
+
+inline int operator>(const String& x, const String& y)
+{
+ return compare(x, y) > 0;
+}
+
+inline int operator>=(const String& x, const String& y)
+{
+ return compare(x, y) >= 0;
+}
+
+inline int operator<(const String& x, const String& y)
+{
+ return compare(x, y) < 0;
+}
+
+inline int operator<=(const String& x, const String& y)
+{
+ return compare(x, y) <= 0;
+}
+
+inline int operator==(const String& x, const SubString& y)
+{
+ return compare(x, y) == 0;
+}
+
+inline int operator!=(const String& x, const SubString& y)
+{
+ return compare(x, y) != 0;
+}
+
+inline int operator>(const String& x, const SubString& y)
+{
+ return compare(x, y) > 0;
+}
+
+inline int operator>=(const String& x, const SubString& y)
+{
+ return compare(x, y) >= 0;
+}
+
+inline int operator<(const String& x, const SubString& y)
+{
+ return compare(x, y) < 0;
+}
+
+inline int operator<=(const String& x, const SubString& y)
+{
+ return compare(x, y) <= 0;
+}
+
+inline int operator==(const String& x, const char* t)
+{
+ return compare(x, t) == 0;
+}
+
+inline int operator!=(const String& x, const char* t)
+{
+ return compare(x, t) != 0;
+}
+
+inline int operator>(const String& x, const char* t)
+{
+ return compare(x, t) > 0;
+}
+
+inline int operator>=(const String& x, const char* t)
+{
+ return compare(x, t) >= 0;
+}
+
+inline int operator<(const String& x, const char* t)
+{
+ return compare(x, t) < 0;
+}
+
+inline int operator<=(const String& x, const char* t)
+{
+ return compare(x, t) <= 0;
+}
+
+inline int operator==(const SubString& x, const String& y)
+{
+ return compare(y, x) == 0;
+}
+
+inline int operator!=(const SubString& x, const String& y)
+{
+ return compare(y, x) != 0;
+}
+
+inline int operator>(const SubString& x, const String& y)
+{
+ return compare(y, x) < 0;
+}
+
+inline int operator>=(const SubString& x, const String& y)
+{
+ return compare(y, x) <= 0;
+}
+
+inline int operator<(const SubString& x, const String& y)
+{
+ return compare(y, x) > 0;
+}
+
+inline int operator<=(const SubString& x, const String& y)
+{
+ return compare(y, x) >= 0;
+}
+
+inline int operator==(const SubString& x, const SubString& y)
+{
+ return compare(x, y) == 0;
+}
+
+inline int operator!=(const SubString& x, const SubString& y)
+{
+ return compare(x, y) != 0;
+}
+
+inline int operator>(const SubString& x, const SubString& y)
+{
+ return compare(x, y) > 0;
+}
+
+inline int operator>=(const SubString& x, const SubString& y)
+{
+ return compare(x, y) >= 0;
+}
+
+inline int operator<(const SubString& x, const SubString& y)
+{
+ return compare(x, y) < 0;
+}
+
+inline int operator<=(const SubString& x, const SubString& y)
+{
+ return compare(x, y) <= 0;
+}
+
+inline int operator==(const SubString& x, const char* t)
+{
+ return compare(x, t) == 0;
+}
+
+inline int operator!=(const SubString& x, const char* t)
+{
+ return compare(x, t) != 0;
+}
+
+inline int operator>(const SubString& x, const char* t)
+{
+ return compare(x, t) > 0;
+}
+
+inline int operator>=(const SubString& x, const char* t)
+{
+ return compare(x, t) >= 0;
+}
+
+inline int operator<(const SubString& x, const char* t)
+{
+ return compare(x, t) < 0;
+}
+
+inline int operator<=(const SubString& x, const char* t)
+{
+ return compare(x, t) <= 0;
+}
+
+
+// a helper needed by at, before, etc.
+
+inline SubString String::_substr(int first, int l)
+{
+ if (first >= length() ) // ??? THIS LINE IS QUESTIONABLE
+ return SubString(_nilString, 0, 0) ;
+ else
+ return SubString(*this, first, l);
+}
+
+
+
+
+
+//# 26 "../../GctSymbol.h" 2
+
+
+//# 1 "../../../../../../mips/include/Gct/Object/GctHashObject.h" 1
+// -*- C++ -*-
+
+
+
+//
+// GctHashObject class (is abstract)
+//
+// Expects to be included by Object.h or where needed explicitly.
+//
+// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU)
+//
+
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "../../../../../../mips/include/Gct/Object/GctObject.h" 1
+// -*- C++ -*-
+
+
+
+//
+// GctObject class (is abstract)
+//
+// Expects to be included by Object.h or where needed explicitly.
+//
+// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU)
+//
+
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 1
+// -*- C++ -*-
+
+
+
+//
+// tostrstream class
+//
+// A terminated oststream - an ostsrstream that auto-terminates on str()
+//
+// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU)
+//
+
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/strstream.h" 1
+// This is part of the iostream library, providing input/output for C++.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+
+
+//#pragma interface
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1
+// This is part of the iostream library, providing -*- C++ -*- input/output.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h"
+
+//# 23 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/strstream.h" 2
+
+
+class strstreambuf : public streambuf {
+ size_t *lenp; /* current (logical) length (i.e. valid data bytes) */
+ size_t *sizep; /* allocated (physical) buffer size */
+ char **bufp;
+ size_t _len;
+ size_t _size;
+ char *buf;
+ int _frozen;
+ protected:
+ virtual int overflow(int = (-1) );
+ public:
+ strstreambuf();
+ strstreambuf(int initial);
+ strstreambuf(char *ptr, int size, char *pstart = (__null) );
+ ~strstreambuf();
+ int frozen() { return _frozen; }
+ void freeze(int n=1) { _frozen = n != 0; }
+ size_t pcount();
+ char *str();
+};
+
+class istrstream : public istream {
+ public:
+ istrstream(char*);
+ istrstream(char*, int);
+ strstreambuf* rdbuf() { return (strstreambuf*)_strbuf; }
+};
+
+class ostrstream : public ostream {
+ public:
+ ostrstream();
+ ostrstream(char *cp, int n, int mode=ios::out);
+ size_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
+ char *str() { return ((strstreambuf*)_strbuf)->str(); }
+ void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
+ int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
+ strstreambuf* rdbuf() { return (strstreambuf*)_strbuf; }
+};
+
+
+//# 25 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 2
+
+
+//
+// tostrstream class
+//
+// An isteam class that doesn't have that nasty skipws parameter that
+// you have to remember to set. This class simply provides the istream
+// functionality with a set of constructors which defaults skipws to
+// FALSE (instead of defaulting to TRUE as is the case with plain istream).
+//
+class tostrstream: public ostrstream {
+public:
+ tostrstream(): ostrstream()
+ { }
+ // This constructor defines cp as the buffer to use for the
+ // stream (instead of one of its own devising); it does NOT
+ // initialize the ostrstream to contain cp (of length n).
+ tostrstream(char *cp, int n, int mode=ios::out): ostrtream(cp, n, mode) // { dg-error "" }
+ { }
+ char *str()
+ {
+ char *s = ostrstream::str();
+ s[ostrstream::pcount()] = '\0';
+ return s;
+ }
+};
+
+
+//# 25 "../../../../../../mips/include/Gct/Object/GctObject.h" 2
+
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 1
+// -*- C++ -*-
+
+
+
+//
+// GttObject class (is abstract)
+//
+// Expects to be included where needed explicitly.
+//
+// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU)
+//
+
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 1
+// -*- C++ -*-
+//# 52 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h"
+
+//# 25 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 2
+
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttErrorHandler.h" 1
+// -*- C++ -*-
+
+
+
+//
+// GttErrorHandler class
+//
+// Expects to be included by Gtt.h
+//
+// Wendell Baker, Berkeley CAD Group, 1992 (wbaker@ic.Berkeley.EDU)
+//
+
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/bool.h" 1
+
+
+
+
+
+
+
+//# 25 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttErrorHandler.h" 2
+
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 1
+// -*- C++ -*-
+
+
+
+//
+// Fake up a libstuff++
+//
+// This is done as a complete and utter hack; this library has no function
+// at all being in the boot area; it is here solely in order to provide a
+// libstuff++ against which the Makefiles can resolve link lines.
+//
+// The only reason that this is done is to allow the STANDARD_C++_LIBRARIES
+// as provided by the Makefile templates in the boot area to be the same
+// ones that are used by the tools outside this hierarchy.
+//
+// The tools outside this hierarchy use a different libstuff++; one that is
+// written in C++. This one is not written in C++ in order to be simpler.
+//
+
+
+
+
+
+//#pragma interface
+
+
+
+extern "C" {
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h" 1
+
+
+
+/*
+ * Useful stuff
+ */
+
+/*
+ */
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/ansi.h" 1
+
+
+
+
+/*
+ * ANSI Compiler Support
+ *
+ * David Harrison
+ * University of California, Berkeley
+ * 1988
+ *
+ * ANSI compatible compilers are supposed to define the preprocessor
+ * directive __STDC__. Based on this directive, this file defines
+ * certain ANSI specific macros.
+ *
+ * ARGS:
+ * Used in function prototypes. Example:
+ * extern int foo
+ * ARGS((char *blah, double threshold));
+ */
+
+/*
+ *
+ * Modifications
+ * Wendell C Baker
+ * University of California, Berkeley
+ */
+
+/* Function prototypes */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 15 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h" 2
+
+
+
+/*
+ * If g++, then we stub out part of this thing and let the C++ types take
+ * over and do the same job; some compatibility must be given however
+ */
+
+/*
+ * Use the GNU libg++ definition
+ */
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/bool.h" 1
+
+
+
+
+
+
+
+//# 26 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h" 2
+
+//# 35 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h"
+
+
+/*
+ * Make various pieces of C code that use the old ``Boolean''
+ * be compatible by faking up the definition of Boolean using
+ * the new bool type.
+ */
+
+
+//# 58 "/sandbox/wbaker/wbaker0/source/mips/include/stuff.h"
+
+
+typedef long FitAny; /* can fit any integral type */
+
+/*
+ * typedef char *String; - DO NOT USE THIS - it conflicts with C++
+ * typedef char **Stringv; - just use char* and char** instead.
+ * - void* can be used for arbitrary pointers
+ */
+
+
+
+
+extern int nocase_strcmp (char *, char *) ;
+extern int nocase_strncmp (char *, char *, int) ;
+
+extern bool nocase_strequal (char *, char *) ;
+extern bool nocase_strnequal (char *, char *, int) ;
+
+extern bool lead_strequal (char *, char *) ;
+extern bool nocase_lead_strequal (char *, char *) ;
+
+extern int strhash (char *, int) ;
+extern int nocase_strhash (char *, int) ;
+
+extern int sign (int) ;
+
+/*
+ * Some useful macros.
+ */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 33 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 2
+
+}
+
+//
+// This is here because we wish to provide externs for the two
+// functions btoa(bool, unsigned = 0) and operator<<(ostream&, bool)
+// because they are not provided in bool.h.
+//
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/bool.h" 1
+
+
+
+
+
+
+
+//# 41 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 2
+
+extern const char *stringify(bool b);
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1
+// This is part of the iostream library, providing -*- C++ -*- input/output.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h"
+
+//# 43 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 2
+
+extern ostream& operator<<(ostream&, bool);
+
+// Should this be kept separate? bool isn't, but then is
+// included here only to define ostream& operator<<(ostream&, bool)
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/unit.h" 1
+// -*- C++ -*-
+
+
+
+//
+// unit enum
+//
+// Wendell Baker, Berkeley CAD Group, 1991 (wbaker@ic.Berkeley.EDU)
+//
+
+
+//
+// unit enum
+//
+// This _looks_ silly, but it has an important theoretical basis in category
+// theory. For the pragmatic reason for its existence, see the example below.
+//
+enum unit {
+ UNIT = 1,
+};
+
+extern const char *stringify(unit u);
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1
+// This is part of the iostream library, providing -*- C++ -*- input/output.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h"
+
+//# 28 "/sandbox/wbaker/wbaker0/source/mips/include/unit.h" 2
+
+extern ostream& operator<<(ostream&, unit);
+
+//
+// A unit is used in cases where the type signature of an overloaded
+// function must be differentiated in some stronger way than can be
+// denoted unambiguously in the C++ syntax. This enum is used to give
+// one of the functions a different type signature, thereby allowing
+// the overloading.
+//
+// The use of ``unit'' instead of int or bool is important because a unit
+// has only one possible value; therefore it adds no more information to
+// the code. For example, say a bool was used instead, then in the testing
+// phase, would have to ask: what if TRUE was given, what if FALSE was given.
+// The problem is compounded if char or int is used.
+//
+// Example:
+//
+// class ID {
+// public:
+// ID(); // construct a null ID
+// ID(unit); // alloc a ID with a new id
+// private:
+// static unsigned high_water;
+// unsigned id;
+// };
+//
+// Try working this example save that ID implements all of the generic
+// features of the identifier object, but the high_water is stored
+// in the heir. That is what originally motivated the creation of unit.
+//
+
+
+//# 48 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 2
+
+
+//
+// In the spirit of the standard GNU error handler functions
+// as described in
+// typedef void (*one_arg_error_handler_t)(const char*);
+// a one argument error handler function pointer
+// typedef void (*two_arg_error_handler_t)(const char*, const char*);
+// a two argument error handler function pointer
+//
+// And now the NEW
+//
+// typedef void (*zero_arg_error_handler_t)();
+// a zero argument error handler function pointer
+//
+typedef void (*zero_arg_error_handler_t)();
+
+//
+// In the spirit of the default GNU error handler functions
+// as described in
+// extern void default_one_arg_error_handler(const char *message);
+// print out message on stderr, and do the default thing (abort)
+// extern void default_two_arg_error_handler(const char *kind, const char *message);
+// print out kind and message on stderr, and do the default thing (abort)
+//
+// And now the NEW
+//
+// extern void default_zero_arg_error_handler(const char *message);
+// do the default thing (abort)
+//
+extern void default_zero_arg_error_handler();
+
+// Guaranteed to exit (1)
+extern void exit_zero_arg_error_handler();
+extern void exit_one_arg_error_handler(const char *message);
+extern void exit_two_arg_error_handler(const char *kind, const char *message);
+
+// Guaranteed to abort()
+extern void abort_zero_arg_error_handler();
+extern void abort_one_arg_error_handler(const char *message);
+extern void abort_two_arg_error_handler(const char *kind, const char *message);
+
+//
+// In the spirit of the standard GNU error handlers
+// as described in
+// extern void verbose_File_error_handler(const char*);
+// perror and set errno = 0
+// extern void quiet_File_error_handler(const char*);
+// set errno = 0
+// extern void fatal_File_error_handler(const char*);
+// perror and exit 1
+//
+// And now the NEW
+//
+// extern void preserve_File_error_handler(const char *message);
+// no perror, no assignment to errno.
+//
+extern void preserve_File_error_handler(const char *message);
+
+
+//# 27 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttErrorHandler.h" 2
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 1
+// -*- C++ -*-
+//# 52 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h"
+
+//# 28 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttErrorHandler.h" 2
+
+
+//
+// It is expected that this will be virtually multiply inherited
+// into all of the classes that need error reporting services.
+//
+// The typical way to have that done is by inheriting the GttObject
+// as a virtual base class.
+//
+
+//
+// GttErrorHandler class
+//
+class GttErrorHandler {
+public:
+ GttErrorHandler();
+ GttErrorHandler(const char *program);
+ virtual ~GttErrorHandler();
+
+ //
+ // Error messages
+ // - an unacceptable, but expected and recoverable condition
+ // was detected (but the test fails)
+ // - errors are for ``the expected environment was not found''
+ // rather than for ``file couldn't be opened''
+ // - these messages cannot be shut off
+ // - the error handler determines the recovery action
+ // TODO - one day exceptions will be used here
+ //
+ static void error(const char *message);
+ static void error(tostrstream& message);
+
+ static void error(const char *function, const char *message);
+ static void error(const char *function, tostrstream& message);
+
+ static void error(const char *class_name, const char *method, const char *message);
+ static void error(const char *class_name, const char *method, tostrstream& message);
+
+ //
+ // Fatal messages
+ // - an unacceptable and unexpected error was detected
+ // the data invariants were violated, there is no recovery
+ // - these messages cannot be shut off
+ // - the error handler determines the recovery action
+ // TODO - one day exceptions will be used here
+ //
+ static void fatal(const char *message);
+ static void fatal(tostrstream& message);
+
+ static void fatal(const char *function, const char *message);
+ static void fatal(const char *function, tostrstream& message);
+
+ static void fatal(const char *class_name, const char *method, const char *message);
+ static void fatal(const char *class_name, const char *method, tostrstream& message);
+private:
+ //
+ // Two underscores are used here in order to prevent confusion of these
+ // private variables with any of the heir's private variables. Note that
+ // access control is different than visibility in C++, so all the variable
+ // names in a class hierarchy must be unique.
+ //
+
+ static bool __partial_init;
+ static void __partial_initialize();
+ static bool __full_init;
+ static void __full_initialize(const char *program);
+ static char *__program;
+
+ static void __handle_error();
+ static void __handle_fatal();
+ static void __add_newline(const char *message);
+
+ static bool __output_valid();
+ static ostream *__output;
+};
+
+
+//# 27 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 2
+
+
+//
+// GttObject class (is abstract)
+//
+class GttObject: virtual public GttErrorHandler {
+protected:
+ GttObject();
+ GttObject(const GttObject&);
+ virtual ~GttObject(); // ensure descendants have virtual destructors
+
+public:
+ //
+ // I/O Support
+ //
+ // The value typically persists only long enough for an i/o operation
+ // to be performed (see the defintion of output via operator<<(... ) below)
+ virtual const char *stringify();
+protected:
+ // This is the buffer into which the printed representation of this
+ // object will be put when the time comes. It is associated with the
+ // object so it will never go away (so long as the object exists).
+ // Use a pointer so that you only pay for the space when I/O is used
+ tostrstream *stringbuf;
+ void clear_stringbuf();
+
+public:
+ //
+ // Consistency
+ //
+ // The global data invariant for the whole object (heirs included).
+ // This OK function will call the local invariant function ok() if
+ // necessary and in addition the OK functions of the heirs
+ // This is expected to compute the data invariant of the object.
+ // It will execute GctErrorHandler::fatal if there is wrong.
+ virtual void OK() const;
+
+protected:
+ //
+ // consistency
+ //
+ // This function computes the invariant which is local to this object.
+ // It does not call any of the ancestor's OK() or ok() functions.
+ // It is not a virtual function so that it can be called from within a
+ // constructor with impunity. Thus this function MUST NOT call any
+ // virtual functions either; it should call them by their full name if
+ // that is necessary. The global OK() function will call this function
+ // as necessary.
+ //
+ // This function must NOT NEVER EVER be made virtual.
+ void ok() const;
+
+protected:
+ //
+ // Class Name
+ //
+ // This must return a static (constant) string which is the name
+ // of the class being declared. By convention, not all classes
+ // must have one of these, but the major root abstract class must
+ // have one in order to allow the stringify() to work approximately
+ // correctly.
+ virtual const char *class_name() const = 0;
+};
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1
+// This is part of the iostream library, providing -*- C++ -*- input/output.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h"
+
+//# 91 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 2
+
+extern ostream& operator<<(ostream&, GttObject&);
+
+// There may be other X& operator<<(X&, GttObject&) defined in the
+// packages defining class X. For example see the definition of
+// GttUnitObject& operator<<(GttUnitObject&, GttObject&) in Unit.
+
+
+//# 27 "../../../../../../mips/include/Gct/Object/GctObject.h" 2
+
+
+//# 1 "../../../../../../mips/include/Gct/GctErrorHandler.h" 1
+// -*- C++ -*-
+
+
+
+//
+// GctErrorHandler class
+//
+// Expects to be included by Gct.h
+//
+// Wendell Baker, Berkeley CAD Group, 1991 (wbaker@ic.Berkeley.EDU)
+//
+
+
+
+
+
+//#pragma interface
+
+
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/bool.h" 1
+
+
+
+
+
+
+
+//# 25 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" 1
+// This may look like C code, but it is really -*- C++ -*-
+/*
+Copyright (C) 1988 Free Software Foundation
+ written by Doug Lea (dl@rocky.oswego.edu)
+
+This file is part of the GNU C++ Library. This library is free
+software; you can redistribute it and/or modify it under the terms of
+the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your
+option) any later version. This library is distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU Library General Public License for more details.
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+//# 1321 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h"
+
+//# 26 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1
+// This is part of the iostream library, providing -*- C++ -*- input/output.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h"
+
+//# 27 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2
+
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h" 1
+// -*- C++ -*-
+//# 107 "/sandbox/wbaker/wbaker0/source/mips/include/stuff++.h"
+
+//# 29 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h" 1
+// -*- C++ -*-
+//# 52 "/sandbox/wbaker/wbaker0/source/mips/include/tostrstream.h"
+
+//# 30 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2
+
+
+//# 1 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h" 1
+// -*- C++ -*-
+//# 98 "/sandbox/wbaker/wbaker0/source/mips/include/Gtt/GttObject.h"
+
+//# 32 "../../../../../../mips/include/Gct/GctErrorHandler.h" 2
+
+
+//
+// It is expected that this will be virtually multiply inherited
+// into all of the classes that need error reporting services.
+//
+// The typical way to have that done is by inheriting the GctObject
+// as a virtual base class.
+//
+
+//
+// GctErrorHandler class
+//
+// GPP_1_96_BUG
+// NOTE - virtual public GttObject should be MI into GctObject - but that
+// causes g++ 1.96 to segfault; so we must inherit GttObject here and use SI
+// GPP_1_96_BUG
+class GctErrorHandler: virtual public GttObject {
+public:
+ GctErrorHandler();
+ GctErrorHandler(const String& program);
+ virtual ~GctErrorHandler();
+
+ //
+ // Debugging messages
+ // - these are turned off for production code.
+ // - these messages can be shut off
+ //
+ static void debug(const char *message);
+ static void debug(tostrstream& message);
+
+ static void debug(const char *function, const char *message);
+ static void debug(const char *function, tostrstream& message);
+
+ static void debug(const char *class_name, const char *method, const char *message);
+ static void debug(const char *class_name, const char *method, tostrstream& message);
+
+ static bool debug(); // current debug switch
+ static void debug(bool value); // change the debug switch
+
+ //
+ // Informational messages
+ // - these correspond to a ``verbose'' mode
+ // - these are not errors, just chatty progress reports
+ // - these messages can be shut off
+ //
+ static void note(const char *message);
+ static void note(tostrstream& message);
+
+ static void note(const char *function, const char *message);
+ static void note(const char *function, tostrstream& message);
+
+ static void note(const char *class_name, const char *method, const char *message);
+ static void note(const char *class_name, const char *method, tostrstream& message);
+
+ static bool note(); // current note switch
+ static void note(bool value); // change the note switch
+
+ //
+ // Warning messages
+ // - warnings are system-recoverable errors
+ // - the system has noticed something and taken some
+ // corrective action
+ // - these messages can be shut off
+ //
+ static void warning(const char *message);
+ static void warning(tostrstream& message);
+
+ static void warning(const char *function, const char *message);
+ static void warning(const char *function, tostrstream& message);
+
+ static void warning(const char *class_name, const char *method, const char *message);
+ static void warning(const char *class_name, const char *method, tostrstream& message);
+
+ static bool warning(); // current warning switch
+ static void warning(bool value); // change the warning switch
+
+ //
+ // Error messages
+ // - an unacceptable, but expected and recoverable
+ // condition was detected
+ // - errors are for ``the expected environment was not found''
+ // rather than for ``file couldn't be opened''
+ // - these messages cannot be shut off
+ // - the error handler determines the recovery action
+ // TODO - one day exceptions will be used here
+ //
+ static void error(const char *message);
+ static void error(tostrstream& message);
+
+ static void error(const char *function, const char *message);
+ static void error(const char *function, tostrstream& message);
+
+ static void error(const char *class_name, const char *method, const char *message);
+ static void error(const char *class_name, const char *method, tostrstream& message);
+
+ // can't turn off errors - no ``static void error(bool value);''
+ static zero_arg_error_handler_t error(); // current error handler
+ static void error(zero_arg_error_handler_t handler);// change the error handler
+
+ static void error_is_lib_error_handler(); // change the error handler
+ static void error_is_exit(); // change the error handler
+
+ // Describes the fatal handler - WATCHOUT - implicitly uses AllocRing
+ static const char *error_handler_description();
+
+ //
+ // Fatal messages
+ // - an unacceptable and unexpected error was detected
+ // the data invariants were violated, there is no recovery
+ // - these messages cannot be shut off
+ // - the error handler determines the recovery action
+ // TODO - one day exceptions will be used here
+ //
+ static void fatal(const char *message);
+ static void fatal(tostrstream& message);
+
+ static void fatal(const char *function, const char *message);
+ static void fatal(const char *function, tostrstream& message);
+
+ static void fatal(const char *class_name, const char *method, const char *message);
+ static void fatal(const char *class_name, const char *method, tostrstream& message);
+
+ // can't turn off fatals - no ``static void fatal(bool value);''
+ static zero_arg_error_handler_t fatal(); // return the fatal handler
+ static void fatal(zero_arg_error_handler_t handler); // change the fatal handler
+
+ static void fatal_is_exit(); // change the fatal handler
+ static void fatal_is_abort(); // change the fatal handler
+
+ // Describes the fatal handler - WATCHOUT - implicitly uses AllocRing
+ static const char *fatal_handler_description();
+private:
+ //
+ // Two underscores are used here in order to prevent confusion of these
+ // private variables with any of the heir's private variables. Note that
+ // access control is different than visibility in C++, so all the variable
+ // names in a class hierarchy must be unique.
+ //
+ static bool __debug;
+ static bool __note;
+ static bool __warning;
+ static void (*__error_handler)(); // can't turn off errors
+ static void (*__fatal_handler)(); // can't turn off fatals
+
+ static bool __partial_init;
+ static void __partial_initialize();
+ static bool __full_init;
+ static void __full_initialize(const char *program);
+ static char *__program;
+
+ static void __handle_error();
+ static void __handle_fatal();
+ static void __add_newline(const char *message);
+ static void __message_switch(bool value, bool& flag, const char *description);
+ static void __message_switch(bool value, bool& flag);
+ static const char *__describe_handler(zero_arg_error_handler_t handler);
+
+ static bool __output_valid();
+ static ostream *__output;
+
+ // GPP_1_96_BUG
+ const char *class_name() const;
+ // GPP_1_96_BUG
+};
+
+
+//# 29 "../../../../../../mips/include/Gct/Object/GctObject.h" 2
+
+
+//
+// GctObject class (is abstract)
+//
+class GctObject: virtual public GctErrorHandler /*, virtual public GttObject*/ {
+protected:
+ GctObject();
+ GctObject(const GctObject&);
+ virtual ~GctObject(); // ensure descendants have virtual destructors
+
+public:
+ //
+ // I/O Support
+ //
+ // The value typically persists only long enough for an i/o operation
+ // to be performed (see the defintion of output via operator<<(... ) below)
+ virtual const char *stringify();
+protected:
+ // This is the buffer into which the printed representation of this
+ // object will be put when the time comes. It is associated with the
+ // object so it will never go away (so long as the object exists).
+ // Use a pointer so that you only pay for the space when I/O is used
+ tostrstream *stringbuf;
+ void clear_stringbuf();
+
+public:
+ //
+ // Consistency (global consistency)
+ //
+ // The global data invariant for the whole object (heirs included).
+ // This OK function will call the local invariant function ok() if
+ // necessary and in addition the OK functions of the heirs
+ // This is expected to compute the data invariant of the object.
+ // It will execute GctErrorHandler::fatal if there is wrong.
+ virtual void OK() const;
+
+protected:
+ //
+ // consistency (local consistency)
+ //
+ // This function computes the invariant which is local to this object.
+ // It does not call any of the ancestor's OK() or ok() functions.
+ // It is not a virtual function so that it can be called from within a
+ // constructor with impunity. Thus this function MUST NOT call any
+ // virtual functions either; it should call them by their full name if
+ // that is necessary. The global OK() function will call this function
+ // as necessary.
+ //
+ // This function must NOT NEVER EVER be made virtual.
+ void ok() const;
+protected:
+ //
+ // Class Name
+ //
+ // This must return a static (constant) string which is the name
+ // of the class being declared. By convention, not all classes
+ // must have one of these, but the major root abstract class must
+ // have one in order to allow the stringify() to work approximately
+ // correctly.
+ virtual const char *class_name() const = 0;
+
+public:
+ //
+ // The ``id'' of this object
+ //
+ // NOTE - we explicitly allow the situation where this function
+ // can return the address of the object - the ``this'' pointer
+ // instead of a computed id field (the __object_id field below).
+ //
+ // This function is protected because we don't want too much dependence
+ // on this notion of object identity. I want to be able to rip it
+ // out if it becomes to cumbersome.
+ unsigned objectId() const;
+private:
+ //
+ // Symbolic ID
+ //
+ // NOTE - Normally this would be implemented by the `this' pointer.
+ // TODO - remove this for production code
+ //
+ // However, in order to make the test suites run on all machines, we
+ // make this into a symbolic id that is maintained with each object.
+ // Thus the valid outputs are always consistent across all machines.
+ unsigned __object_id;
+ static unsigned __next_id;
+};
+
+//# 1 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h" 1
+// This is part of the iostream library, providing -*- C++ -*- input/output.
+// Copyright (C) 1991 Per Bothner.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+//# 210 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/iostream.h"
+
+//# 117 "../../../../../../mips/include/Gct/Object/GctObject.h" 2
+
+extern ostream& operator<<(ostream&, GctObject&);
+
+
+//# 25 "../../../../../../mips/include/Gct/Object/GctHashObject.h" 2
+
+
+//
+// GctHashObject class (is abstract)
+//
+class GctHashObject: virtual public GctObject {
+protected:
+ GctHashObject();
+ GctHashObject(const GctHashObject&);
+
+public:
+ //
+ // hash support
+ //
+ virtual unsigned hash() const;
+};
+
+
+//# 28 "../../GctSymbol.h" 2
+
+
+//
+// GctSymbol
+//
+class GctSymbol: virtual public GctHashObject, String {
+public:
+ GctSymbol(); // vacuous symbol required for genclass usage
+ GctSymbol(const char*);
+ GctSymbol(const String&);
+ GctSymbol(const GctSymbol&);
+
+ operator const char *() const;
+
+ bool operator==(const GctSymbol&) const;
+ bool operator!=(const GctSymbol&) const;
+
+ bool operator<=(const GctSymbol&) const;
+ bool operator<(const GctSymbol&) const;
+ bool operator>=(const GctSymbol&) const;
+ bool operator>(const GctSymbol&) const;
+
+ unsigned hash() const;
+
+ // I/O Support
+ const char *stringify();
+
+ // Consistency
+ void OK() const;
+private:
+ const char *class_name() const;
+};
+
+extern unsigned hash(GctSymbol&); // genclass support (no const)
+
+//
+// Inline functions
+//
+// Note - none of the String operators save for operator const char *()
+// are String member functions, instead, they are anonymous functions
+// which work by overloading.
+//
+
+
+
+
+
+GctSymbol::operator const char *() const
+{
+
+
+
+
+
+ return String::operator const char *();
+}
+
+bool
+GctSymbol::operator==(const GctSymbol& other) const
+{
+
+
+
+
+
+ return (bool)::operator==(*this, other);
+}
+
+bool
+GctSymbol::operator!=(const GctSymbol& other) const
+{
+
+
+
+
+
+ return (bool)::operator!=(*this, other);
+}
+
+bool
+GctSymbol::operator<=(const GctSymbol& other) const
+{
+
+
+
+
+
+ return (bool)::operator<=(*this, other);
+}
+
+bool
+GctSymbol::operator<(const GctSymbol& other) const
+{
+
+
+
+
+
+ return (bool)::operator<(*this, other);
+}
+
+bool
+GctSymbol::operator>=(const GctSymbol& other) const
+{
+
+
+
+
+
+ return (bool)::operator>=(*this, other);
+}
+
+bool
+GctSymbol::operator>(const GctSymbol& other) const
+{
+
+
+
+
+
+ return (bool)::operator>(*this, other);
+}
+
+
+//# 25 "GctSymbol.defs.h" 2
+
+
+// equality operator
+
+
+
+
+// less-than-or-equal
+
+
+
+
+// comparison : less-than -> 0
+
+
+
+
+// hash function
+
+extern unsigned int hash(GctSymbol&);
+
+
+
+// initial capacity for structures requiring one
+
+
+
+
+
+
+
+//# 27 "GctSymbol.GctSymbol.Map.h" 2
+
+
+class GctSymbolGctSymbolMap
+{
+protected:
+ int count;
+ GctSymbol def;
+
+public:
+ GctSymbolGctSymbolMap(GctSymbol& dflt);
+ virtual ~GctSymbolGctSymbolMap();
+
+ int length(); // current number of items
+ int empty();
+
+ virtual int contains(GctSymbol& key); // is key mapped?
+
+ virtual void clear(); // delete all items
+
+ virtual GctSymbol& operator [] (GctSymbol& key) = 0; // access contents by key
+
+ virtual void del(GctSymbol& key) = 0; // delete entry
+
+ virtual Pix first() = 0; // Pix of first item or 0
+ virtual void next(Pix& i) = 0; // advance to next or 0
+ virtual GctSymbol& key(Pix i) = 0; // access key at i
+ virtual GctSymbol& contents(Pix i) = 0; // access contents at i
+
+ virtual int owns(Pix i); // is i a valid Pix ?
+ virtual Pix seek(GctSymbol& key); // Pix of key
+
+ GctSymbol& dflt(); // access default val
+
+ void error(const char* msg);
+ virtual int OK() = 0; // rep invariant
+};
+
+
+
+inline GctSymbolGctSymbolMap::~GctSymbolGctSymbolMap() {}
+
+inline int GctSymbolGctSymbolMap::length()
+{
+ return count;
+}
+
+inline int GctSymbolGctSymbolMap::empty()
+{
+ return count == 0;
+}
+
+inline GctSymbol& GctSymbolGctSymbolMap::dflt()
+{
+ return def;
+}
+
+inline GctSymbolGctSymbolMap::GctSymbolGctSymbolMap(GctSymbol& dflt) :def(dflt)
+{
+ count = 0;
+}
+
+
+
+
+//# 26 "GctSymbol.GctSymbol.CHMap.h" 2
+
+
+
+
+
+struct GctSymbolGctSymbolCHNode
+{
+ GctSymbolGctSymbolCHNode* tl;
+ GctSymbol hd;
+ GctSymbol cont;
+ GctSymbolGctSymbolCHNode();
+ GctSymbolGctSymbolCHNode(GctSymbol& h, GctSymbol& c, GctSymbolGctSymbolCHNode* t = 0);
+ ~GctSymbolGctSymbolCHNode();
+};
+
+
+
+inline GctSymbolGctSymbolCHNode::GctSymbolGctSymbolCHNode() {}
+
+inline GctSymbolGctSymbolCHNode::GctSymbolGctSymbolCHNode(GctSymbol& h, GctSymbol& c, GctSymbolGctSymbolCHNode* t)
+ : hd(h), cont(c), tl(t) {}
+
+inline GctSymbolGctSymbolCHNode::~GctSymbolGctSymbolCHNode() {}
+
+
+
+
+typedef GctSymbolGctSymbolCHNode* GctSymbolGctSymbolCHNodePtr;
+
+
+
+
+class GctSymbolGctSymbolCHMap : public GctSymbolGctSymbolMap
+{
+protected:
+ GctSymbolGctSymbolCHNode** tab;
+ unsigned int size;
+
+public:
+ GctSymbolGctSymbolCHMap(GctSymbol& dflt,unsigned int sz=100 );
+ GctSymbolGctSymbolCHMap(GctSymbolGctSymbolCHMap& a);
+ ~GctSymbolGctSymbolCHMap();
+
+ GctSymbol& operator [] (GctSymbol& key);
+
+ void del(GctSymbol& key);
+
+ Pix first();
+ void next(Pix& i);
+ GctSymbol& key(Pix i);
+ GctSymbol& contents(Pix i);
+
+ Pix seek(GctSymbol& key);
+ int contains(GctSymbol& key);
+
+ void clear();
+ int OK();
+};
+
+
+
+inline GctSymbolGctSymbolCHMap::~GctSymbolGctSymbolCHMap()
+{
+ clear();
+ delete tab;
+}
+
+inline int GctSymbolGctSymbolCHMap::contains(GctSymbol& key)
+{
+ return seek(key) != 0;
+}
+
+inline GctSymbol& GctSymbolGctSymbolCHMap::key(Pix p)
+{
+ if (p == 0) error("null Pix");
+ return ((GctSymbolGctSymbolCHNode*)p)->hd;
+}
+
+inline GctSymbol& GctSymbolGctSymbolCHMap::contents(Pix p)
+{
+ if (p == 0) error("null Pix");
+ return ((GctSymbolGctSymbolCHNode*)p)->cont;
+}
+
+
+
+
+//# 22 "GctSymbol.GctSymbol.CHMap.cc" 2
+
+
+// The nodes are linked together serially via a version
+// of a trick used in some vtables: odd pointers are
+// actually links to the next table entry.
+// Not terrible, but not wonderful either
+
+static inline int goodCHptr(GctSymbolGctSymbolCHNode* t)
+{
+ return ((((unsigned)t) & 1) == 0);
+}
+
+static inline GctSymbolGctSymbolCHNode* index_to_CHptr(int i)
+{
+ return (GctSymbolGctSymbolCHNode*)((i << 1) + 1);
+}
+
+static inline int CHptr_to_index(GctSymbolGctSymbolCHNode* t)
+{
+ return ( ((unsigned) t) >> 1);
+}
+
+GctSymbolGctSymbolCHMap::GctSymbolGctSymbolCHMap(GctSymbol& dflt, unsigned int sz)
+ :GctSymbolGctSymbolMap(dflt)
+{
+ tab = (GctSymbolGctSymbolCHNode**)(new GctSymbolGctSymbolCHNodePtr[size = sz]);
+ for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1);
+ count = 0;
+}
+
+GctSymbolGctSymbolCHMap::GctSymbolGctSymbolCHMap(GctSymbolGctSymbolCHMap& a) :GctSymbolGctSymbolMap(a.def)
+{
+ tab = (GctSymbolGctSymbolCHNode**)(new GctSymbolGctSymbolCHNodePtr[size = a.size]);
+ for (unsigned int i = 0; i < size; ++i) tab[i] = index_to_CHptr(i+1);
+ count = 0;
+ for (Pix p = a.first(); p; a.next(p)) (*this)[a.key(p)] = a.contents(p); // { dg-bogus "" } type `GctSymbol' is derived from private `String'
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p786.C b/gcc/testsuite/g++.old-deja/g++.mike/p786.C
new file mode 100644
index 000000000..ebe89c6ab
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p786.C
@@ -0,0 +1,36 @@
+// { dg-do run }
+// prms-id: 786
+
+extern "C" int printf (const char *, ...);
+extern "C" void exit(int);
+class C
+ {
+ int a;
+public:
+ C() {a = 1;}
+ };
+
+void func(const C& a, C& b)
+{
+ printf ("in const func\n");
+ exit(1);
+}
+
+void func(C& a, C& b)
+{
+ printf ("in non-const func\n");
+}
+
+void testit(const C& a, C& b)
+{
+ func(a,b);
+}
+
+int main()
+{
+ C a;
+ C b;
+
+ func(a,b);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7865.C b/gcc/testsuite/g++.old-deja/g++.mike/p7865.C
new file mode 100644
index 000000000..8727e1554
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p7865.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// prms-id: 7865
+
+int count;
+
+struct A {
+ A() { ++count; }
+ ~A() { --count; }
+};
+
+int foo() { return 1; }
+
+int bar()
+{
+ A a;
+ for (;;) {
+ A b;
+ if (foo())
+ return 0;
+ if (foo())
+ return 0;
+ }
+ return 0;
+}
+
+int main() {
+ bar();
+ return count;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7868.C b/gcc/testsuite/g++.old-deja/g++.mike/p7868.C
new file mode 100644
index 000000000..48bdf8b25
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p7868.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// prms-id: 7868
+
+struct DIAGTYP {
+};
+struct DIAGTYP1 {
+ struct DIAGTYP; // { dg-error "" } forward declaration
+ void bar() { new struct DIAGTYP; } // { dg-error "" } undefined
+ void foo() { new struct DIAGTYP1; }
+};
+
+int main () {
+ struct DIAGTYP; // { dg-error "" } forward declaration
+ struct DIAGTYP *lerror_desc;
+ lerror_desc= new struct DIAGTYP; // { dg-error "" } undefined
+}
+
+void foo () {
+ struct DIAGTYP *lerror_desc;
+ lerror_desc= new struct DIAGTYP;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p789.C b/gcc/testsuite/g++.old-deja/g++.mike/p789.C
new file mode 100644
index 000000000..24dbf6e71
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p789.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// prms-id: 789
+
+extern "C" int printf (const char *, ...);
+struct foo
+{
+ static int count;
+ virtual void print (int i, int j) { printf ("foo[%d][%d] = %d\n", i, j, x); }
+ int x;
+ foo () { x = count++; }
+};
+int foo::count;
+struct bar : virtual public foo
+{
+ virtual void print (int i, int j) { printf ("bar[%d][%d] = %d\n", i, j, x); }
+};
+
+// bar array[3][3];
+foo array[3][3];
+
+int main ()
+{
+ for (int i = 0; i < 3; i++)
+ for (int j = 0; j < 3; j++) {
+// printf("&a[%d][%d] = %x\n", i, j, (void *)&array[i][j]);
+ array[i][j].print (i, j);
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p789a.C b/gcc/testsuite/g++.old-deja/g++.mike/p789a.C
new file mode 100644
index 000000000..bee0228bb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p789a.C
@@ -0,0 +1,44 @@
+// { dg-do run }
+// global and local multidimensional array objects are not getting
+// constructors called on any dimension, other than the first. Also,
+// the destructors are not being called. Seems odd, they probably
+// used to work. :-(
+// prms-id: 789
+
+extern "C" int printf (const char *, ...);
+struct foo
+{
+ static int count;
+ void print (int i, int j) { printf ("foo[%d][%d] = %d\n", i, j, x); }
+ int x;
+ foo () {
+ x = count++;
+ printf("this %d = %x\n", x, (void *)this);
+ }
+ virtual ~foo () {
+ printf("this %d = %x\n", x, (void *)this);
+ --count;
+ }
+};
+int foo::count;
+
+
+int main ()
+{
+ {
+ foo array[3][3];
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 3; j++)
+ {
+ printf("&a[%d][%d] = %x\n", i, j, (void *)&array[i][j]);
+ }
+ }
+ // The count should be nine, if not, fail the test.
+ if (foo::count != 9)
+ return 1;
+ }
+ if (foo::count != 0)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7912.C b/gcc/testsuite/g++.old-deja/g++.mike/p7912.C
new file mode 100644
index 000000000..e5584ec4c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p7912.C
@@ -0,0 +1,23 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+// prms-id: 7912
+
+int count = 0;
+
+class Foo {
+public:
+ Foo() { ++count; };
+ Foo(const Foo&) { ++count; };
+ ~Foo() { --count; };
+};
+
+
+main()
+{
+ try {
+ throw Foo();
+ }
+ catch (Foo object) {
+ }
+ return count;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8009.C b/gcc/testsuite/g++.old-deja/g++.mike/p8009.C
new file mode 100644
index 000000000..b082d650d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8009.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// prms-id: 8009
+
+class A {
+public:
+ int i;
+};
+
+class B : public A {
+ B();
+};
+
+B::B() : i (-1) {} // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8018.C b/gcc/testsuite/g++.old-deja/g++.mike/p8018.C
new file mode 100644
index 000000000..f085b6e82
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8018.C
@@ -0,0 +1,86 @@
+// { dg-do run }
+// prms-id: 8018
+
+class RefCount {
+private:
+ int nref;
+
+public:
+ RefCount() : nref(0) {}
+ ~RefCount() {}
+
+ int nrefs() const { return nref; }
+ int reference() {
+ nref++;
+ return nref;
+ }
+ int unreference() {
+ nref--;
+ return nref;
+ }
+};
+
+class A : public RefCount {
+public:
+ A() {}
+ ~A() {}
+};
+
+class RefA {
+private:
+ A *p;
+
+ void clear() {
+ if (p) {
+ p->unreference();
+ if (!p->nrefs())
+ delete p;
+ }
+ }
+
+public:
+ RefA(A* a) : p(a) { if (p) p->reference(); }
+ RefA(const RefA& a) : p(a.p) { if (p) p->reference(); }
+ ~RefA() { clear(); }
+
+ A* operator->() { return p; }
+
+ RefA& operator=(const RefA& a) {
+ clear();
+ p=a.p;
+ if (p)
+ p->reference();
+ return *this;
+ }
+
+ RefA& operator=(A* a) {
+ clear();
+ p=a;
+ if (p)
+ p->reference();
+ return *this;
+ }
+};
+
+class AccRefA {
+private:
+ RefA a;
+
+public:
+ AccRefA(A* ap) : a(ap) {}
+ AccRefA(const RefA& ar) : a(ar) {}
+ ~AccRefA() {}
+
+ operator RefA&() { return a; }
+ RefA& result() { return a; }
+};
+
+int
+main() {
+ RefA a1 = new A;
+ AccRefA aa1(a1);
+ RefA a3 = aa1;
+
+ if (a1->nrefs() != 3)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8039.C b/gcc/testsuite/g++.old-deja/g++.mike/p8039.C
new file mode 100644
index 000000000..4dfb556ea
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8039.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// prms-id: 8039
+
+class C {
+public:
+ int func ();
+};
+
+extern void bar(int*);
+
+int main()
+{
+ int (C::*mfp)() = &C::func;
+ bar((int*)mfp); // { dg-error "" } no clear semantics
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p807.C b/gcc/testsuite/g++.old-deja/g++.mike/p807.C
new file mode 100644
index 000000000..7b343a50f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p807.C
@@ -0,0 +1,35 @@
+// { dg-do assemble }
+// prms-id: 807
+
+extern "C" int printf(const char*, ...);
+
+class B;
+
+class AX
+{
+ protected:
+ int x;
+
+ public:
+ operator B();
+};
+
+
+class B
+{
+ private:
+ int x;
+ public:
+ B(const AX&);
+};
+
+
+int foo(B& b); // { dg-error "" } referenced below
+
+
+int main()
+{
+ AX a;
+ foo(a); // { dg-error "" } Ambiguous B(a) or a.operator B() // See ARM 12.3.2
+
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p807a.C b/gcc/testsuite/g++.old-deja/g++.mike/p807a.C
new file mode 100644
index 000000000..04c9c4867
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p807a.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// prms-id: 807
+
+// See ARM page 275 Section 12.3.2
+
+extern "C" int printf (const char *, ...);
+extern "C" void exit(int);
+
+class B;
+
+class A {
+public:
+ A(B&); // { dg-message "note" } fn ref in err msg
+};
+
+class B {
+public:
+ operator A(); // { dg-message "note" } fn ref in err msg
+};
+
+B b; // { dg-message "candidate" }
+A a = b; // { dg-error "ambiguous" } should fail as it is ambigious.
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p811.C b/gcc/testsuite/g++.old-deja/g++.mike/p811.C
new file mode 100644
index 000000000..260c6459c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p811.C
@@ -0,0 +1,549 @@
+// { dg-do assemble }
+// { dg-options "" }
+// This test case caused the compiler to abort at one point in time.
+// prms-id: 811
+
+class ostream; class streambuf;
+
+typedef long streamoff, streampos;
+
+struct _ios_fields {
+ streambuf *_strbuf;
+ ostream* _tie;
+ int _width;
+ unsigned long _flags;
+ char _fill;
+ unsigned char _state;
+ unsigned short _precision;
+};
+
+
+enum state_value { _good = 0, _eof = 1, _fail = 2, _bad = 4 };
+enum open_mode { input=1, output=2, append=8 };
+
+
+class ios : public _ios_fields {
+ public:
+ enum io_state { goodbit=0, eofbit=1, failbit=2, badbit=4 };
+ enum open_mode {
+ in=1,
+ out=2,
+ ate=4,
+ app=8,
+ trunc=16,
+ nocreate=32,
+ noreplace=64 };
+ enum seek_dir { beg, cur, end};
+ enum { skipws=01, left=02, right=04, internal=010,
+ dec=020, oct=040, hex=0100,
+ showbase=0200, showpoint=0400, uppercase=01000, showpos=02000,
+ scientific=04000, fixed=0100000, unitbuf=020000, stdio=040000,
+ dont_close=0x80000000
+ };
+
+ ostream* tie() const { return _tie; }
+ ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
+
+
+ char fill() const { return _fill; }
+ char fill(char newf) { char oldf = _fill; _fill = newf; return oldf; }
+ unsigned long flags() const { return _flags; }
+ unsigned long flags(unsigned long new_val) {
+ unsigned long old_val = _flags; _flags = new_val; return old_val; }
+ unsigned short precision() const { return _precision; }
+ unsigned short precision(int newp) {
+ unsigned short oldp = _precision; _precision = (unsigned short)newp;
+ return oldp; }
+ unsigned long setf(unsigned long val) {
+ unsigned long oldbits = _flags;
+ _flags |= val; return oldbits; }
+ unsigned long setf(unsigned long val, unsigned long mask) {
+ unsigned long oldbits = _flags;
+ _flags = (_flags & ~mask) | (val & mask); return oldbits; }
+ unsigned long unsetf(unsigned long mask) {
+ unsigned long oldbits = _flags & mask;
+ _flags &= ~mask; return oldbits; }
+ int width() const { return _width; }
+ int width(long val) { long save = _width; _width = val; return save; }
+
+ static const unsigned long basefield;
+ static const unsigned long adjustfield;
+ static const unsigned long floatfield;
+
+ streambuf* rdbuf() const { return _strbuf; }
+ void clear(int state = 0) { _state = state; }
+ int good() const { return _state == 0; }
+ int eof() const { return _state & ios::eofbit; }
+ int fail() const { return _state & (ios::badbit|ios::failbit); }
+ int bad() const { return _state & ios::badbit; }
+ int rdstate() const { return _state; }
+ void set(int flag) { _state |= flag; }
+ operator void*() const { return fail() ? (void*)0 : (void*)this; }
+ int operator!() const { return fail(); }
+
+
+ void unset(state_value flag) { _state &= ~flag; }
+ void close();
+ int is_open();
+ int readable();
+ int writable();
+
+
+ protected:
+ ios(streambuf*sb) { _strbuf=sb; _state=0; _width=0; _fill=' ';
+ _flags=ios::skipws; _precision=6; }
+};
+
+
+
+
+typedef ios::seek_dir _seek_dir;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//# 168 "/usr/latest/lib/g++-include/streambuf.h" 3
+
+
+struct __streambuf {
+
+ int _flags;
+ char* _gptr;
+ char* _egptr;
+ char* _eback;
+ char* _pbase;
+ char* _pptr;
+ char* _epptr;
+ char* _base;
+ char* _ebuf;
+ struct streambuf *_chain;
+
+
+
+
+};
+
+struct streambuf : private __streambuf {
+ friend class ios;
+ friend class istream;
+ friend class ostream;
+ protected:
+ static streambuf* _list_all;
+ streambuf*& xchain() { return _chain; }
+ void _un_link();
+ void _link_in();
+ char* gptr() const { return _gptr; }
+ char* pptr() const { return _pptr; }
+ char* egptr() const { return _egptr; }
+ char* epptr() const { return _epptr; }
+ char* pbase() const { return _pbase; }
+ char* eback() const { return _eback; }
+ char* ebuf() const { return _ebuf; }
+ char* base() const { return _base; }
+ void xput_char(char c) { *_pptr++ = c; }
+ int xflags() { return _flags; }
+ int xflags(int f) { int fl = _flags; _flags = f; return fl; }
+ void xsetflags(int f) { _flags |= f; }
+ void gbump(int n) { _gptr += n; }
+ void pbump(int n) { _pptr += n; }
+ void setb(char* b, char* eb, int a=0);
+ void setp(char* p, char* ep) { _pbase=_pptr=p; _epptr=ep; }
+ void setg(char* eb, char* g, char *eg) { _eback=eb; _gptr=g; _egptr=eg; }
+ public:
+ static int flush_all();
+ static void flush_all_linebuffered();
+ virtual int underflow();
+ virtual int overflow(int c = (-1) );
+ virtual int doallocate();
+ virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
+ virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
+ int sputbackc(char c);
+ int sungetc();
+ streambuf();
+ virtual ~streambuf();
+ int unbuffered() { return _flags & 2 ? 1 : 0; }
+ int linebuffered() { return _flags & 0x4000 ? 1 : 0; }
+ void unbuffered(int i)
+ { if (i) _flags |= 2 ; else _flags &= ~2 ; }
+ void linebuffered(int i)
+ { if (i) _flags |= 0x4000 ; else _flags &= ~0x4000 ; }
+ int allocate() {
+ if (base() || unbuffered()) return 0;
+ else return doallocate(); }
+ virtual int sync();
+ virtual int pbackfail(int c);
+ virtual int ungetfail();
+ virtual streambuf* setbuf(char* p, int len);
+ int in_avail() { return _egptr - _gptr; }
+ int out_waiting() { return _pptr - _pbase; }
+ virtual int sputn(const char* s, int n);
+ virtual int sgetn(char* s, int n);
+ long sgetline(char* buf, int n, char delim, int putback_delim);
+ int sbumpc() {
+ if (_gptr >= _egptr && underflow() == (-1) ) return (-1) ;
+ else return *(unsigned char*)_gptr++; }
+ int sgetc() {
+ if (_gptr >= _egptr && underflow() == (-1) ) return (-1) ;
+ else return *(unsigned char*)_gptr; }
+ int snextc() {
+ if (++_gptr >= _egptr && underflow() == (-1) ) return (-1) ;
+ else return *(unsigned char*)_gptr; }
+ int sputc(int c) {
+ if (_pptr >= _epptr) return overflow(c);
+ return *_pptr++ = c, (unsigned char)c; }
+ int vscan(char const *fmt0, char* ap);
+ int vform(char const *fmt0, char* ap);
+
+
+
+
+
+
+};
+
+struct __file_fields {
+ char _fake;
+ char _shortbuf[1];
+ short _fileno;
+ int _blksize;
+ char* _save_gptr;
+ char* _save_egptr;
+ long _offset;
+};
+
+class filebuf : public streambuf {
+ struct __file_fields _fb;
+ void init();
+ public:
+ filebuf();
+ filebuf(int fd);
+ filebuf(int fd, char* p, int len);
+ ~filebuf();
+ filebuf* attach(int fd);
+ filebuf* open(const char *filename, const char *mode);
+ filebuf* open(const char *filename, int mode, int prot = 0664);
+ virtual int underflow();
+ virtual int overflow(int c = (-1) );
+ int is_open() { return _fb._fileno >= 0; }
+ int fd() { return is_open() ? _fb._fileno : (-1) ; }
+ filebuf* close();
+ virtual int doallocate();
+ virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
+ int sputn(const char* s, int n);
+ int sgetn(char* s, int n);
+ virtual int sync();
+ protected:
+ virtual int pbackfail(int c);
+ int is_reading() { return eback() != egptr(); }
+ char* cur_ptr() { return is_reading() ? gptr() : pptr(); }
+
+ char* file_ptr() { return _fb._save_gptr ? _fb._save_egptr : egptr(); }
+ int do_flush();
+
+ virtual int sys_read(char* buf, int size);
+ virtual long sys_seek(long , _seek_dir);
+ virtual long sys_write(const void*, long);
+ virtual int sys_stat(void*);
+ virtual int sys_close();
+};
+
+
+inline int ios::readable() { return rdbuf()->_flags & 4 ; }
+inline int ios::writable() { return rdbuf()->_flags & 8 ; }
+inline int ios::is_open() {return rdbuf()->_flags & 4 +8 ;}
+
+
+
+
+//# 25 "/usr/latest/lib/g++-include/iostream.h" 2 3
+
+
+class istream; class ostream;
+typedef istream& (*__imanip)(istream&);
+typedef ostream& (*__omanip)(ostream&);
+
+extern istream& ws(istream& ins);
+extern ostream& flush(ostream& outs);
+extern ostream& endl(ostream& outs);
+extern ostream& ends(ostream& outs);
+
+class ostream : public ios
+{
+ void do_osfx();
+ public:
+ ostream();
+ ostream(streambuf* sb, ostream* tied=__null );
+ ~ostream();
+
+ int opfx() { if (!good()) return 0; if (_tie) _tie->flush(); return 1; }
+ void osfx() { if (flags() & (ios::unitbuf|ios::stdio))
+ do_osfx(); }
+ streambuf* ostreambuf() const { return _strbuf; }
+ ostream& flush();
+ ostream& put(char c);
+ ostream& write(const char *s, int n);
+ ostream& write(const unsigned char *s, int n) { return write((char*)s, n);}
+ ostream& write(const void *s, int n) { return write((char*)s, n);}
+ ostream& seekp(streampos);
+ ostream& seekp(streamoff, _seek_dir);
+ streampos tellp();
+ ostream& form(const char *format ...);
+ ostream& vform(const char *format, char* args);
+};
+
+extern ostream& operator<<(ostream&, char c);
+inline ostream& operator<<(ostream& os, unsigned char c)
+{ return os << (char)c; }
+
+extern ostream& operator<<(ostream&, const char *s);
+inline ostream& operator<<(ostream& os, const unsigned char *s)
+{ return os << (const char*)s; }
+
+
+extern ostream& operator<<(ostream&, void *p);
+extern ostream& operator<<(ostream&, int n);
+extern ostream& operator<<(ostream&, long n);
+extern ostream& operator<<(ostream&, unsigned int n);
+extern ostream& operator<<(ostream&, unsigned long n);
+inline ostream& operator<<(ostream& os, short n) {return os << (int)n;}
+inline ostream& operator<<(ostream& os, unsigned short n)
+{return os << (unsigned int)n;}
+extern ostream& operator<<(ostream&, float n);
+extern ostream& operator<<(ostream&, double n);
+inline ostream& operator<<(ostream& os, __omanip func) { return (*func)(os); }
+extern ostream& operator<<(ostream&, streambuf*);
+
+class istream : public ios
+{
+ int _gcount;
+ public:
+ istream();
+ istream(streambuf* sb, ostream*tied=__null );
+ ~istream();
+ streambuf* istreambuf() const { return _strbuf; }
+ istream& get(char& c);
+ istream& get(unsigned char& c);
+ istream& read(char *ptr, int n);
+ istream& read(unsigned char *ptr, int n) { return read((char*)ptr, n); }
+ istream& read(void *ptr, int n) { return read((char*)ptr, n); }
+
+ istream& getline(char* ptr, int len, char delim = '\n');
+ istream& get(char* ptr, int len, char delim = '\n');
+ istream& gets(char **s, char delim = '\n');
+ int ipfx(int need) {
+ if (!good()) { set(ios::failbit); return 0; }
+ if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
+ if (!need && (flags() & ios::skipws) && !ws(*this)) return 0;
+ return 1;
+ }
+ int ipfx0() {
+ if (!good()) { set(ios::failbit); return 0; }
+ if (_tie) _tie->flush();
+ if ((flags() & ios::skipws) && !ws(*this)) return 0;
+ return 1;
+ }
+ int ipfx1() {
+ if (!good()) { set(ios::failbit); return 0; }
+ if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
+ return 1;
+ }
+ int get() { if (!ipfx1()) return (-1) ;
+ int ch = _strbuf->sbumpc();
+ if (ch == (-1) ) set(ios::eofbit);
+ return ch; }
+ int peek() { if (!ipfx1()) return (-1) ;
+ int ch = _strbuf->sgetc();
+ if (ch == (-1) ) set(ios::eofbit);
+ return ch; }
+ int gcount() { return _gcount; }
+ istream& ignore(int n=1, int delim = (-1) );
+ istream& seekg(streampos);
+ istream& seekg(streamoff, _seek_dir);
+ streampos tellg();
+ istream& putback(char ch) {
+ if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit);
+ return *this;}
+ istream& unget() {
+ if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit);
+ return *this;}
+
+ istream& unget(char ch) { return putback(ch); }
+ int skip(int i);
+
+};
+
+extern istream& operator>>(istream&, char*);
+inline istream& operator>>(istream& is, unsigned char* p)
+{ return is >> (char*)p; }
+
+extern istream& operator>>(istream&, char& c);
+extern istream& operator>>(istream&, unsigned char& c);
+
+extern istream& operator>>(istream&, int&);
+extern istream& operator>>(istream&, long&);
+extern istream& operator>>(istream&, short&);
+extern istream& operator>>(istream&, unsigned int&);
+extern istream& operator>>(istream&, unsigned long&);
+extern istream& operator>>(istream&, unsigned short&);
+extern istream& operator>>(istream&, float&);
+extern istream& operator>>(istream&, double&);
+inline istream& operator>>(istream& is, __imanip func) { return (*func)(is); }
+
+inline ostream& ostream::put(char c) { _strbuf->sputc(c); return *this; }
+
+class iostream : public ios {
+ int _gcount;
+ public:
+ iostream();
+ iostream(streambuf* sb, ostream*tied=__null );
+ operator istream&() { return *(istream*)this; }
+ operator ostream&() { return *(ostream*)this; }
+ ~iostream();
+
+ istream& get(char& c) { return ((istream*)this)->get(c); }
+ istream& get(unsigned char& c) { return ((istream*)this)->get(c); }
+ istream& read(char *ptr, int n) { return ((istream*)this)->read(ptr, n); }
+ istream& read(unsigned char *ptr, int n)
+ { return ((istream*)this)->read((char*)ptr, n); }
+ istream& read(void *ptr, int n)
+ { return ((istream*)this)->read((char*)ptr, n); }
+ istream& getline(char* ptr, int len, char delim = '\n')
+ { return ((istream*)this)->getline(ptr, len, delim); }
+ istream& get(char* ptr, int len, char delim = '\n')
+ { return ((istream*)this)->get(ptr, len, delim); }
+ istream& gets(char **s, char delim = '\n')
+ { return ((istream*)this)->gets(s, delim); }
+ istream& ignore(int n=1, int delim = (-1) )
+ { return ((istream*)this)->ignore(n, delim); }
+ int ipfx(int need) { return ((istream*)this)->ipfx(need); }
+ int ipfx0() { return ((istream*)this)->ipfx0(); }
+ int ipfx1() { return ((istream*)this)->ipfx1(); }
+ int get() { return _strbuf->sbumpc(); }
+ int peek() { return ipfx1() ? _strbuf->sgetc() : (-1) ; }
+ int gcount() { return _gcount; }
+ istream& putback(char ch) { return ((istream*)this)->putback(ch); }
+ istream& unget() { return ((istream*)this)->unget(); }
+ istream& seekg(streampos pos) { return ((istream*)this)->seekg(pos); }
+ istream& seekg(streamoff off, _seek_dir dir)
+ { return ((istream*)this)->seekg(off, dir); }
+ streampos tellg() { return ((istream*)this)->tellg(); }
+
+ istream& unget(char ch) { return putback(ch); }
+
+
+
+ int opfx() { return ((ostream*)this)->opfx(); }
+ void osfx() { ((ostream*)this)->osfx(); }
+ ostream& flush() { return ((ostream*)this)->flush(); }
+ ostream& put(char c) { return ((ostream*)this)->put(c); }
+ ostream& write(const char *s, int n)
+ { return ((ostream*)this)->write(s, n); }
+ ostream& write(const unsigned char *s, int n)
+ { return ((ostream*)this)->write((char*)s, n); }
+ ostream& write(const void *s, int n)
+ { return ((ostream*)this)->write((char*)s, n); }
+ ostream& form(const char *format ...);
+ ostream& vform(const char *format, char* args)
+ { return ((ostream*)this)->vform(format, args); }
+ ostream& seekp(streampos pos) { return ((ostream*)this)->seekp(pos); }
+ ostream& seekp(streamoff off, _seek_dir dir)
+ { return ((ostream*)this)->seekp(off, dir); }
+ streampos tellp() { return ((ostream*)this)->tellp(); }
+};
+
+extern istream cin;
+extern ostream cout, cerr, clog;
+
+struct Iostream_init { } ;
+
+inline ios& dec(ios& i)
+{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
+inline ios& hex(ios& i)
+{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
+inline ios& oct(ios& i)
+{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
+
+
+//# 7 "/usr/latest/lib/g++-include/stream.h" 2 3
+
+
+extern char* form(const char*, ...);
+
+extern char* dec(long, int=0);
+extern char* dec(int, int=0);
+extern char* dec(unsigned long, int=0);
+extern char* dec(unsigned int, int=0);
+
+extern char* hex(long, int=0);
+extern char* hex(int, int=0);
+extern char* hex(unsigned long, int=0);
+extern char* hex(unsigned int, int=0);
+
+extern char* oct(long, int=0);
+extern char* oct(int, int=0);
+extern char* oct(unsigned long, int=0);
+extern char* oct(unsigned int, int=0);
+
+inline istream& WS(istream& str) { return ws(str); }
+
+
+//# 9 "test.C" 2
+
+
+class Y {
+public:
+ Y() {}
+ virtual const char *stringify() = 0;
+ virtual char *stringify2() const = 0; // { dg-error "overriding" }
+};
+
+class X: public Y {
+public:
+ X(): Y() {}
+ const char *stringify(); // { dg-error "candidate" }
+ const char *stringify2() const; // { dg-error "candidate|conflicting return type" }
+};
+
+char *
+X::stringify() const // { dg-error "does not match" }
+{
+ return "stringify";
+}
+
+const char *
+X::stringify2() // { dg-error "does not match" }
+{
+ return "stringify2";
+}
+
+main()
+{
+ X x;
+ Y& y = x;
+
+ cout << "x\n";
+ cout << x.stringify() << '\n';
+ cout << x.stringify2() << '\n';
+
+ cout << "y\n";
+ cout << y.stringify() << '\n';
+ cout << y.stringify2() << '\n';
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8154.C b/gcc/testsuite/g++.old-deja/g++.mike/p8154.C
new file mode 100644
index 000000000..126eb25e4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8154.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// { dg-options "-w -fpermissive" }
+// prms-id: 8154
+
+class QvFieldData;
+class QvNode {
+ QvFieldData *fieldData;
+};
+class QvGroup : public QvNode {
+ static QvFieldData *fieldData;
+};
+class QvUnknownNode : public QvGroup
+{
+public:
+ QvUnknownNode :: QvUnknownNode ();
+private:
+ static QvFieldData *fieldData;
+ virtual QvFieldData *getFieldData() { return fieldData; }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8155.C b/gcc/testsuite/g++.old-deja/g++.mike/p8155.C
new file mode 100644
index 000000000..79384717c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8155.C
@@ -0,0 +1,148 @@
+// { dg-do run }
+// prms-id: 8155
+
+int fail = 1;
+
+class CMainWindow;
+class CFrameWnd;
+class CWnd;
+class CCmdTarget;
+
+typedef void (CCmdTarget::*AFX_PMSG)( void);
+typedef void (CWnd::*AFX_PMSGW)( void);
+
+struct AFX_MSGMAP_ENTRY {
+ unsigned int nMessage;
+ AFX_PMSG pfn;
+};
+
+struct AFX_MSGMAP {
+ const AFX_MSGMAP* pBaseMap;
+ const AFX_MSGMAP_ENTRY* lpEntries;
+};
+
+class CCmdTarget {
+public:
+ CCmdTarget();
+private:
+ static AFX_MSGMAP_ENTRY _messageEntries[];
+protected:
+ static const AFX_MSGMAP messageMap;
+ virtual const AFX_MSGMAP* GetMessageMap() const;
+};
+
+const AFX_MSGMAP CCmdTarget::messageMap = {
+ 0, &CCmdTarget::_messageEntries[0]
+};
+
+const AFX_MSGMAP* CCmdTarget::GetMessageMap() const {
+ return &CCmdTarget::messageMap;
+}
+
+AFX_MSGMAP_ENTRY CCmdTarget::_messageEntries[] =
+{
+ { 0, 0 }
+};
+
+CCmdTarget :: CCmdTarget() { }
+
+class CWnd : public CCmdTarget {
+public:
+ CWnd();
+
+protected:
+ void OnPaint();
+private:
+ static AFX_MSGMAP_ENTRY _messageEntries[];
+protected:
+ static const AFX_MSGMAP messageMap;
+ virtual const AFX_MSGMAP* GetMessageMap() const;
+};
+
+CWnd :: CWnd() {
+}
+
+void CWnd :: OnPaint() {
+}
+
+const AFX_MSGMAP* CWnd ::GetMessageMap() const {
+ return & CWnd ::messageMap;
+}
+const AFX_MSGMAP CWnd ::messageMap = {
+ & CCmdTarget ::messageMap, & CWnd ::_messageEntries[0]
+ };
+AFX_MSGMAP_ENTRY CWnd ::_messageEntries[] = {
+ {0, (AFX_PMSG)0 } };
+
+class CFrameWnd : public CWnd {
+public:
+ CFrameWnd();
+protected:
+private:
+ static AFX_MSGMAP_ENTRY _messageEntries[];
+protected:
+ static const AFX_MSGMAP messageMap;
+ virtual const AFX_MSGMAP* GetMessageMap() const;
+};
+
+CFrameWnd :: CFrameWnd() { }
+
+const AFX_MSGMAP* CFrameWnd ::GetMessageMap() const {
+ return & CFrameWnd ::messageMap;
+}
+const AFX_MSGMAP CFrameWnd ::messageMap = {
+ & CWnd ::messageMap, & CFrameWnd ::_messageEntries[0]
+ };
+AFX_MSGMAP_ENTRY CFrameWnd ::_messageEntries[] = {
+ {0, (AFX_PMSG)0 } };
+
+class CMainWindow : public CFrameWnd {
+public:
+ CMainWindow();
+ void OnPaint();
+ void callProc();
+private:
+ static AFX_MSGMAP_ENTRY _messageEntries[];
+protected:
+ static const AFX_MSGMAP messageMap;
+ virtual const AFX_MSGMAP* GetMessageMap() const;
+};
+
+CMainWindow :: CMainWindow()
+{
+}
+void CMainWindow :: OnPaint()
+{
+ fail = 0;
+}
+
+void CMainWindow :: callProc()
+{
+ const AFX_MSGMAP* pMessageMap;
+ const AFX_MSGMAP_ENTRY *lpEntry;
+
+ pMessageMap = GetMessageMap();
+ lpEntry = pMessageMap->lpEntries;
+
+ if( lpEntry->nMessage == 100) {
+ (this->*lpEntry->pfn)();
+ }
+}
+
+const AFX_MSGMAP* CMainWindow ::GetMessageMap() const {
+ return & CMainWindow ::messageMap;
+}
+const AFX_MSGMAP CMainWindow ::messageMap = {
+ & CFrameWnd ::messageMap, & CMainWindow ::_messageEntries[0]
+ };
+AFX_MSGMAP_ENTRY CMainWindow ::_messageEntries[] = {
+ { 100, (AFX_PMSG)(AFX_PMSGW)(void (CWnd::*)(void))&CMainWindow::OnPaint },
+ {0, (AFX_PMSG)0 }
+};
+
+int main( int argc, char **argv) {
+ CMainWindow myWindow;
+
+ myWindow.callProc();
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8175.C b/gcc/testsuite/g++.old-deja/g++.mike/p8175.C
new file mode 100644
index 000000000..23006e72a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8175.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// prms-id: 8175
+
+class AtoBoolC {
+public:
+ AtoBoolC(const AtoBoolC& aBool);
+private:
+ int myValue;
+};
+
+struct TestCase {
+ AtoBoolC is_call_on_unack;
+};
+
+static TestCase the_cases[] = { { 0 } }; // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8269.C b/gcc/testsuite/g++.old-deja/g++.mike/p8269.C
new file mode 100644
index 000000000..3b97d1e8b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8269.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// prms-id: 8269
+
+typedef char* const char_ptr;
+
+class Foo_Bar {
+public:
+ static char* const counter;
+};
+
+char_ptr Foo_Bar::counter = 0;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8460.C b/gcc/testsuite/g++.old-deja/g++.mike/p8460.C
new file mode 100644
index 000000000..4e0f0d22c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8460.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// prms-id: 8460
+
+class A {
+public:
+ A();
+ A(int) { }
+ A(const A&) { }
+private:
+};
+
+int main()
+{
+ A a;
+
+ a.A(1); // { dg-error "" } cannot find name this way
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8483.C b/gcc/testsuite/g++.old-deja/g++.mike/p8483.C
new file mode 100644
index 000000000..08b5161ba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8483.C
@@ -0,0 +1,36 @@
+// { dg-do run }
+// prms-id: 8483
+
+int count;
+
+class A {
+public:
+ A() { ++count; }
+ ~A() { }
+};
+
+class B {
+private:
+ A b[2];
+};
+
+class C {
+public:
+private:
+ A c[2][2];
+};
+
+class D {
+public:
+private:
+ A d[2][2][2];
+};
+
+int main() {
+ { A a; }
+ { B b; }
+ { C c; }
+ { D d; }
+ if (count != 15)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8620.C b/gcc/testsuite/g++.old-deja/g++.mike/p8620.C
new file mode 100644
index 000000000..8064c8299
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8620.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// prms-id: 8620
+
+struct S {
+ long l;
+};
+
+typedef unsigned long l;
+
+void f() {
+ S* p;
+ if (p->l < 0)
+ return;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8786.C b/gcc/testsuite/g++.old-deja/g++.mike/p8786.C
new file mode 100644
index 000000000..577111ec3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8786.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// { dg-options "-O" }
+// prms-id: 8786
+
+class B {
+public:
+ ~B();
+};
+
+class D : public B {
+public:
+ D(int);
+};
+
+int foo() {
+ D t(0);
+
+ bool h = 1;
+ if (h) {
+ D p(0);
+ return 0;
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8804.C b/gcc/testsuite/g++.old-deja/g++.mike/p8804.C
new file mode 100644
index 000000000..d3a2401dd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8804.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+// prms-id: 8804
+
+extern "C" int printf (const char *, ...);
+
+struct Fails {
+ int i;
+ union {
+ union {
+ int c;
+ };
+ };
+};
+
+Fails d;
+
+int main() {
+ return &d.i == &d.c;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8825.C b/gcc/testsuite/g++.old-deja/g++.mike/p8825.C
new file mode 100644
index 000000000..f6748996c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p8825.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// prms-id: 8825
+
+class A {
+ typedef A x;
+};
+
+class B {
+ typedef B x;
+};
+
+class C : public A, public B {
+ typedef C x;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9068.C b/gcc/testsuite/g++.old-deja/g++.mike/p9068.C
new file mode 100644
index 000000000..2c62f5c79
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p9068.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// prms-id: 9068
+
+struct ostream {
+ void operator<< (int); // { dg-message "operator|no known conversion" } fn ref in err msg
+};
+
+class C {
+public:
+ static int& i ();
+ static int& i (int signatureDummy);
+};
+
+void foo (ostream& lhs, const C& rhs)
+{
+ lhs << rhs.i; // { dg-error "match" } no such i for any opr << ()
+ // { dg-message "candidate" "candidate note" { target *-*-* } 16 }
+}
+
+int& C::i () {
+ static int _i = 4711;
+ return _i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9129.C b/gcc/testsuite/g++.old-deja/g++.mike/p9129.C
new file mode 100644
index 000000000..54cf53e89
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p9129.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// { dg-options "-ansi -pedantic-errors" }
+// prms-id: 9129
+
+class Foo {
+public:
+ int DoSomething();
+};
+
+int (Foo::*pA)() = { &Foo::DoSomething };
+int (Foo::*X[1])(int) = { { &Foo::DoSomething } }; // { dg-error "" }
+int (Foo::*Y[])(int) = { { &Foo::DoSomething, &Foo::DoSomething, 0 } }; // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9206.C b/gcc/testsuite/g++.old-deja/g++.mike/p9206.C
new file mode 100644
index 000000000..a5452e133
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p9206.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// prms-id: 9206
+
+class X {
+public:
+ void xtest() { }
+};
+
+class Y { };
+
+typedef void (X::*Xptr)();
+typedef void (Y::*Yptr)();
+
+int main() {
+ X xx;
+
+ Xptr xp = &X::xtest;
+ Yptr yp = reinterpret_cast<Yptr>(xp);
+ xp = reinterpret_cast<Xptr>(yp);
+
+ (xx.*xp)();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9506.C b/gcc/testsuite/g++.old-deja/g++.mike/p9506.C
new file mode 100644
index 000000000..db16e3738
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p9506.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// prms-id: 9506
+
+char * volatile p;
+void foo() {
+ --p = 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9706.C b/gcc/testsuite/g++.old-deja/g++.mike/p9706.C
new file mode 100644
index 000000000..0ed15e4c8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p9706.C
@@ -0,0 +1,37 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+// prms-id: 9706
+
+#include <stdlib.h>
+
+int count, acount;
+
+void *operator new(size_t sz) { ++count; return malloc (sz); }
+void operator delete(void *p) throw() { --count; free (p); }
+
+class A {
+public:
+ A() { ++acount; }
+ A(const A&) { ++acount; }
+ ~A() { --acount; }
+};
+
+int main() {
+ int i;
+
+ // The standard library may have called new and/or delete during
+ // startup, so we have to reset the counter here.
+ count = 0;
+
+ for( i = 0; i < 10; i++ ) {
+ try {
+ throw A();
+ }
+ catch (A& a) {
+ }
+ }
+ if (acount)
+ return 1;
+ if (count)
+ return 2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9732a.C b/gcc/testsuite/g++.old-deja/g++.mike/p9732a.C
new file mode 100644
index 000000000..9af5a9002
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p9732a.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+// prms-id: 9732
+
+class A {
+ int i;
+public:
+ A() { i = 1; }
+ ~A() { }
+};
+
+struct value {
+ A x,y,z;
+};
+
+int crash(const value* capt, value* jet) {
+ return capt == jet;
+}
+
+class euler {
+public:
+ value number() const { return _value; }
+ int distance();
+
+private:
+ value _value;
+};
+
+int euler::distance() {
+ const value& capt = number();
+ value jet;
+ return crash (&capt, &jet);
+}
+
+int main() {
+ euler e;
+ return e.distance();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9732b.C b/gcc/testsuite/g++.old-deja/g++.mike/p9732b.C
new file mode 100644
index 000000000..b10727ef3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p9732b.C
@@ -0,0 +1,47 @@
+// { dg-do run }
+// prms-id: 9732
+
+int count;
+int bail = 0;
+
+extern "C" void abort (void);
+extern "C" void _exit (int);
+
+
+struct base {
+ base () { ++count; }
+ ~base () { --count; }
+ base(const base&o) { ++count; }
+};
+
+class D {
+public:
+ ~D() {
+ if (bail++)
+ {
+ // On some Linux boxes, we run the dtor for d twice,
+ // once before exit, and once after!
+ abort ();
+ }
+ else
+ {
+ if (count != 0)
+ _exit (1);
+ _exit (0);
+ }
+ }
+} d;
+
+base base_object;
+
+base base_returning_function ();
+
+const base& base_ref = base_returning_function ();
+
+int main () {
+}
+
+base base_returning_function () {
+ base local_base_object;
+ return local_base_object;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9732c.C b/gcc/testsuite/g++.old-deja/g++.mike/p9732c.C
new file mode 100644
index 000000000..9239a0978
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p9732c.C
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+// prms-id: 9732
+
+struct foo {};
+foo& x() { return foo(); } // { dg-error "invalid init" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p991.C b/gcc/testsuite/g++.old-deja/g++.mike/p991.C
new file mode 100644
index 000000000..fd71dde68
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p991.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// prms-id: 991
+
+class Complex {
+public:
+ double re;
+ double im;
+ Complex(double r,double i) : re(r), im(i) {}
+};
+
+Complex cos(const Complex&);
+
+extern "C" double cos (double); // not the same as the above
+extern "C" double cosh (double);
+extern "C" double sin (double);
+extern "C" double sinh (double);
+
+Complex cos(const Complex& arg) {
+ double nr = cos(arg.re)*cosh(arg.im);
+ double ni = -sin(arg.re)*sinh(arg.im);
+ return Complex(nr,ni);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/parse1.C b/gcc/testsuite/g++.old-deja/g++.mike/parse1.C
new file mode 100644
index 000000000..621bb0995
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/parse1.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+enum { name1 };
+struct name0 { };
+struct name1 { };
+struct derived1 : public name1 { };
+struct derived2 : public name0, public name1 { };
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmd1.C b/gcc/testsuite/g++.old-deja/g++.mike/pmd1.C
new file mode 100644
index 000000000..8fddb22b5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmd1.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+class A;
+struct XX { int A::*py; };
+
+class A {
+public:
+ int p;
+ void setp(XX *xp);
+};
+
+void A::setp(XX *xp) { xp->py = &A::p; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf1.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf1.C
new file mode 100644
index 000000000..15460ebaa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf1.C
@@ -0,0 +1,91 @@
+// { dg-do run }
+// extern "C" printf(const char *, ...);
+
+class X
+{
+public:
+ int a;
+ int f(int);
+};
+
+class Y
+{
+public:
+ int b;
+ int c;
+ int g(int);
+};
+
+class MD : public X, public Y
+{
+public:
+ int c;
+ int hf(int);
+};
+
+int MD::* pmi0 = &MD::a;
+int MD::* pmi1 = &MD::b;
+int MD::* pmi2 = &MD::c;
+
+int (MD::* pmf0)(int) = &MD::f;
+int (MD::* pmf1)(int) = &MD::g;
+int (MD::* pmf2)(int) = &MD::hf;
+
+int main()
+{
+ MD obj;
+ int fail = 0;
+
+ obj.a = 1;
+ obj.b = 2;
+ obj.c = 3;
+
+ obj.*pmi0 = 7;
+ obj.*pmi1 = 8;
+ obj.*pmi2 = 9;
+
+ fail += (obj.*pmf0)(7);
+ fail += (obj.*pmf1)(8);
+ fail += (obj.*pmf2)(9);
+
+#if 0
+ if (fail != 0)
+ printf ("failed %d tests\n", fail);
+ else
+ printf ("passed\n");
+
+ printf ("sizeof(X) = %d, sizeof(Y) = %d, sizeof(MD) = %d\n",
+ sizeof(X), sizeof(Y), sizeof(MD));
+#endif
+ return fail;
+}
+
+int X::f(int v)
+{
+ if (v != a)
+ {
+// printf ("failed in X::f, a = %d\n", a);
+ return 1;
+ }
+ return 0;
+}
+
+int Y::g(int v)
+{
+ if (v != b)
+ {
+// printf ("failed in Y::g, b = %d\n", b);
+ return 1;
+ }
+ return 0;
+}
+
+int MD::hf(int v)
+{
+ if (v != c)
+ {
+// printf ("failed in MD::hf, c = %d\n", c);
+ return 1;
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C
new file mode 100644
index 000000000..209c5ebea
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf2.C
@@ -0,0 +1,55 @@
+// { dg-do run }
+extern "C" int printf(const char *, ...);
+
+class A_table {
+ int c;
+public:
+ A_table() { c = 3;}
+ virtual void func2(int &item) { printf("func2(%d,) c=%d\n",item,c);}
+};
+
+class B_table : private A_table {
+public:
+ typedef void (B_table::* B_ti_fn) (int &item);
+ B_table() { j = 0x4321;}
+ virtual void call_fn_fn1(int &item, void *pfn1);
+ void func1(int &item) { printf("func1(%d)\n",item);}
+ virtual void func2(int &item) { printf("func2(%d) j=%d\n",item,j);}
+ int j;
+};
+
+class foo : public A_table {
+public:
+ int i;
+ virtual ~foo();
+ virtual void func2(int &item) { printf("func2(%d) i=%d\n",item,i);}
+};
+foo::~foo() { i = 0;}
+
+class bar :public foo,public B_table {
+public:
+ int w;
+ virtual ~bar();
+ virtual void func2(int &item) { printf("func2(%d) w=%d\n",item,w);}
+};
+bar::~bar() { w = 0;}
+
+void B_table::call_fn_fn1(int &item, void *pfn1) {
+ (this->*(*(B_ti_fn*)pfn1))(item);
+}
+
+B_table b;
+bar jar;
+
+int main() {
+ printf("ptr to B_table=%x, ptr to A_table=%x\n",&b,(A_table*)&b);
+ B_table::B_ti_fn z = &B_table::func1;
+ int j = 1;
+ jar.call_fn_fn1(j,(void *)&z);
+ j++;
+ z = &B_table::func2;
+ b.call_fn_fn1(j,(void *)&z);
+ j++;
+ jar.call_fn_fn1(j,(void *)&z);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C
new file mode 100644
index 000000000..8dee9278f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+struct Fooey {
+ void f(char* pX);
+ void f(int in);
+ void f(float fx);
+ void h(double dx);
+};
+
+void Fooey::f(char*) { } // { dg-error "" } candidate
+void Fooey::f(int) { } // { dg-error "" } candidate
+void Fooey::f(float) { } // { dg-error "" } candidate
+void Fooey::h(double zahl) { }
+
+int main() {
+ Fooey Blah;
+ void (Fooey::*pointer)(double);
+ pointer = &Fooey::f; // { dg-error "" } don't call Fooey::h
+ (Blah.*pointer)(42.5);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf4.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf4.C
new file mode 100644
index 000000000..944993a98
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf4.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+class NF { };
+
+struct QF {
+ NF nf;
+
+ typedef float(NF::* const NPF)() const;
+
+ void p (NPF npf) const {
+ float q = (nf.*npf)();
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf6.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf6.C
new file mode 100644
index 000000000..7ff34d049
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf6.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+class S {
+public:
+ void (S::*pmf)();
+ void foo() {
+ pmf(); // { dg-error "pointer-to-member" }
+ }
+ static void foo1(S* sp) {
+ (sp->pmf)(); // { dg-error "pointer-to-member" }
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf7.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf7.C
new file mode 100644
index 000000000..ab9ead011
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf7.C
@@ -0,0 +1,30 @@
+// { dg-do run }
+class A;
+typedef int (A::*f_ptr) (void);
+
+class B {
+public:
+ B() {} ~B() {}
+ B& dummy(f_ptr cb) { return *this; }
+};
+
+template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) {
+ sp->dummy(cb);
+ return *sp;
+}
+
+class A {
+public:
+ A() {} ~A() {}
+ int ok() { return 0; }
+ A& call_it(B* s) {
+ call_dummy(s, &A::ok);
+ return *this;
+ }
+};
+
+int main() {
+ A a; B b;
+ a.call_it(&b);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf8.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf8.C
new file mode 100644
index 000000000..10f67c6f0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf8.C
@@ -0,0 +1,32 @@
+// { dg-do run }
+int fail;
+
+class A *ptr_a;
+
+class A {
+public:
+ char space1[24];
+ virtual void foo() {
+ if (this != ptr_a)
+ fail = 1;
+ }
+};
+
+class Space {
+ char space2[36];
+};
+
+class B : public Space, public A {
+} b;
+
+void (B::*pmf1)() = &A::foo;
+void (A::*pmf2)() = &A::foo;
+
+int main() {
+ ptr_a = &b;
+ (b .* (void (B::*) ()) &A::foo) ();
+ (b .* pmf1) ();
+ (b .* pmf2) ();
+ (b .* &A::foo) ();
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf9.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf9.C
new file mode 100644
index 000000000..17e58b4d7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf9.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+class K {
+public:
+ int f(int i) { return i; }
+};
+
+class Q {
+public:
+ Q() { kp = new K; }
+ int g();
+private:
+ K * kp;
+};
+
+int Q::g() {
+ return (kp->f)(42);
+}
+
+
+int main () {
+ Q q;
+ if (q.g() != 42)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pt1.C b/gcc/testsuite/g++.old-deja/g++.mike/pt1.C
new file mode 100644
index 000000000..5ab78e71e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pt1.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+template <class T, class V>
+class A {
+public:
+ A (T at, V av);
+ void print () { }
+protected:
+ T t;
+ V v;
+};
+
+template <class T, class V>
+A<T, V>::A (T at, V av) {
+ t = at;
+ v = av;
+}
+
+
+template <class T, class V>
+class B: public virtual A<T, V> {
+public:
+ B (T at, V av);
+ void print () { }
+};
+
+template <class T, class V>
+B<T, V>::B (T at, V av) : A<T, V> (at, av) { } // { dg-bogus "" }
+
+int main () {
+ int i = 2;
+ double x = 2;
+
+ B<int, double> ab(i, x);
+ ab.print();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pt2.C b/gcc/testsuite/g++.old-deja/g++.mike/pt2.C
new file mode 100644
index 000000000..e2f77ecf0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pt2.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+class A {
+public:
+};
+
+template <class T>
+class B: public virtual A {
+public:
+ B ();
+ ~B ();
+};
+
+template <class T>
+B<T>::B () { }
+
+template <class T>
+B<T>::~B () { }
+
+int main () {
+ B<int> ab;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pt3.C b/gcc/testsuite/g++.old-deja/g++.mike/pt3.C
new file mode 100644
index 000000000..201b1085c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pt3.C
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+
+template<class Repr>
+class syHandle
+{
+protected:
+ syHandle();
+ ~syHandle();
+ Repr *_repr;
+};
+
+template<class Repr>
+syHandle<Repr>::~syHandle()
+{
+}
+
+typedef char * char_ptr_t;
+
+template <>
+syHandle<char_ptr_t>::syHandle()
+{
+ _repr = 0;
+}
+
+template <>
+syHandle<char_ptr_t>::~syHandle()
+{
+ _repr = 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pt4.C b/gcc/testsuite/g++.old-deja/g++.mike/pt4.C
new file mode 100644
index 000000000..4068cece4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pt4.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+
+template <char* c> struct B { B() { } };
+B<0> bnull; // { dg-error "" } could not convert template argument
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ref1.C b/gcc/testsuite/g++.old-deja/g++.mike/ref1.C
new file mode 100644
index 000000000..802ede359
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ref1.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+int count;
+
+struct base {
+ base () { ++count; }
+ ~base () { --count; }
+ base(const base&o) { ++count; }
+};
+
+base base_returning_function ();
+
+const base& base_ref = base_returning_function ();
+
+int main () {
+ if (count != 1)
+ return 1;
+}
+
+base base_returning_function () {
+ base local_base_object;
+ return local_base_object;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C b/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C
new file mode 100644
index 000000000..19aa3894e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+
+#include <typeinfo>
+#include <iostream>
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/rtti2.C b/gcc/testsuite/g++.old-deja/g++.mike/rtti2.C
new file mode 100644
index 000000000..1f5944a1c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/rtti2.C
@@ -0,0 +1,6 @@
+// { dg-do run }
+#include <typeinfo>
+
+int main() {
+ typeid(bool);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/rtti3.C b/gcc/testsuite/g++.old-deja/g++.mike/rtti3.C
new file mode 100644
index 000000000..d2d48d1c7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/rtti3.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+class base {
+public:
+ virtual ~base() {}
+ virtual void m1() = 0;
+ virtual void m2() = 0;
+};
+
+class intermediate : public virtual base {
+public:
+ virtual ~intermediate() {}
+ virtual void m1() {}
+ virtual void m2() {}
+};
+
+class derived : public intermediate {
+public:
+ virtual int IwantedThisMethod() { return 0; }
+ virtual int ButIgotThisOne() { return 1; }
+};
+
+int main() {
+ return derived().IwantedThisMethod();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/s24939.C b/gcc/testsuite/g++.old-deja/g++.mike/s24939.C
new file mode 100644
index 000000000..915cfe224
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/s24939.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+class A;
+
+class B {
+public:
+ B();
+private:
+ A a; // { dg-error "" }
+};
+
+class A { };
+B::B() { }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/s35520.C b/gcc/testsuite/g++.old-deja/g++.mike/s35520.C
new file mode 100644
index 000000000..cb73482bd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/s35520.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+
+static void kbdNormal() { }
+void (*keyHandler)() = kbdNormal;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/s9959.C b/gcc/testsuite/g++.old-deja/g++.mike/s9959.C
new file mode 100644
index 000000000..896620bc4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/s9959.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+class A {
+protected:
+ int aData;
+};
+
+class B : public A {
+public:
+ virtual void func1() {
+ A::aData = 1;
+ }
+};
+
+class C : virtual public B {
+public:
+ virtual void func1(void) {
+ A::aData = 2;
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/scast1.C b/gcc/testsuite/g++.old-deja/g++.mike/scast1.C
new file mode 100644
index 000000000..9a905d028
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/scast1.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+class A {};
+class C {};
+
+int main() {
+ A* a = 0;
+ C* c = static_cast<C*>(a); // { dg-error "" } bad static cast
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/sizeof.C b/gcc/testsuite/g++.old-deja/g++.mike/sizeof.C
new file mode 100644
index 000000000..c336a7a46
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/sizeof.C
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+class Foo {
+ int children[4];
+public:
+ unsigned function(void) {
+ return sizeof (((Foo*)0)->children);
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/temp.C b/gcc/testsuite/g++.old-deja/g++.mike/temp.C
new file mode 100644
index 000000000..0a5ce5812
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/temp.C
@@ -0,0 +1,32 @@
+// { dg-do run }
+extern "C" int printf(const char *, ...);
+extern "C" const char *getenv(const char *);
+
+class T {
+ int i;
+public:
+ T() {
+ i = 1;
+ printf("T() at %x\n", this);
+ }
+ T(const T& o) {
+ i = o.i;
+ printf("T(const T&) at %x <-- %x\n", this, &o);
+ }
+ T operator +(const T& o) {
+ T r;
+ r.i = this->i + o.i;
+ return r;
+ }
+ operator int () {
+ return i;
+ }
+ ~T() { printf("~T() at %x\n", this); }
+} s, b;
+
+int foo() { return getenv("TEST") == 0; }
+
+int main() {
+ int i = foo() ? s+b : s;
+ return i != 2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C
new file mode 100644
index 000000000..8a7be6234
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+struct C1
+{
+ virtual ~C1();
+};
+
+struct C2 : public virtual C1
+{
+ virtual ~C2();
+};
+
+struct C3 : public virtual C2
+{
+ virtual ~C3();
+};
+
+C3::~C3() {}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C
new file mode 100644
index 000000000..fa864b4aa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+#include <typeinfo>
+
+int state;
+int fail;
+
+class A {
+public:
+ A() {
+ if (++state != 1)
+ fail = 1;
+ }
+ virtual int foo() {
+ if (++state != 2)
+ fail = 1;
+ return 0;
+ }
+ virtual ~A() {
+ if (++state != 3)
+ fail = 1;
+ }
+};
+
+A* bar() {
+ return new A;
+}
+
+int main() {
+ A *aptr = bar();
+ aptr->foo();
+ if (dynamic_cast <void*> (aptr) != aptr)
+ fail = 1;
+ if (typeid (*aptr) != typeid (A))
+ fail = 1;
+ delete aptr;
+ if (++state != 4)
+ fail = 1;
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C
new file mode 100644
index 000000000..053e035bb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C
@@ -0,0 +1,35 @@
+// { dg-do run }
+int state;
+int fail;
+
+class A {
+public:
+ A() {
+ if (++state != 1)
+ fail = 1;
+ }
+ virtual int foo() {
+ if (++state != 2)
+ fail = 1;
+ return 0;
+ }
+ virtual ~A() {
+ if (++state != 3)
+ fail = 1;
+ }
+};
+
+A* bar() {
+ return new A;
+}
+
+int main() {
+ A *aptr = bar();
+ aptr->foo();
+ if (dynamic_cast <void*> (aptr) != aptr)
+ fail = 1;
+ delete aptr;
+ if (++state != 4)
+ fail = 1;
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/unroll1.C b/gcc/testsuite/g++.old-deja/g++.mike/unroll1.C
new file mode 100644
index 000000000..e3e7cd50e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/unroll1.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// { dg-options "-g -O -funroll-loops" }
+
+struct A {
+ inline ~A() { }
+};
+
+void foo (A) {
+ while (1)
+ A bar;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/unused.C b/gcc/testsuite/g++.old-deja/g++.mike/unused.C
new file mode 100644
index 000000000..b441a77f5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/unused.C
@@ -0,0 +1,7 @@
+// { dg-do compile { target *-*-darwin* } }
+// { dg-options { -Wunused-parameter } }
+// Radar 4125055
+
+void foo(int x) {
+#pragma unused ( x )
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt1.C b/gcc/testsuite/g++.old-deja/g++.mike/virt1.C
new file mode 100644
index 000000000..f8ee4edb0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/virt1.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+struct S0 { virtual void f1 () { } };
+
+struct S1 : virtual public S0 { virtual void f1 () { } };
+
+struct S2 : public S1 { virtual void f1 () { } };
+
+struct S3 : virtual public S0 { virtual void f1 () { } };
+
+struct S4 : public S3 { };
+
+void creator () { new S4; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt2.C b/gcc/testsuite/g++.old-deja/g++.mike/virt2.C
new file mode 100644
index 000000000..8cbe4d194
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/virt2.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+struct S0 {
+ virtual int is_kind_of_S1 () const { return 0; }
+ virtual void dummy () { }
+};
+
+struct S1 : virtual public S0 {
+ virtual int is_kind_of_S1 () const { return 1; }
+ virtual void dummy () { }
+};
+
+struct S2 : virtual public S0 {
+ virtual void dummy () { }
+};
+
+struct S3 : public S2, public S1 {
+ virtual void dummy () { }
+};
+
+static struct S0 *var = new S3 ();
+
+int main () {
+ if (var->is_kind_of_S1() != 1)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt3.C b/gcc/testsuite/g++.old-deja/g++.mike/virt3.C
new file mode 100644
index 000000000..e030fee9d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/virt3.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+class B {
+public:
+ int Bi;
+ virtual int g() { return 0; }
+};
+
+class D : private B {
+ int Di;
+};
+
+class E : public virtual D, public B { // { dg-warning "" } direct base inaccessible due to ambiguity
+ int Ei;
+};
+
+E e;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt4.C b/gcc/testsuite/g++.old-deja/g++.mike/virt4.C
new file mode 100644
index 000000000..2d8b04263
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/virt4.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// { dg-options "" }
+
+void Foo () {}
+
+class B {
+public:
+ virtual void foo() = 0;
+};
+
+class D: virtual public B {
+public:
+ void foo() { Foo(); }
+};
+
+class D1: public D {};
+
+class D2: public D {};
+
+class D1_2: public D1, public D2 {
+public:
+ void foo() { D1::foo(); D2::foo(); }
+};
+
+main() {
+ D1_2 h;
+ h.foo();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt5.C b/gcc/testsuite/g++.old-deja/g++.mike/virt5.C
new file mode 100644
index 000000000..cee8b3cb1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/virt5.C
@@ -0,0 +1,54 @@
+// { dg-do run }
+// Ensure that virtual base upcast and downcasting works on this
+// conversions during virtual function dispatch at ctor/dtor time
+// when dynamic vtable fixups for deltas are needed.
+
+int fail = 0;
+
+struct BASE1 {
+ virtual ~BASE1 () { }
+};
+
+class MID;
+
+class BASE2 {
+public:
+ virtual MID *VFN (){ return 0; }
+};
+
+class MIBASE : public BASE1, public BASE2 { };
+
+class VBB : public MIBASE {
+public:
+ virtual long get_STATE () const = 0;
+ void print_STATE() { if (get_STATE () != 87654321) fail = 1; }
+};
+
+class VBD : public virtual VBB {
+ long STATE;
+public:
+ long get_STATE() const { return STATE; }
+ VBD() { STATE = 87654321; }
+ ~VBD() { STATE = 87654321; }
+};
+
+class MID : public virtual VBD {
+public:
+ MID () { print_STATE(); }
+ ~MID () { print_STATE(); }
+ virtual MID *VFN() { return this; }
+};
+
+class LAST : public MID {
+public:
+ LAST () { print_STATE(); }
+ ~LAST () { print_STATE(); }
+};
+
+int main() {
+ MIBASE *o = new LAST;
+ MID *p = o->VFN();
+ p->print_STATE();
+ delete o;
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt6.C b/gcc/testsuite/g++.old-deja/g++.mike/virt6.C
new file mode 100644
index 000000000..db13bb2be
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/virt6.C
@@ -0,0 +1,40 @@
+// { dg-do run }
+// This testcase ensures that we can build vtable names for complex MI
+// classes.
+
+class C_A {
+public:
+ virtual int foo(void *) { return 0; }
+} a;
+
+class C_B : public C_A {
+} b;
+
+class C_C : public C_A {
+} c;
+
+class C_D : public C_A {
+} d;
+
+class C_E : public C_C, public C_B {
+public:
+ virtual int foo(void *) { return 0; }
+} e;
+
+class C_F : public C_D, public C_B {
+public:
+ virtual int foo(void *) { return 0; }
+} f;
+
+class C_G : public C_A {
+public:
+ virtual int foo(void *) { return 0; }
+} g;
+
+class C_H : public C_G, public C_E, public C_F {
+public:
+ virtual int foo(void *) { return 0; }
+} h;
+
+int main() {
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/visibility-1.C b/gcc/testsuite/g++.old-deja/g++.mike/visibility-1.C
new file mode 100644
index 000000000..40e742708
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/visibility-1.C
@@ -0,0 +1,22 @@
+/* Test visibility attribute on template member function
+ instantiations. */
+
+/* { dg-do compile } */
+/* { dg-options "-fvisibility=hidden" } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-not-hidden "_ZN7myClassIiE3maxEii" } } */
+
+#define EXPORT __attribute__((visibility("default")))
+
+template <class T>
+class EXPORT myClass {
+public:
+ T max (T t1, T t2);
+};
+
+template <class T>
+T myClass<T>::max (T t1, T t2) {
+ return (t1 > t2 ? t1 : t2);
+}
+
+template class myClass<int>;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C b/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C
new file mode 100644
index 000000000..fc07a9ea5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C
@@ -0,0 +1,12 @@
+// { dg-do link }
+// { dg-options "-fno-implement-inlines " }
+struct type {
+ virtual void m1();
+ virtual void m2() { }
+};
+
+void type::m1() { }
+
+int main() {
+ type t;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn1.C b/gcc/testsuite/g++.old-deja/g++.mike/warn1.C
new file mode 100644
index 000000000..5d6fdec52
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn1.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-Wall -Wno-int-to-pointer-cast" }
+
+typedef char * charptr;
+typedef __SIZE_TYPE__ size_t;
+char c[]={'A','B','C','D'};
+int i=size_t(&c);
+int *pp=&i;
+void foo() { }
+int main()
+{
+ charptr(*pp)++; // { dg-error "lvalue" }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn2.C b/gcc/testsuite/g++.old-deja/g++.mike/warn2.C
new file mode 100644
index 000000000..d505b29ae
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn2.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// { dg-options "-Wall" }
+
+enum Boolean {
+ Ok = 0,
+ NotOk = 1,
+};
+
+enum OpResult {
+ Succeeded = 0,
+ TempFail = 1,
+ PermFail = 2,
+};
+
+OpResult fn1() {
+ return TempFail;
+}
+
+extern void foo();
+
+int
+main () {
+ if (fn1() == Ok) { // { dg-warning "" }
+ foo();
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn3.C b/gcc/testsuite/g++.old-deja/g++.mike/warn3.C
new file mode 100644
index 000000000..74fe17045
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn3.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// { dg-options "-Wall" }
+
+class B {
+public:
+ B(int) { }
+};
+
+class D : public B {
+ int member; // { dg-warning "" } reordered
+ D() : member(0), B(member) { } // { dg-warning "" } reordered
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn4.C b/gcc/testsuite/g++.old-deja/g++.mike/warn4.C
new file mode 100644
index 000000000..d94de4506
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn4.C
@@ -0,0 +1,2 @@
+// { dg-do assemble }
+void foo (int a, int a) { } // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn5.C b/gcc/testsuite/g++.old-deja/g++.mike/warn5.C
new file mode 100644
index 000000000..af94d53b3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn5.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// { dg-options "-Wpointer-arith" }
+
+double X(const double x) { return x; }
+double Y() { return 1.0; }
+double Z() { return 2.0; }
+
+struct A {
+ void bar() { }
+ void foo() { }
+};
+
+typedef void (A::*pmf)();
+
+static int mememe = &A::foo - &A::bar; // { dg-error "invalid operands" }
+pmf b = &A::foo-1; // { dg-error "invalid operands" }
+
+int main() {
+ double y;
+ y=X(Y-Z); // { dg-error "pointer to a function" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn6.C b/gcc/testsuite/g++.old-deja/g++.mike/warn6.C
new file mode 100644
index 000000000..9c694d625
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn6.C
@@ -0,0 +1,42 @@
+// { dg-do assemble }
+// { dg-options "-Woverloaded-virtual" }
+
+struct B4 {
+ virtual void bothfardiff(float); // { dg-warning "" } was hidden
+};
+
+struct B3 : public B4 {
+};
+
+struct B2 {
+};
+
+struct B {
+ virtual void baseonly(int);
+
+ virtual void bothsame(int);
+
+ virtual void bothdiff(float); // { dg-warning "" } was hidden
+
+ virtual void both2same(int);
+ virtual void both2same(float);
+
+ virtual void both12diff(int);
+ virtual void both12diff(float); // { dg-warning "" } was hidden
+};
+
+struct D : public B, public B2, public B3 {
+ virtual void derivedonly(int);
+
+ virtual void bothsame(int);
+
+ virtual void bothdiff(int); // { dg-warning "" }
+
+ virtual void both2same(int);
+ virtual void both2same(float);
+
+ virtual void both12diff(int); // { dg-warning "" }
+
+ virtual void bothfardiff(int); // { dg-warning "" }
+};
+
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn7.C b/gcc/testsuite/g++.old-deja/g++.mike/warn7.C
new file mode 100644
index 000000000..3fb78895a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn7.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-Wall" }
+
+const int& foo() {
+ extern int bar;
+
+ return bar;
+}
+
+const int* baz() {
+ extern int bar;
+
+ return &bar;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/warn8.C b/gcc/testsuite/g++.old-deja/g++.mike/warn8.C
new file mode 100644
index 000000000..ea9dfb868
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/warn8.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-Waddress" }
+
+struct foo {
+ bool test();
+};
+bool func();
+
+void test() {
+ foo A;
+ bool (foo::* pmf)() = &foo::test;
+ bool (*pf)() = func;
+
+ if (A.test) ; // { dg-error "" }
+ if (func) ; // { dg-warning "" }
+ if (bool(A.test)) ; // { dg-error "" }
+ if (bool(func)) ; // { dg-warning "" }
+ if (pmf) ;
+ if (pf) ;
+}