summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.old-deja/g++.other
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/900403_04.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/900519_12.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access1.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access10.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access11.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access2.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access3.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access4.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access5.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access6.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access7.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access8.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access9.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/addrof1.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/align.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ambig1.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ambig2.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ambig3.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon2.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon3.C86
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon4.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon5.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon6.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon7.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon8.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon9.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array1.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array2.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array3.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array4.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array5.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array6.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array9.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/asm1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/asm2.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/asm3.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/badarrow.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/badopt1.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/base1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/bitfld1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/bitfld2.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/bitfld3.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/bitfld4.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/bitfld5.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins10.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins2.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins3.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins4.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins5.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins6.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins7.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins8.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins9.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/call1.C52
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cast1.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cast2.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cast3.C44
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cast4.C63
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cast5.C38
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cast6.C57
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cast7.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cleanup1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cleanup2.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cleanup4.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat1-aux.cc10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat1.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat2-aux.cc17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat2.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat3.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat3.h8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat4.C57
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat5-aux.cc1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/comdat5.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond1.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond2.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond3.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond4.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond5.C45
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond6.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond7.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/const1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/const2.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv2.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv3.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv4.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv5.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv6.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv7.C46
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv8.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv9.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/copy1.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/copy2.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/copy3.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/covar1.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash1.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash10.C52
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash11.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash12.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash13.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash14.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash15.C43
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash16.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash17.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash19.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash2.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash20.C38
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash21.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash22.C56
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash23.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash24.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash25.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash26.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash27.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash28.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash29.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash3.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash30.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash31.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash32.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash33.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash34.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash35.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash36.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash37.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash38.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash39.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash4.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash40.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash41.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash42.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash5.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash6.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash60.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash7.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash8.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash9.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ctor1-aux.cc12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ctor1.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cvqual1.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cvt1.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dcast1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dcast2.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug1.C48
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug2.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug3.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug4.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug5.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug6.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug7.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug8.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug9.C42
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl2.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl3.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl4.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl5.C79
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl6.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl7.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl8.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl9.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg1.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg2.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg3.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg4.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg5.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg6.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg7.C44
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg8.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg9.C52
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete2.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete3.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete4.C53
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete5.C42
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete6.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete7.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete8.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/deref1.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dll-1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dll-2.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dll-3.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dll-4.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dll-5.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dll-6.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor1.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor10.C41
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor11.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor12.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor13.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor2.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor3.C51
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor4.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor5.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor6.C45
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor7.C43
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor8.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dtor9.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dyncast1.C123
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dyncast2.C85
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dyncast3.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dyncast4.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dyncast5.C38
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dyncast6.C73
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/eh.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/eh1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/eh2.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/eh3.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/eh4.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/eh5.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/elab1.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/empty1.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/empty2.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/enum1.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/enum2.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/enum3.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/enum4.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/enum5.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/explicit1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/expr1.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/externC1.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/externC2.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/externC3.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/externC4.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/externC5.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/field1.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/field2.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/fnname1.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/for1.C43
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/for2.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend1.C88
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend10.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend11.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend2.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend3.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend4.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend5.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend6.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend7.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend8.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend9.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/goto1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/goto2.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/goto3.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/goto4.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/headers1.C59
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/incomplete.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init1.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init10.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init11.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init12.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init13.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init14.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init15.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init16.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init17.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init18.C42
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init19.C85
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init2.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init3.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init4.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init5.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init6.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init7.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init8.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init9.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/initstring.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline10.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline11.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline12.C326
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline13.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline14.C49
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline15.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline16.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline17.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline18.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline19.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline2.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline20.C58
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline21.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline23.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline3.C51
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline4.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline5.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline6.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline7.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline8.C69
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline9.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/instan1.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lex1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lineno1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lineno2.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lineno3.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lineno4.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lineno5.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage2.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage3.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage4.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage5.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage6.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage7.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/local-alloc1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/local1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/local2.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/local3.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/local4.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup10.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup11.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup12.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup13.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup14.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup15.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup16.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup17.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup18.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup19.C54
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup2.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup20.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup21.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup22.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup23.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup3.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup4.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup5.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup6.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup7.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup8.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup9.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/loop1.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/loop2.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/main1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/main2.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/mangle10.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/mangle2.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/mangle3.C42
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/mutable1.C44
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/nested1.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/nested2.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/nested3.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/nested4.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/new.C60
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/new3.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/new4.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/new5.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/new6.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/new7.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/null2.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/null3.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/op1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/op2.C64
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/op3.C64
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/optimize1.C71
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/optimize2.C75
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/optimize3.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/optimize4.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overcnv1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overcnv2.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload10.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload11.C92
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload12.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload13.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload14.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload2.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload3.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload4.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload5.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload6.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload7.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload8.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload9.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/override1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/override2.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/parse1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/parse2.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/perf1.C78
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pmf1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pmf2.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pmf3.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pmf4.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pmf5.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pmf6.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pmf7.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pod1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/printf1.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem10.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem2.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem3.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem4.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem5.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem8.C75
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem9.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/qual1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/realloc.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/redecl1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/redecl2.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/redecl3.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/redecl4.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ref1.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ref2.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ref3.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ref4.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/refinit1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/refinit2.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/regstack.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/reload1.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/return1.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/rtti1.C122
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/rtti2.C89
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/rtti3.C97
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/rtti4.C87
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/rtti5.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/rttid2.C101
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/rttid3.C116
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/rttid4.C112
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sc1.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/scope1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/shadow1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sibcall1.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sibcall2.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/signed.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/singleton.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sizeof1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sizeof2.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sizeof3.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sizeof4.C41
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sizeof5.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static10.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static11.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static12.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static13.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static14.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static15.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static16.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static2.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static20.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static3.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static4.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static5.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static6.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static7.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static9.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/std1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/stmtexpr1.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/stmtexpr2.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/store-expr1.C89
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/store-expr2.C88
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/string1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/string2.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/struct1.C42
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/syntax1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/syntax2.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/syntax3.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/syntax4.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/syshdr1.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/temporary1.C41
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/thunk1.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/type.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typeck1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef2.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef3.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef4.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef5.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef6.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef7.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef8.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typeid1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typename1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typename2.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/unchanging1.C46
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/union1.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/union2.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/union3.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/union4.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using1.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using2.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using3.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using4.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using5.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using6.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using7.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using8.C43
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using9.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vaarg1.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vaarg2.C64
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vaarg3.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vaarg4.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vbase1.C52
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vbase2.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vbase3.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vbase4.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vbase5.C203
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual10.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual11.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual2.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual3.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual4.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual5.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual6.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual7.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual8.C32
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/virtual9.C46
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/volatile1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vtbl1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vtbl2.C77
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn01.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn3.C55
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn4.C68
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn5.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn6.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn7.C45
525 files changed, 13204 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/900403_04.C b/gcc/testsuite/g++.old-deja/g++.other/900403_04.C
new file mode 100644
index 000000000..ba6aef0d2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/900403_04.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// GROUPS passed abort
+// g++ 1.37.1 bug 900403_04
+
+// The following erroneous code causes g++ to abort.
+
+// keywords: abort, bit-fields, zero length
+
+struct s {
+ unsigned int foo:0; // { dg-error "" } causes abort
+ unsigned int field;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/900519_12.C b/gcc/testsuite/g++.old-deja/g++.other/900519_12.C
new file mode 100644
index 000000000..82d0f9f7d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/900519_12.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// GROUPS abort
+// g++ 1.37.1 bug 900519_12
+
+// The following erroneous code causes g++ to segfault.
+
+// cfront 2.0 passes this test.
+
+// keywords: segfault, typedef, pointer type, function type
+
+typedef eek void (*)(); // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access1.C b/gcc/testsuite/g++.old-deja/g++.other/access1.C
new file mode 100644
index 000000000..e463ef4c4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access1.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+class X{
+ unsigned int i;
+ public:
+ void f();
+};
+
+void X::f()
+{
+ union {
+ int foo[sizeof (i)];
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access10.C b/gcc/testsuite/g++.old-deja/g++.other/access10.C
new file mode 100644
index 000000000..103cd4108
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access10.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// Test that defining a static member of private type with the () syntax works.
+
+class A {
+ private:
+ struct B { B(int) {} };
+ static B b;
+};
+A::B A::b (1);
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access11.C b/gcc/testsuite/g++.old-deja/g++.other/access11.C
new file mode 100644
index 000000000..72fc333c1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access11.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-w" }
+// Origin: r.spatschek@fz-juelich.de
+
+class A
+{
+private:
+ template <class T> void g(T t) {}
+ int i;
+};
+
+template <>
+void A::g<int>(int t) { i = 1; } // { dg-error "" } private
+
+int main()
+{
+ A a;
+
+ a.g<int>(0); // { dg-error "" } private
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access2.C b/gcc/testsuite/g++.old-deja/g++.other/access2.C
new file mode 100644
index 000000000..51722aecd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access2.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Based on a testcase in the Standard, submitted by several people
+
+class Outer {
+ typedef int T;
+ struct Inner {
+ T i; // { dg-error "" "" { xfail *-*-* } } not accessible -
+ void f() {
+ T j; // { dg-error "" "" { xfail *-*-* } } not accessible -
+ }
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access3.C b/gcc/testsuite/g++.old-deja/g++.other/access3.C
new file mode 100644
index 000000000..4752ac8a8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access3.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// The standard sez that a use of a name gets the most access it can through
+// the various paths that can reach it. Here, the access decl in B gives
+// us access.
+
+struct A
+{
+ void f ();
+};
+
+struct B: private virtual A
+{
+ A::f;
+};
+
+struct C: private virtual A, public B
+{
+};
+
+int
+main ()
+{
+ C c;
+
+ c.f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access4.C b/gcc/testsuite/g++.old-deja/g++.other/access4.C
new file mode 100644
index 000000000..939bebcf0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access4.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+struct A { // { dg-error "" } inaccessible
+ static int i;
+};
+
+struct B : private A { };
+
+struct C : public B {
+ int f () { return A::i; } // { dg-error "" } context
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access5.C b/gcc/testsuite/g++.old-deja/g++.other/access5.C
new file mode 100644
index 000000000..431ba416a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access5.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+
+class A
+{
+protected:
+ int i;
+};
+
+class B : private A
+{
+protected:
+ A::i;
+};
+
+struct C : public B {
+ friend int f(C *p);
+};
+
+int f(C *p) {
+ return p->i;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access6.C b/gcc/testsuite/g++.old-deja/g++.other/access6.C
new file mode 100644
index 000000000..59d92975b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access6.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+template <int I>
+struct S {
+ void g();
+};
+
+class C {
+ static const int i = 3; // { dg-bogus "" } private
+public:
+ S<C::i>* f(); // { dg-bogus "" } redeclared
+};
+
+S<C::i>* C::f() { // { dg-bogus "" } private
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access7.C b/gcc/testsuite/g++.old-deja/g++.other/access7.C
new file mode 100644
index 000000000..635c6df77
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access7.C
@@ -0,0 +1,33 @@
+// { dg-do assemble }
+// Test that access control for types and statics works properly
+// with nested types.
+
+
+class A {
+ static int I1; // { dg-error "" } private
+ struct B1 { }; // { dg-error "" } private
+public:
+ static int I2;
+ struct B2 { };
+};
+
+class D: public A {
+ struct E {
+ void f ();
+ };
+};
+
+void D::E::f ()
+{
+ int i = I1; // { dg-error "" } within this context
+ B1 b1; // { dg-error "" } within this context
+ i = I2;
+ B2 b2;
+}
+
+void f ()
+{
+ A::B1 b1; // { dg-error "" } within this context
+ new A::B1; // { dg-error "" } within this context
+ (A::B1) b1; // { dg-error "" } within this context
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access8.C b/gcc/testsuite/g++.old-deja/g++.other/access8.C
new file mode 100644
index 000000000..abd401b12
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access8.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Feb 2000 <nathan@acm.org>
+
+// Test that access to static members from a nested class of the derived
+// type works.
+
+class Base
+{
+ protected:
+ static int Some_var;
+ typedef int Some_t;
+};
+
+class Derived : Base
+{
+ protected:
+ struct Nested
+ {
+ void Foo (Some_t);
+ void Bar (Base::Some_t) { Base::Some_var = 1; }
+ };
+};
+
+void Derived::Nested::Foo (Some_t) {
+ Some_var = 2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access9.C b/gcc/testsuite/g++.old-deja/g++.other/access9.C
new file mode 100644
index 000000000..6e60a07bc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/access9.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Test that g++ allows friends to use private types in their declarations.
+
+class A {
+ typedef int I;
+ friend I f (I);
+};
+
+A::I f (A::I);
+A::I f (A::I) { return 0; }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/addrof1.C b/gcc/testsuite/g++.old-deja/g++.other/addrof1.C
new file mode 100644
index 000000000..2702ee07b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/addrof1.C
@@ -0,0 +1,34 @@
+// { dg-do run }
+
+extern "C" void abort ();
+
+typedef struct st {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+} __attribute__((aligned(4))) st;
+
+void testme(int, int, int);
+
+static inline void
+stupid_func(st s)
+{
+ testme(s.a, s.b, s.c);
+}
+
+int main()
+{
+ st s;
+
+ s.a = s.b = s.c = 216;
+ stupid_func(s);
+
+ return 0;
+}
+
+void testme(int a, int b, int c)
+{
+ if (a != 216 || b != 216 || c != 216)
+ abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/align.C b/gcc/testsuite/g++.old-deja/g++.other/align.C
new file mode 100644
index 000000000..a5269515c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/align.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+#include <string.h>
+
+class bar {
+public:
+ bar() { rw = 0; }
+ static const bar baz;
+private:
+ unsigned char rw;
+};
+char buf[4096];
+void foo(char *uc)
+{
+ memcpy(buf,&bar::baz,sizeof(bar));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ambig1.C b/gcc/testsuite/g++.old-deja/g++.other/ambig1.C
new file mode 100644
index 000000000..f3fe0a8dd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ambig1.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+
+struct A {
+ int operator ++(); // { dg-error "" } candidates
+ void operator ()(); // { dg-error "" } candidates
+ void operator delete(void*); // { dg-error "" } candidates
+};
+
+struct B {
+ int operator ++(int); // { dg-error "" } candidates
+ void operator ()(); // { dg-error "" } candidates
+ void operator delete(void*); // { dg-error "" } candidates
+ void f();
+};
+
+struct C : public A, public B {
+};
+
+void f()
+{
+ C c;
+ C* cp;
+
+ delete cp; // { dg-error "" } ambiguous
+ c(); // { dg-error "" } ambiguous
+ c++; // { dg-error "" } ambiguous
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ambig2.C b/gcc/testsuite/g++.old-deja/g++.other/ambig2.C
new file mode 100644
index 000000000..7f6096876
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ambig2.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Aug 1999 <nathan@acm.org>
+
+// We should spot all ambiguities
+
+struct A {int m;};
+struct B : A { int m; };
+struct C : A { int m; };
+struct D0 : virtual B, virtual C { int m; };
+struct D1 : virtual B, C { int m; };
+struct D2 : B, virtual C { int m; };
+struct D3 : B, C { int m; };
+
+void fn(D0 *d0, D1 *d1, D2 *d2, D3 *d3)
+{
+ A *a0 = d0; // { dg-error "" } A is an ambiguous base
+ A *a1 = d1; // { dg-error "" } A is an ambiguous base
+ A *a2 = d2; // { dg-error "" } A is an ambiguous base
+ A *a3 = d3; // { dg-error "" } A is an ambiguous base
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ambig3.C b/gcc/testsuite/g++.old-deja/g++.other/ambig3.C
new file mode 100644
index 000000000..3b14e75c7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ambig3.C
@@ -0,0 +1,34 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 23 June 2000 <nathan@codesourcery.com>
+
+// Origin GNATS bug report 69 from Glenn Ammons <ammons@cs.wisc.edu>
+//
+// A base which derives a virtual base hides declarations in the virtual base,
+// even if that virtual base is accessible via another path [10.2]/6. Make
+// sure that non-virtual bases of the virtual base are also hidden, not matter
+// what order bases are declared in.
+
+struct A {int a;};
+struct B : A {};
+
+struct L1 : virtual B { int a; };
+struct L2 : virtual A { int a; };
+
+struct R1 : virtual B {};
+struct R2 : virtual A {};
+
+struct C1 : R1, L1 {};
+struct C2 : R2, L2 {};
+
+struct D1 : L1, R1 {};
+struct D2 : L2, R2 {};
+
+void fn (C1 *c1, D1 *d1, C2 *c2, D2 *d2)
+{
+ c1->a = 1;
+ d1->a = 1;
+ c2->a = 1;
+ d2->a = 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon1.C b/gcc/testsuite/g++.old-deja/g++.other/anon1.C
new file mode 100644
index 000000000..5886b1a71
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon1.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+static union {
+ union {
+ };
+}; // { dg-warning "" } anonymous union with no members
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon2.C b/gcc/testsuite/g++.old-deja/g++.other/anon2.C
new file mode 100644
index 000000000..f35d5ff31
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon2.C
@@ -0,0 +1,32 @@
+// { dg-do run }
+extern "C" void abort (void);
+
+static union {
+ int x1;
+ long x2;
+ short x3;
+ long x4;
+};
+
+static union {
+ union {
+ union {
+ int z;
+ };
+ };
+ union {
+ union {
+ double d;
+ int i;
+ };
+ };
+};
+
+
+int main()
+{
+ z = 3;
+ if (i != 3)
+ abort ();
+ d = 2.5;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon3.C b/gcc/testsuite/g++.old-deja/g++.other/anon3.C
new file mode 100644
index 000000000..3f8b5cc00
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon3.C
@@ -0,0 +1,86 @@
+// { dg-do run }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 20 May 1999 <nathan@acm.org>
+
+// Although anon unions cannot have user defined member functions
+// [class.union/2]. They should have implicitly defined copy ctors and
+// and the like [class.copy/4]. Make sure we generate one of the correct
+// signature and that it works ok.
+
+extern "C" void abort();
+
+struct A
+{
+ union
+ {
+ int a;
+ };
+};
+union B
+{
+ int a;
+};
+
+static A Ctor(A const &src)
+{
+ A result(src); // this should not cause a const violation
+
+ result = src; // and neither should this
+
+ return result;
+}
+
+typedef __SIZE_TYPE__ size_t;
+
+void *operator new(size_t, void *ptr)
+{
+ return ptr;
+}
+
+// check copy ctor and assignment for plain union
+void check_union()
+{
+ B b1;
+ B b2;
+
+ b1.a = 5;
+ b2.a = 6;
+ b2 = b1;
+ if(b2.a != 5)
+ abort();
+
+ b2.a = 6;
+ new (&b2) B(b1);
+ if(b2.a != 5)
+ abort();
+
+ return;
+}
+
+// check copy ctor and assignment for class containing anon-union
+void check_union_member()
+{
+ A a1;
+ A a2;
+
+ a1.a = 5;
+ a2.a = 6;
+ a2 = a1;
+ if(a2.a != 5)
+ abort();
+
+ a2.a = 6;
+ new (&a2) A(a1);
+ if(a2.a != 5)
+ abort();
+
+ return;
+}
+
+int main()
+{
+ check_union();
+ check_union_member();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon4.C b/gcc/testsuite/g++.old-deja/g++.other/anon4.C
new file mode 100644
index 000000000..2a01be3d0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon4.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 20 May 1999 <nathan@acm.org>
+
+// Anon unions cannot have user defined member functions
+// [class.union/2]. Make sure we spot that.
+
+
+struct A
+{
+ union
+ { // { dg-error "" } anon union cannot have member fns
+ void bad();
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon5.C b/gcc/testsuite/g++.old-deja/g++.other/anon5.C
new file mode 100644
index 000000000..4b0943683
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon5.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com>
+
+// Bug 649. A cv qualified anonymous union would cause confusion.
+
+struct X
+{
+ int fn () const
+ {
+ return member;
+ }
+ const union
+ {
+ int member;
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon6.C b/gcc/testsuite/g++.old-deja/g++.other/anon6.C
new file mode 100644
index 000000000..e1cfeb253
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon6.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+extern "C" void abort ();
+
+struct A {
+ union {
+ int a;
+ double b;
+ int d;
+ };
+ int c;
+};
+
+struct B : public A {
+ union {
+ double a;
+ void *c;
+ };
+ float b;
+ int e;
+};
+
+int main ()
+{
+ struct B b;
+
+ b.a = 1.5;
+ b.b = 2.5;
+ b.d = 1;
+ b.e = 2;
+ if (b.a != 1.5 || b.b != 2.5 || b.d != 1 || b.e != 2)
+ abort ();
+ b.c = &b.a;
+ b.d = b.e;
+ if (b.c != &b.a || b.d != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon7.C b/gcc/testsuite/g++.old-deja/g++.other/anon7.C
new file mode 100644
index 000000000..ebc378005
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon7.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+
+struct A {
+ union {
+ int a; // { dg-error "" } conflicts with previous declaration
+ };
+ int a; // { dg-error "" }
+};
+
+struct B {
+ int b; // { dg-error "" } conflicts with previous declaration
+ union {
+ int b; // { dg-error "" } duplicate member
+ };
+};
+
+struct C {
+ union {
+ int c; // { dg-error "" } conflicts with previous declaration
+ };
+ union {
+ int c; // { dg-error "" } duplicate member
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon8.C b/gcc/testsuite/g++.old-deja/g++.other/anon8.C
new file mode 100644
index 000000000..fb26d7313
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon8.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+
+struct B
+{
+ int a;
+ B & operator= (const B &);
+};
+
+struct A
+{
+ union {
+ int a;
+ };
+ B b;
+};
+
+A x;
+
+void foo (const A &y)
+{
+ x = y;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon9.C b/gcc/testsuite/g++.old-deja/g++.other/anon9.C
new file mode 100644
index 000000000..a364db8e9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon9.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Test that we properly diagnose an attempt to use an anonymous class
+// in declaring an external function.
+
+typedef const struct { int i; } T; // { dg-error "" } referenced below
+void f (T* t); // { dg-error "" } uses unnamed type
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array1.C b/gcc/testsuite/g++.old-deja/g++.other/array1.C
new file mode 100644
index 000000000..5aa5b1ed6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array1.C
@@ -0,0 +1,27 @@
+// { dg-do run }
+int i;
+
+struct S {
+ S (int) {
+ ++i;
+ if (i == 3)
+ throw 3;
+ }
+
+ S () {}
+
+ ~S() {
+ --i;
+ }
+};
+
+int main()
+{
+ try {
+ S s[5] = { 0, 1, 2, 3, 4 };
+ } catch (...) {
+ }
+
+ if (i != 1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array2.C b/gcc/testsuite/g++.old-deja/g++.other/array2.C
new file mode 100644
index 000000000..5c1b66577
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array2.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+int i;
+
+struct S {
+ S () {
+ ++i;
+ }
+
+ S (int) {
+ }
+};
+
+int main()
+{
+ S s[3][3] = { 2 };
+
+ if (i != 8)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array3.C b/gcc/testsuite/g++.old-deja/g++.other/array3.C
new file mode 100644
index 000000000..f89090f17
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array3.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Aug 2000 <nathan@codesourcery.com>
+
+// bug 386.C We ICE'd before emitting a diagnostic when trying to
+// initialize a constant non-pod array from something bogus.
+
+
+struct A
+{
+ A(char);
+};
+
+class B
+{
+ const A ary[16];
+
+ B (const A ary[]);
+};
+
+B::B (const A a[])
+ : ary(a) // { dg-error "array" }
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array4.C b/gcc/testsuite/g++.old-deja/g++.other/array4.C
new file mode 100644
index 000000000..7e9260234
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array4.C
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+// Origin: j_bouis@hotmail.com
+
+enum { FOO = 3 };
+int* arr = new int[FOO];
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array5.C b/gcc/testsuite/g++.old-deja/g++.other/array5.C
new file mode 100644
index 000000000..e32bbea5a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array5.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// We tried to create a temporary of unknown size and crashed.
+
+extern int a1[];
+extern int a2[];
+int foo(int p)
+{
+ int x = (p ? a1 : a2)[1];
+ return x;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array6.C b/gcc/testsuite/g++.old-deja/g++.other/array6.C
new file mode 100644
index 000000000..1ffc42a59
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array6.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// { dg-options "-O1" }
+
+int count = 0;
+
+double foo () {
+ count++;
+ return 0;
+}
+
+double bar () {
+ const double x[1] = { foo() };
+ return x[0];
+}
+
+int main ()
+{
+ bar();
+ if (count != 1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array9.C b/gcc/testsuite/g++.old-deja/g++.other/array9.C
new file mode 100644
index 000000000..c2c2d79b9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array9.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+template <class T> class A {
+ T *d;
+ public: void f() { (T[10])d; }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/asm1.C b/gcc/testsuite/g++.old-deja/g++.other/asm1.C
new file mode 100644
index 000000000..87edbe164
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/asm1.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S {
+ int i asm ("abc"); // { dg-error "" } `asm' specifier not permitted
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/asm2.C b/gcc/testsuite/g++.old-deja/g++.other/asm2.C
new file mode 100644
index 000000000..d5fd5a922
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/asm2.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct C
+{
+ void f ();
+};
+
+void C::f ()
+{
+ asm ("" : : "m" (f)); // { dg-error "" } type could not be determined
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/asm3.C b/gcc/testsuite/g++.old-deja/g++.other/asm3.C
new file mode 100644
index 000000000..5cbf04893
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/asm3.C
@@ -0,0 +1,10 @@
+// { dg-do assemble { target i?86-*-* x86_64-*-* } }
+// { dg-options "-O2" }
+
+typedef unsigned long long uint64;
+uint64 fstps(void)
+{
+ uint64 ret;
+ asm volatile("fstps %0" : "=m" (ret));
+ return ret;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/badarrow.C b/gcc/testsuite/g++.old-deja/g++.other/badarrow.C
new file mode 100644
index 000000000..6e7578d1d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/badarrow.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+struct S {
+ int i;
+} s;
+
+void f()
+{
+ s->i = 3; // { dg-error "" } base operand
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/badopt1.C b/gcc/testsuite/g++.old-deja/g++.other/badopt1.C
new file mode 100644
index 000000000..a4daa221e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/badopt1.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Based on a testcase by Bryan Weston <bryanw@bluemoon.sps.mot.com>
+// egcs 1.1 fails to increment count
+
+
+struct Base { Base() {} }; // removing the constructor fixes the problem
+struct Derived : Base {}; // so does removing the base class
+
+int main() {
+ int count = 0;
+ Derived* array[1]; // making this Base*[1] does not fix the problem
+ array[count++] = new Derived (); // but then new Base() does
+ if (count!=1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/base1.C b/gcc/testsuite/g++.old-deja/g++.other/base1.C
new file mode 100644
index 000000000..3c9ac264e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/base1.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Nov 2000 <nathan@codesourcery.com>
+
+// We lost information about which base wasn't an aggregate type, plus we
+// allowed cv qualifed bases via typedefs.
+
+typedef int I;
+typedef int cI;
+
+struct A {};
+
+typedef const A cA;
+typedef A pA;
+
+struct B : I {}; // { dg-error "" } not an aggregate
+struct C : cI {}; // { dg-error "" } not an aggregate
+struct D : cA {}; // { dg-error "" } cv qualified
+struct E : pA {};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/bitfld1.C b/gcc/testsuite/g++.old-deja/g++.other/bitfld1.C
new file mode 100644
index 000000000..471032173
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/bitfld1.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Based on a bug report by Stephen Vavasis <vavasis@CS.Cornell.EDU>
+
+// declares template operator!=
+#include <utility>
+
+struct foo {
+ enum e { bar } baz:1;
+ void test() {
+ baz != bar;
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/bitfld2.C b/gcc/testsuite/g++.old-deja/g++.other/bitfld2.C
new file mode 100644
index 000000000..62a971363
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/bitfld2.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// { dg-options "-funsigned-bitfields" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+typedef int i[4];
+
+struct S {
+ i j:12; // { dg-error "" } array type as bitfield
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/bitfld3.C b/gcc/testsuite/g++.old-deja/g++.other/bitfld3.C
new file mode 100644
index 000000000..7e16a7206
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/bitfld3.C
@@ -0,0 +1,34 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 4 Jun 1999 <nathan@acm.org>
+// Derived from a bug report from Stephan Riess <riess@bfw-online.de>
+// http://gcc.gnu.org/ml/gcc-bugs/1999-06n/msg00107.html
+
+// Builtin ops don't always need reference bindings, and we weren't removing
+// them always after doing overload resolution. This caused us to try and take
+// the address of a bitfield.
+
+enum E {one};
+struct A {
+ E m1: 8;
+ E m2: 8;
+ unsigned m3 : 8;
+ unsigned m4 : 8;
+};
+
+int fn (int f)
+{
+ A a;
+ E m1, m2;
+ E e;
+ int i;
+
+ e = f ? m1 : m2;
+ e = f ? a.m1 : a.m2;
+ i = f ? a.m3 : a.m4;
+ (f ? m1 : m2) = e;
+ (f ? a.m1 : a.m2) = e;
+ (f ? a.m3 : a.m4) = i;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/bitfld4.C b/gcc/testsuite/g++.old-deja/g++.other/bitfld4.C
new file mode 100644
index 000000000..96cb216b5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/bitfld4.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// Origin: "Chen, Wen-Ke" <chwk@cs.arizona.edu>
+
+template <class T>
+bool operator!=(const T&, const T&);
+
+enum MsgType {
+ MSG_DATA
+};
+
+class C {
+public:
+ MsgType mType : 8;
+};
+
+int main(void)
+{
+ extern C& c;
+
+ c.mType = MSG_DATA;
+ if (c.mType != MSG_DATA)
+ return -1;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/bitfld5.C b/gcc/testsuite/g++.old-deja/g++.other/bitfld5.C
new file mode 100644
index 000000000..2808ae1e2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/bitfld5.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// { dg-options "-w" }
+
+struct S
+{
+ int i : 1756;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins1.C b/gcc/testsuite/g++.old-deja/g++.other/builtins1.C
new file mode 100644
index 000000000..ee714d715
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins1.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Test whether this builtin minimally works in G++.
+// Origin: Kaveh Ghazi Jan 16, 2001
+// Copyright (C) 2001 Free Software Foundation.
+//
+
+namespace std
+{
+ extern "C" void abort (void);
+}
+
+int main ()
+{
+ using namespace std;
+
+ if (::__builtin_strlen ("hello") != 5)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins10.C b/gcc/testsuite/g++.old-deja/g++.other/builtins10.C
new file mode 100644
index 000000000..07f74f8f6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins10.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// Test that built-in functions don't warn when prototyped without arguments.
+// Origin: PR c++/9367
+// Copyright (C) 2003 Free Software Foundation.
+
+extern "C" int snprintf();
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins2.C b/gcc/testsuite/g++.old-deja/g++.other/builtins2.C
new file mode 100644
index 000000000..68cb4e2a1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins2.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Test whether this builtin minimally works in G++.
+// Origin: Kaveh Ghazi Jan 16, 2001
+// Copyright (C) 2001 Free Software Foundation.
+//
+
+namespace std
+{
+ extern "C" void abort (void);
+}
+
+int main ()
+{
+ using namespace std;
+ char f[16];
+
+ if (::__builtin_strcpy (f, "hello world") != f
+ || __builtin_memcmp (f, "hello world", sizeof ("hello world")))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins3.C b/gcc/testsuite/g++.old-deja/g++.other/builtins3.C
new file mode 100644
index 000000000..ace31b0f7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins3.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Test whether this builtin minimally works in G++.
+// Origin: Kaveh Ghazi Jan 16, 2001
+// Copyright (C) 2001 Free Software Foundation.
+//
+
+namespace std
+{
+ extern "C" void abort (void);
+}
+
+int main ()
+{
+ using namespace std;
+ void *foo;
+
+ foo = ::__builtin_alloca (32);
+ if (!foo)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins4.C b/gcc/testsuite/g++.old-deja/g++.other/builtins4.C
new file mode 100644
index 000000000..2cb1552e2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins4.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Test whether this builtin minimally works in G++.
+// Origin: Kaveh Ghazi Jan 16, 2001
+// Copyright (C) 2001 Free Software Foundation.
+//
+
+namespace std
+{
+ extern "C" void abort (void);
+}
+
+int main ()
+{
+ using namespace std;
+
+ ::__builtin_printf ("hello world\n");
+ ::__builtin_printf ("\n");
+ ::__builtin_printf ("%s\n", "hello world");
+ ::__builtin_printf ("%c", '\n');
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins5.C b/gcc/testsuite/g++.old-deja/g++.other/builtins5.C
new file mode 100644
index 000000000..f229d2922
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins5.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// Test that built-in functions aren't recognized without a prototype.
+// Origin: Roger Sayle Mar 20, 2002
+// Copyright (C) 2002 Free Software Foundation.
+
+int
+foo ()
+{
+ return (int) ::strlen ("foo"); // { dg-error "" } undeclared
+}
+
+int
+bar ()
+{
+ return (int) std::strlen ("bar"); // { dg-error "" } undeclared
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins6.C b/gcc/testsuite/g++.old-deja/g++.other/builtins6.C
new file mode 100644
index 000000000..75285db9c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins6.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Test that built-in functions are recognized with a prototype.
+// Origin: Roger Sayle Mar 20, 2002
+// Copyright (C) 2002 Free Software Foundation.
+//
+
+typedef __SIZE_TYPE__ size_t;
+extern "C" size_t strlen (const char*);
+extern "C" void link_error (void);
+
+int
+main ()
+{
+ if (strlen ("foo") != 3)
+ link_error ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins7.C b/gcc/testsuite/g++.old-deja/g++.other/builtins7.C
new file mode 100644
index 000000000..4d664c1a7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins7.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Test that built-in functions are recognized with a prototype.
+// Origin: Roger Sayle Mar 20, 2002
+// Copyright (C) 2002 Free Software Foundation.
+//
+
+extern "C" void link_error (void);
+
+namespace std {
+typedef __SIZE_TYPE__ size_t;
+extern "C" size_t strlen (const char*);
+}
+
+int
+main ()
+{
+ if (std::strlen ("foo") != 3)
+ link_error ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins8.C b/gcc/testsuite/g++.old-deja/g++.other/builtins8.C
new file mode 100644
index 000000000..9d12a45a7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins8.C
@@ -0,0 +1,25 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Test that built-in functions are recognized with a prototype.
+// Origin: Roger Sayle Mar 20, 2002
+// Copyright (C) 2002 Free Software Foundation.
+//
+
+
+extern "C" void link_error (void);
+
+namespace std {
+typedef __SIZE_TYPE__ size_t;
+extern "C" size_t strlen (const char*);
+}
+
+using namespace std;
+
+int
+main ()
+{
+ if (strlen ("foo") != 3)
+ link_error ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins9.C b/gcc/testsuite/g++.old-deja/g++.other/builtins9.C
new file mode 100644
index 000000000..2933866fc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins9.C
@@ -0,0 +1,14 @@
+// { dg-do run }
+// Test that inline redeclarations of builtins are emitted.
+// Origin: Roger Sayle Mar 28, 2002
+// Copyright (C) 2002 Free Software Foundation.
+
+namespace std {
+ inline int fabs (void) { return 0; }
+}
+
+
+int main ()
+{
+ return std::fabs ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/call1.C b/gcc/testsuite/g++.old-deja/g++.other/call1.C
new file mode 100644
index 000000000..e12cffedf
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/call1.C
@@ -0,0 +1,52 @@
+// { dg-do run }
+// Test that various calls to non-functions work.
+
+void f () { }
+
+typedef void (*fptr)();
+typedef void (&fref)();
+fptr p = f;
+fref r = f;
+const fptr &pr = p;
+
+struct A {
+ fptr p;
+
+ A (fptr n): p(n) { }
+ operator fptr () { return p; }
+};
+
+struct B {
+ fref r;
+
+ B (fptr n): r(*n) { }
+ operator const fref () { return r; }
+};
+
+struct C {
+ const fptr pr;
+
+ C (fptr n): pr(n) { }
+ operator const fptr& () { return pr; }
+};
+
+int main ()
+{
+ f();
+
+ p();
+ r();
+ pr();
+
+ A a (f);
+ a();
+ a.p();
+
+ B b (f);
+ b();
+ b.r();
+
+ C c (f);
+ c();
+ c.pr();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cast1.C b/gcc/testsuite/g++.old-deja/g++.other/cast1.C
new file mode 100644
index 000000000..989667a37
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cast1.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+struct S0 { };
+struct S1 : virtual public S0 { };
+struct S2 : virtual public S0 { };
+
+struct S3 : public S1, public S2, virtual public S0
+{
+};
+
+void f(const S0*) {}
+
+void g()
+{
+ f(static_cast<S3*>(0));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cast2.C b/gcc/testsuite/g++.old-deja/g++.other/cast2.C
new file mode 100644
index 000000000..7e99ead65
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cast2.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct A {
+};
+
+int main()
+{
+ A a;
+ typedef void (A::*F)();
+ F p;
+
+ const_cast<const A>(a); // { dg-error "" } const_cast requires pointer/ref types
+ const_cast<F>(p); // { dg-error "" } const_cast requires pointer/ref types
+ const_cast<int (*)()>(&main); // { dg-error "" } function type in const_cast
+ const_cast<int (&)()>(main); // { dg-error "" } function type in const_cast
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cast3.C b/gcc/testsuite/g++.old-deja/g++.other/cast3.C
new file mode 100644
index 000000000..15a27bb6c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cast3.C
@@ -0,0 +1,44 @@
+// { dg-do assemble }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Dec 1999 <nathan@acm.org>
+
+// static_cast should not cast _away_ constness ([expr.static.cast]/6),
+// but nothing bans _adding_ constness. [expr.static.cast]/10 states that a
+// pointer of type cv void can be cast to pointer to object type.
+
+struct X;
+struct Y {};
+struct Z : Y {};
+
+void fn (void *p, void const *cp, Y *yp, Y const *ycp, Z *zp, Z const *zcp)
+{
+ static_cast <X *> (p);
+ static_cast <X const *> (p);
+ static_cast <int *> (p);
+ static_cast <int const *> (p);
+ static_cast <int **> (p);
+ static_cast <int const **> (p);
+ static_cast <int *const *> (p);
+ static_cast <int const *const *> (p);
+
+ static_cast <X *> (cp); // { dg-error "" } lose const
+ static_cast <X const *> (cp);
+ static_cast <int *> (cp); // { dg-error "" } lose const
+ static_cast <int const *> (cp);
+ static_cast <int **> (cp); // { dg-error "" } lose const
+ static_cast <int const **> (cp); // { dg-error "" } lose const
+ static_cast <int *const *> (cp);
+ static_cast <int const *const *> (cp);
+
+ static_cast <Z *> (yp);
+ static_cast <Z const *> (yp);
+
+ static_cast <Z *> (ycp); // { dg-error "" } lose const
+ static_cast <Z const *> (ycp);
+
+ static_cast <Y *> (zp);
+ static_cast <Y const *> (zp);
+
+ static_cast <Y *> (zcp); // { dg-error "" } lose const
+ static_cast <Y const *> (zcp);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cast4.C b/gcc/testsuite/g++.old-deja/g++.other/cast4.C
new file mode 100644
index 000000000..3348dcee8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cast4.C
@@ -0,0 +1,63 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 3 Jan 2000 <nathan@acm.org>
+
+// Derived from a bug report by Ulrich Drepper <drepper@cygnus.com>
+
+struct A {operator char * () { return 0;} };
+struct B {operator char * () const { return 0;} };
+struct C {operator char const * () { return 0;} };
+struct D {operator char const * () const { return 0;} };
+
+void f0 ()
+{
+ A a = A ();
+ B b = B ();
+ C c = C ();
+ D d = D ();
+
+ static_cast <char *> (a);
+ static_cast <char *> (b);
+ static_cast <char *> (c); // { dg-error "" } static cast
+ static_cast <char *> (d); // { dg-error "" } static cast
+}
+
+void f1 ()
+{
+ A a = A ();
+ B b = B ();
+ C c = C ();
+ D d = D ();
+
+ static_cast <const char *> (a);
+ static_cast <const char *> (b);
+ static_cast <const char *> (c);
+ static_cast <const char *> (d);
+}
+
+void f2 ()
+{
+ A const a = A ();
+ B const b = B ();
+ C const c = C ();
+ D const d = D ();
+
+ static_cast <char *> (a); // { dg-error "" } static cast
+ static_cast <char *> (b);
+ static_cast <char *> (c); // { dg-error "" } static cast
+ static_cast <char *> (d); // { dg-error "" } static cast
+}
+
+void f3 ()
+{
+ A const a = A ();
+ B const b = B ();
+ C const c = C ();
+ D const d = D ();
+
+ static_cast <const char *> (a); // { dg-error "" } static cast
+ static_cast <const char *> (b);
+ static_cast <const char *> (c); // { dg-error "" } static cast
+ static_cast <const char *> (d);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cast5.C b/gcc/testsuite/g++.old-deja/g++.other/cast5.C
new file mode 100644
index 000000000..bae4f1695
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cast5.C
@@ -0,0 +1,38 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 4 Feb 2000 <nathan@acm.org>
+
+// Array of cv T decays to pointer to cv T, and pointer to array of cv T can
+// be converted to pointer to cv T. We need to make sure the `cv's don't
+// confuse us.
+
+typedef char const *ary_t[2];
+
+void f0 (ary_t const *const &ary)
+{
+ static_cast <void const *> (ary);
+ static_cast <void *> (ary); // { dg-error "" } casts away const
+ (void const *) (ary);
+}
+
+void f1 (ary_t *const &ary)
+{
+ static_cast <void *> (ary);
+ static_cast <void const *> (ary);
+ (void const *) (ary);
+}
+
+void f2 (ary_t const *&ary)
+{
+ static_cast <void const *> (ary);
+ static_cast <void *> (ary); // { dg-error "" } casts away const
+ (void const *) (ary);
+}
+
+void f3 (ary_t *&ary)
+{
+ static_cast <void *> (ary);
+ static_cast <void const *> (ary);
+ (void const *) (ary);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cast6.C b/gcc/testsuite/g++.old-deja/g++.other/cast6.C
new file mode 100644
index 000000000..4bf90fab5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cast6.C
@@ -0,0 +1,57 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Nov 2000 <nathan@codesourcery.com>
+
+// We failed to reject static_cast and implicit conversions of pointers to
+// member that traversed a virtual base.
+
+struct bar
+{
+ int barm;
+ static void a();
+};
+struct filler1 {int fm;};
+struct filler2 {int fm;};
+struct filler3 {int fm;};
+struct filler4 {int fm;};
+
+struct baz : filler1, bar, filler2
+{
+ int bazm;
+};
+
+struct foo : filler3, virtual baz, filler4
+{
+ static void a();
+ void b() {}
+ int m;
+};
+
+typedef void (bar::*barfPtr)();
+typedef void (foo::*foofPtr)();
+typedef int bar::*barmPtr;
+typedef int foo::*foomPtr;
+
+struct X;
+typedef void (X::*xfPtr) ();
+typedef int X::*xmPtr;
+
+int main ()
+{
+ {
+ foofPtr fp = &foo::b;
+ barfPtr bp = static_cast <barfPtr> (fp); // { dg-error "via virtual base" } invalid static_cast
+ foofPtr fp2 = static_cast <foofPtr> (bp); // { dg-error "via virtual base" } invalid static_cast
+ foofPtr fp3 = bp; // { dg-error "via virtual base" } cannot convert
+ fp3 = (foofPtr)bp; // { dg-error "via virtual base" } via virtual base
+
+ foomPtr fmp = &foo::m;
+ barmPtr bmp = static_cast <barmPtr> (fmp); // { dg-error "via virtual base" } invalid static_cast
+ foomPtr fmp2 = static_cast <foomPtr> (bmp); // { dg-error "via virtual base" } invalid static_cast
+ foomPtr fmp3 = bmp; // { dg-error "via virtual base" } cannot convert
+ fmp3 = (foomPtr)bmp; // { dg-error "via virtual base" } via virtual base
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cast7.C b/gcc/testsuite/g++.old-deja/g++.other/cast7.C
new file mode 100644
index 000000000..4f433f424
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cast7.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+// Test that we can add cv-quals in a static cast to a pointer-to-base type.
+
+struct A { int i; };
+struct B : public A {};
+
+int main()
+{
+ int B::* bp = &B::i;
+ const int A::* ap = static_cast<const int A::*>(bp);
+ return ap != bp;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cleanup1.C b/gcc/testsuite/g++.old-deja/g++.other/cleanup1.C
new file mode 100644
index 000000000..27eb8ede4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cleanup1.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// Bug: fold is too eager about pushing down CLEANUP_POINT_EXPR.
+
+int d;
+
+struct A {
+ A() { }
+ ~A() { d = 1; }
+};
+
+int f (const A& a)
+{
+ return 1;
+}
+
+int main ()
+{
+ if (f (A()) && d == 0)
+ return 0;
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C b/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C
new file mode 100644
index 000000000..976b86411
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C
@@ -0,0 +1,27 @@
+// { dg-do run }
+// { dg-options "-O -fno-exceptions -w" }
+// Origin: Bryan Scattergood <bryan@fsel.com>
+
+extern "C" void abort();
+
+class A
+{
+public:
+ A();
+ ~A();
+ int foo();
+};
+
+A::A() {}
+A::~A() { abort (); }
+int A::foo() {}
+
+extern int f()
+{
+ return 0;
+}
+
+int main()
+{
+ return ((f() != 0) ? A().foo() : 0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C b/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C
new file mode 100644
index 000000000..8bdaa1977
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C
@@ -0,0 +1,34 @@
+// { dg-do assemble }
+// { dg-options "-O2 -fno-exceptions" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class foo
+{
+public:
+ foo ();
+ ~foo ();
+};
+
+class bar
+{
+public:
+ bar ();
+ bar (const foo&);
+};
+
+int i;
+foo f ();
+
+inline bar x ()
+{
+ switch (i)
+ {
+ case 0: return bar (f ());
+ default: return bar ();
+ }
+}
+
+bar y ()
+{
+ return x ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat1-aux.cc b/gcc/testsuite/g++.old-deja/g++.other/comdat1-aux.cc
new file mode 100644
index 000000000..34eb88ff8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat1-aux.cc
@@ -0,0 +1,10 @@
+inline int f ()
+{
+ static int i;
+ return ++i;
+}
+
+int g ()
+{
+ return f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat1.C b/gcc/testsuite/g++.old-deja/g++.other/comdat1.C
new file mode 100644
index 000000000..a60c86593
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat1.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+// { dg-additional-sources " comdat1-aux.cc" }
+// { dg-options "-O" }
+// Test that statics in inline functions are unified between
+// translation units. Currently we handle this by just suppressing
+// inling and relying on unification of the function itself.
+
+inline int f ()
+{
+ static int i;
+ return ++i;
+}
+
+int g ();
+
+int main ()
+{
+ if (f() != 1
+ || g() != 2
+ || f() != 3)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat2-aux.cc b/gcc/testsuite/g++.old-deja/g++.other/comdat2-aux.cc
new file mode 100644
index 000000000..283e4e092
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat2-aux.cc
@@ -0,0 +1,17 @@
+template <class T>
+struct S {
+ static int f ()
+ {
+ static int i;
+ return ++i;
+ }
+ S () {};
+ ~S () {};
+};
+
+typedef S<int> a;
+
+int g ()
+{
+ return a::f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat2.C b/gcc/testsuite/g++.old-deja/g++.other/comdat2.C
new file mode 100644
index 000000000..5c44d0c33
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat2.C
@@ -0,0 +1,30 @@
+// { dg-do run }
+// { dg-additional-sources " comdat2-aux.cc" }
+// { dg-options "-O" }
+// Test that statics in inline functions are unified between
+// translation units. Currently we handle this by just suppressing
+// inling and relying on unification of the function itself.
+
+template <class T>
+struct S {
+ static int f ()
+ {
+ static int i;
+ return ++i;
+ }
+ S () {};
+ ~S () {};
+};
+
+typedef S<int> a;
+
+int g ();
+
+int main ()
+{
+ if (a::f() != 1
+ || g() != 2
+ || a::f() != 3)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc b/gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc
new file mode 100644
index 000000000..fc011e27a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc
@@ -0,0 +1,6 @@
+#include "comdat3.h"
+
+void f ()
+{
+ const bool *p = &A<int>::b;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat3.C b/gcc/testsuite/g++.old-deja/g++.other/comdat3.C
new file mode 100644
index 000000000..2a538cad9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat3.C
@@ -0,0 +1,14 @@
+// { dg-do run }
+// { dg-additional-sources " comdat3-aux.cc" }
+// Test that duplicate elimination of implicit instantiations of static
+// data members works properly.
+
+// Additional files: comdat3.h
+
+#include "comdat3.h"
+
+int main ()
+{
+ const bool *p = &A<int>::b;
+ f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat3.h b/gcc/testsuite/g++.old-deja/g++.other/comdat3.h
new file mode 100644
index 000000000..e2ec97090
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat3.h
@@ -0,0 +1,8 @@
+template <class T> struct A {
+ static const bool b = false;
+};
+
+template <class T>
+const bool A<T>::b;
+
+void f ();
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc b/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc
new file mode 100644
index 000000000..e0556a529
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc
@@ -0,0 +1,40 @@
+extern void
+bar (int x);
+
+inline void
+foo (int i)
+{
+ switch (i)
+ {
+ case 3:
+ case 5:
+ case 6:
+ case 9:
+ case 15:
+ bar (1);
+ break;
+ case 2:
+ case 4:
+ case 7:
+ case 10:
+ case 11:
+ case 12:
+ bar (2);
+ break;
+ case 0:
+ case 1:
+ case 8:
+ case 13:
+ case 16:
+ bar (3);
+ break;
+ case 14:
+ bar (4);
+ break;
+ default:
+ bar (5);
+ break;
+ }
+}
+
+void *fooaddr2 = (void *) foo;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat4.C b/gcc/testsuite/g++.old-deja/g++.other/comdat4.C
new file mode 100644
index 000000000..28b26a1df
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat4.C
@@ -0,0 +1,57 @@
+// PR c++/16276
+// { dg-do link }
+// { dg-additional-sources " comdat4-aux.cc" }
+// { dg-options "-O2" }
+
+extern void
+bar (int x);
+
+inline void
+foo (int i)
+{
+ switch (i)
+ {
+ case 3:
+ case 5:
+ case 6:
+ case 9:
+ case 15:
+ bar (1);
+ break;
+ case 2:
+ case 4:
+ case 7:
+ case 10:
+ case 11:
+ case 12:
+ bar (2);
+ break;
+ case 0:
+ case 1:
+ case 8:
+ case 13:
+ case 16:
+ bar (3);
+ break;
+ case 14:
+ bar (4);
+ break;
+ default:
+ bar (5);
+ break;
+ }
+}
+
+void *fooaddr = (void *) foo;
+
+void
+bar (int x)
+{
+ __asm __volatile ("" : : "r" (x));
+}
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat5-aux.cc b/gcc/testsuite/g++.old-deja/g++.other/comdat5-aux.cc
new file mode 100644
index 000000000..e6ee7c74f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat5-aux.cc
@@ -0,0 +1 @@
+#include "comdat4-aux.cc"
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat5.C b/gcc/testsuite/g++.old-deja/g++.other/comdat5.C
new file mode 100644
index 000000000..ad707f572
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/comdat5.C
@@ -0,0 +1,7 @@
+// PR target/17828
+// { dg-do link { target fpic } }
+// { dg-additional-sources " comdat5-aux.cc" }
+// { dg-options "-O2 -fPIC" }
+// { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } }
+
+#include "comdat4.C"
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond1.C b/gcc/testsuite/g++.old-deja/g++.other/cond1.C
new file mode 100644
index 000000000..64cc728fc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond1.C
@@ -0,0 +1,26 @@
+// { dg-do link }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+void f (T&) ;
+
+template <>
+void f (void (&)())
+{
+}
+
+void g ()
+{
+}
+
+void h ()
+{
+}
+
+bool b;
+
+int main ()
+{
+ f (b ? g : h);
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond2.C b/gcc/testsuite/g++.old-deja/g++.other/cond2.C
new file mode 100644
index 000000000..a7c369110
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond2.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Origin: Loring Holden <lsh@cs.brown.edu>
+
+class Wpt {};
+
+class RAYhit {
+ protected:
+ Wpt _nearpt;
+ public:
+ Wpt surf () const { return true ? Wpt(): _nearpt; }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond3.C b/gcc/testsuite/g++.old-deja/g++.other/cond3.C
new file mode 100644
index 000000000..1fe95fcbb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond3.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Origin: Loring Holden <lsh@cs.brown.edu>
+
+class Wtransf {};
+
+const Wtransf Identity2 = Wtransf ();
+
+class HELPER {
+ public:
+ int current() const { return 0; }
+};
+
+void
+problem_function()
+{
+ HELPER tm;
+ Wtransf delta = (tm.current()) ? Identity2 : Wtransf();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond4.C b/gcc/testsuite/g++.old-deja/g++.other/cond4.C
new file mode 100644
index 000000000..6b28824d1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond4.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// Origin: Loring Holden <lsh@cs.brown.edu>
+
+template <class V>
+class _vec3d
+{
+ public:
+ double _x, _y;
+};
+
+class Wvec : public _vec3d<int> { };
+
+template <class T>
+class TDI {
+ public:
+ T &get();
+};
+
+template <class T>
+class hashvar {
+ public :
+ T _val;
+ TDI<T> *val() const;
+ T get() const { return true ? val()->get() : _val; }
+};
+
+int
+main() {
+ hashvar<Wvec> CONSTRAINT_DIR;
+ CONSTRAINT_DIR.get();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond5.C b/gcc/testsuite/g++.old-deja/g++.other/cond5.C
new file mode 100644
index 000000000..994ea6d95
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond5.C
@@ -0,0 +1,45 @@
+// { dg-do assemble }
+// { dg-options "-W -pedantic -ansi" }
+
+// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Sep 1999 <nathan@acm.org>
+// Derived from bug report from Gabriel Dos Reis
+// <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
+// http://gcc.gnu.org/ml/gcc-bugs/1999-03n/msg00888.html
+
+// conditional exprs have some funny rules when one of the types is void.
+// [expr.cond] 5.16, make sure we do the right things
+// We have checks for mismatching enumerations, check we give them -- they had
+// got lost due to changes in add_builtin_candidate and subsequent changes.
+
+struct X {};
+enum E1 {e1 = -1};
+enum E2 {e2 = -1};
+void f(int, ...);
+
+void fn(int i)
+{
+ double d;
+ int j;
+
+ j = (i ? e1 : e2); // { dg-warning "mismatch" }
+ d = (i ? e1 : 1.0); // { dg-warning "non-enumeral" }
+ d = (i ? 1.0 : e2); // { dg-warning "non-enumeral" }
+ E1 e = (i ? e1 : e1); // ok
+ j = (i ? 1 : e2); // ok
+ j = (i ? e1 : 1); // ok
+
+ j = (i ? throw X() : 1); // ok, int
+ j = (i ? 1 : throw X()); // ok, int
+
+ (i ? throw X() : throw X()); // ok, void
+
+ (i ? i : j) = 1; // ok, int &
+ (i ? throw X() : j) = 1; // { dg-error "lvalue" }
+ (i ? j : throw X()) = 1; // { dg-error "lvalue" }
+ (i ? throw X() : throw X()) = 1; // { dg-error "lvalue" }
+
+ (i ? (void)1 : i++); // { dg-error "throw-expression" }
+ (i ? i++ : (void)1); // { dg-error "throw-expression" }
+
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond6.C b/gcc/testsuite/g++.old-deja/g++.other/cond6.C
new file mode 100644
index 000000000..db018a4a3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond6.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Test that the result of `x ? const E : E' is an E rvalue.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+enum E { a };
+
+bool b;
+
+int main ()
+{
+ E e1 = a;
+ const E &er = e1;
+ E e2 = b ? er : a; // OK
+ const E* ep = &(b ? er : a); // { dg-error "" } non-lvalue
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond7.C b/gcc/testsuite/g++.old-deja/g++.other/cond7.C
new file mode 100644
index 000000000..63d7366a8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond7.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com>
+
+// Bug 3416. We left some unchecked overloaded functions lying around.
+
+struct X
+{
+ void operator << (int);
+ void operator << (float);
+};
+
+void OVL1 (int);
+void OVL1 (float);
+
+void OVL2 (int);
+void OVL2 (float);
+
+X x;
+
+void foo (bool a)
+{
+ x << (a ? OVL1 : OVL2); // { dg-error "" } incomplete type
+ a ? OVL1 : OVL2; // { dg-error "" } incomplete type
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/const1.C b/gcc/testsuite/g++.old-deja/g++.other/const1.C
new file mode 100644
index 000000000..995f466fe
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/const1.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+struct S
+{
+ void f()
+ {
+ const int i; // { dg-error "" } uninitialized const
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/const2.C b/gcc/testsuite/g++.old-deja/g++.other/const2.C
new file mode 100644
index 000000000..4463b9cc9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/const2.C
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+
+struct S {
+ static const char* cp = "abc"; // { dg-error "" } initialization of non-const
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv1.C b/gcc/testsuite/g++.old-deja/g++.other/conv1.C
new file mode 100644
index 000000000..4fe02d3fa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv1.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+class X {
+public:
+ const operator int (); // { dg-error "" } invalid declaration.
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv2.C b/gcc/testsuite/g++.old-deja/g++.other/conv2.C
new file mode 100644
index 000000000..56e41039e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv2.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// { dg-options "-pedantic-errors" }
+
+void cheat( int* i ) { ++(*i); }
+
+struct t {
+ void cheat( int& i ) { ++i; }
+};
+
+int main()
+{
+ void (t::*member)( const int& ) = &t::cheat; // { dg-error "" } conversion
+ void (*cheater)( const int* ) = &cheat; // { dg-error "" } converting
+ t t2;
+ const int i=1;
+ int j=1;
+ (t2.*member)( i );
+ (t2.*member)( j );
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv3.C b/gcc/testsuite/g++.old-deja/g++.other/conv3.C
new file mode 100644
index 000000000..383932d8c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv3.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+// submitted by David C Binderman <dcb@pncl.co.uk>
+
+typedef const int ci;
+typedef ci aci[ 10];
+aci var = { 2, 3, 5, 7, 11, 13 };
+
+void
+f()
+{
+ int * ip = var; // { dg-error "" } requires const_cast
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv4.C b/gcc/testsuite/g++.old-deja/g++.other/conv4.C
new file mode 100644
index 000000000..c195e41d6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv4.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// Testcase for proper hiding of base conversion ops.
+
+struct A
+{
+ operator const char *();
+};
+
+struct B : public A
+{
+ operator const char *() { return 0; }
+};
+
+int main( void )
+{
+ B b;
+ const char *p = b;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv5.C b/gcc/testsuite/g++.old-deja/g++.other/conv5.C
new file mode 100644
index 000000000..fb3dccf17
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv5.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+// Based on bug report by Thomas Kunert <kunert@physik.tu-dresden.de>
+
+
+int foo();
+const int (*bar)() = foo; // { dg-error "" } adding const
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv6.C b/gcc/testsuite/g++.old-deja/g++.other/conv6.C
new file mode 100644
index 000000000..7a299553e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv6.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// Test for composite pointer types, as defined in [expr.rel],
+// and common pointer to member types, as defined in [expr.eq].
+
+struct A { int i; };
+struct B : public A { };
+
+int main ()
+{
+ B b;
+
+ // The composite type is `A const *'
+ A* ap = &b;
+ const B* bp = &b;
+ if (ap != bp) // { dg-bogus "" } distinct types
+ return 1;
+
+ // The composite type is `B const *const *'
+ B *const * p = 0;
+ B const * * q = 0;
+ if (p != q) // { dg-bogus "" } distinct types
+ return 1;
+
+ // The common type is `int const B::*'
+ const int A::*apm = &A::i;
+ int B::*bpm = &A::i;
+ if (apm != bpm) // { dg-bogus "" } distinct types
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv7.C b/gcc/testsuite/g++.old-deja/g++.other/conv7.C
new file mode 100644
index 000000000..7042e147c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv7.C
@@ -0,0 +1,46 @@
+// { dg-do assemble }
+// { dg-options "-Wconversion" }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 May 2001 <nathan@codesourcery.com>
+
+// Bug 2726. We ICE'd trying to say something about possibly confusing
+// conversion overload resolution.
+
+class foo
+{
+};
+
+template<class T>
+class bar
+{
+public:
+ operator const T&() const ;
+ operator T&() ;
+
+};
+
+
+template<class T, class Ref, class NodePtr, class ListPtr>
+class iterator_template
+{
+public:
+ iterator_template();
+ Ref operator*() const;
+
+};
+
+struct IdlDeclarator
+{
+};
+
+typedef bar< IdlDeclarator > IdlDeclarator_bar;
+int
+yyparse()
+
+{
+
+ iterator_template<IdlDeclarator_bar,IdlDeclarator_bar&,foo*,foo*> declIter;
+ const IdlDeclarator& declarator = *declIter;
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv8.C b/gcc/testsuite/g++.old-deja/g++.other/conv8.C
new file mode 100644
index 000000000..205ad4382
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv8.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class bar
+{
+public:
+ bar();
+ virtual ~bar();
+ static void a();
+};
+
+class baz : public bar
+{
+};
+
+class foo : virtual public baz
+{
+public:
+ static void a();
+ void b();
+};
+
+typedef void (bar::*T)();
+T d;
+
+void foo::a()
+{
+ typedef void(foo::*t)();
+ t c = & foo::b;
+ d = (T) c; // { dg-error "pointer to member" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv9.C b/gcc/testsuite/g++.old-deja/g++.other/conv9.C
new file mode 100644
index 000000000..0fcf980be
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv9.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+
+struct
+Foo
+{
+public:
+ typedef void* (*copier_fn)(void const*);
+ void foo() const;
+ void bar(char const*, void const*) const;
+private:
+ struct
+ Bar
+ {
+ char const* key;
+ void const* item;
+ };
+};
+
+void
+Foo::foo() const
+{
+ Bar* cp = 0;
+ copier_fn copyfn = 0;
+
+ bar(cp->key, cp->item);
+ bar(cp->key, (copyfn) ? (*copyfn)(cp) : 0);
+ bar(cp->key, (copyfn) ? (*copyfn)(0) : 0);
+
+ bar(cp->key, (copyfn) ? (*copyfn)(0) : cp->item);
+ bar(cp->key, (copyfn) ? (*copyfn)(cp) : cp->item);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/copy1.C b/gcc/testsuite/g++.old-deja/g++.other/copy1.C
new file mode 100644
index 000000000..978599a80
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/copy1.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// Bug: expand_vec_init doesn't copy arrays of builtin types.
+
+struct B {
+ B() { }
+ B(const B&) { }
+};
+
+struct A
+{
+ B b;
+ int ar[5];
+};
+
+int main()
+{
+ A a;
+ for (int i = 0; i < 5; ++i)
+ a.ar[i] = i;
+
+ A a2 = a;
+
+ for (int i = 0; i < 5; ++i)
+ if (a2.ar[i] != a.ar[i])
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/copy2.C b/gcc/testsuite/g++.old-deja/g++.other/copy2.C
new file mode 100644
index 000000000..c3e96e103
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/copy2.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int i;
+
+struct B {
+ B () {}
+ B (B&) { i = 1; }
+ B (const B&) { i = 2; }
+};
+
+struct D : public B {
+ D () {}
+};
+
+int main ()
+{
+ D d;
+ D d2 (d);
+ if (i != 2)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/copy3.C b/gcc/testsuite/g++.old-deja/g++.other/copy3.C
new file mode 100644
index 000000000..3b74a905f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/copy3.C
@@ -0,0 +1,23 @@
+// { dg-do link }
+// Origin: ericp@mit.edu
+
+class bar {
+};
+
+class foo {
+ foo (const foo &f);
+
+public:
+
+ foo (bar x) {}
+ foo () {}
+
+ void test (const foo &f) {}
+};
+
+int main (void) {
+ foo f;
+ bar b;
+
+ f.test (b);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/covar1.C b/gcc/testsuite/g++.old-deja/g++.other/covar1.C
new file mode 100644
index 000000000..217f01714
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/covar1.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+struct A {
+ virtual A& f();
+};
+
+struct B: public A {
+ B& f();
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash1.C b/gcc/testsuite/g++.old-deja/g++.other/crash1.C
new file mode 100644
index 000000000..d62968919
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash1.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+class A
+{
+ enum B { ONE, TWO, THREE }; // { dg-error "" } private
+};
+
+class A::B; // { dg-error "" } A::B is not a class type, context
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash10.C b/gcc/testsuite/g++.old-deja/g++.other/crash10.C
new file mode 100644
index 000000000..d0534f06d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash10.C
@@ -0,0 +1,52 @@
+// { dg-do assemble }
+// Origin: Loring Holden <lsh@cs.brown.edu>
+
+template <class T>
+class REFptr {
+ public:
+ REFptr();
+ REFptr(T *pObj);
+ virtual ~REFptr();
+ operator T* () const;
+};
+
+class GEL;
+class GELsubc {
+ public :
+ virtual GEL *GELcast() const;
+};
+class GELptr : public REFptr<GEL>{
+ public :
+ GELptr(const GELptr &p);
+ GELptr(const GELsubc &p);
+};
+class GEL { };
+
+class GEOM;
+class GEOMptr : public REFptr<GEOM>, public GELsubc {
+ public:
+ GEOMptr() { }
+ GEOMptr(GEOM *g);
+};
+class GEOM : public GEL {
+ public:
+ GEOM(const GEOMptr &o);
+ GEOM();
+};
+
+class TEXT2D;
+class TEXT2Dptr : public REFptr<TEXT2D> {
+ public:
+ TEXT2Dptr();
+ TEXT2Dptr(TEXT2D *g);
+};
+class TEXT2D : public GEOM { };
+
+void testit(const GELptr g);
+
+void
+FPS()
+{
+ TEXT2Dptr fps_text;
+ testit(GEOMptr(&*fps_text));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash11.C b/gcc/testsuite/g++.old-deja/g++.other/crash11.C
new file mode 100644
index 000000000..16fd61042
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash11.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: Alfred Minarik <a8601248@unet.univie.ac.at>
+
+template <typename T>
+struct allocator
+{
+ typedef int size_type;
+};
+
+template <typename T>
+struct string
+{
+ typedef typename allocator<T>::size_type size_type;
+
+ static size_type size;
+
+ size_type
+ max_size() const { return size; }
+};
+
+template struct string <char>;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash12.C b/gcc/testsuite/g++.old-deja/g++.other/crash12.C
new file mode 100644
index 000000000..73bbb8bb6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash12.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: Alfred Minarik <a8601248@unet.univie.ac.at>
+
+template<typename T>
+struct S
+{
+ void f() {}
+};
+
+int main()
+{
+ S<int> s;
+ int len = 50;
+ char array[len];
+ s.f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash13.C b/gcc/testsuite/g++.old-deja/g++.other/crash13.C
new file mode 100644
index 000000000..03b25df89
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash13.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+struct Base_bitset {
+ unsigned M_w[2];
+ void M_do_right_shift();
+};
+
+
+void Base_bitset::M_do_right_shift ()
+{
+ unsigned n = 0;
+ M_w[0] = M_w[n + 1] ;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash14.C b/gcc/testsuite/g++.old-deja/g++.other/crash14.C
new file mode 100644
index 000000000..d97577d1d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash14.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+};
+
+struct T : public S
+{
+};
+
+struct U : public T
+{
+};
+
+void f (U);
+
+int main ()
+{
+ U u;
+ f (u);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash15.C b/gcc/testsuite/g++.old-deja/g++.other/crash15.C
new file mode 100644
index 000000000..c4af169a2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash15.C
@@ -0,0 +1,43 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// g++ crashed because we unsaved the TARGET_EXPR for the return value
+// for get_allocator without first expanding it, because it was part of the
+// cleanup for the temporary string.
+
+// Derived from libstdc++ v3 code.
+
+
+class AA {};
+
+void fee (const AA&);
+
+class basic_string
+{
+public:
+ basic_string(const char*);
+
+ ~basic_string()
+ { fee (this->get_allocator()); }
+
+ AA get_allocator();
+};
+
+class failure
+{
+public:
+ failure(const basic_string& __str);
+};
+
+class foo
+{
+public:
+ foo(int x)
+ {
+ throw failure ("");
+ }
+};
+
+void test05()
+{
+ foo ofs(0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash16.C b/gcc/testsuite/g++.old-deja/g++.other/crash16.C
new file mode 100644
index 000000000..22583260a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash16.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: scott snyder <snyder@fnal.gov>
+
+
+void _S_initialize();
+
+class locale
+{
+public:
+ locale() throw()
+ { _S_initialize (); }
+};
+
+void foo(const locale& __loc);
+
+void print (const int&)
+{
+ foo(locale());
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash17.C b/gcc/testsuite/g++.old-deja/g++.other/crash17.C
new file mode 100644
index 000000000..35195492f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash17.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Origin: Dima Volodin <dvv@dvv.org>
+
+class C {
+ static int const N (1000); // { dg-error "" } invalid declaration
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash19.C b/gcc/testsuite/g++.old-deja/g++.other/crash19.C
new file mode 100644
index 000000000..bafde81c5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash19.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+struct S {};
+
+struct X {};
+
+void f () {
+ typedef X Y;
+ S<Y> s;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash2.C b/gcc/testsuite/g++.old-deja/g++.other/crash2.C
new file mode 100644
index 000000000..3d62d04eb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash2.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+struct A {
+ int rep;
+ static const A a(0); // { dg-error "" } initialization
+ static const A b = 3; // { dg-error "" } initialization
+ static const A& c = 2; // { dg-error "" } initialization
+ A(int x) : rep(x) {}
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash20.C b/gcc/testsuite/g++.old-deja/g++.other/crash20.C
new file mode 100644
index 000000000..dd236e120
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash20.C
@@ -0,0 +1,38 @@
+// { dg-do assemble }
+
+#include <typeinfo>
+
+struct GcspFlags
+{
+ enum Enum
+ {
+ OffYes,
+ OffNo,
+ Root
+ };
+
+ static char const* name(Enum flag);
+
+ template<Enum GCSP_FLAG>
+ struct btmFlag
+ {
+ static Enum const f=OffNo;
+ };
+
+};
+
+template<>
+struct
+GcspFlags::btmFlag<GcspFlags::OffYes>
+{
+ static GcspFlags::Enum const f=GcspFlags::OffYes;
+};
+
+int
+main ()
+{
+ GcspFlags::btmFlag<GcspFlags::OffYes> f;
+ const std::type_info& ti = typeid (f);
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash21.C b/gcc/testsuite/g++.old-deja/g++.other/crash21.C
new file mode 100644
index 000000000..62ba7f946
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash21.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Origin: Gabriel Dos Reis <gdr@codesourcery.com>
+
+struct A {
+ virtual void f(int&) const;
+};
+
+struct B : public A {
+ int x;
+};
+
+void B::f(int& t) { // { dg-error "" } undeclared method
+ x = t;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash22.C b/gcc/testsuite/g++.old-deja/g++.other/crash22.C
new file mode 100644
index 000000000..0890aef4a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash22.C
@@ -0,0 +1,56 @@
+// { dg-do link }
+// { dg-options "-O2" }
+
+class foo
+{
+};
+
+typedef void *voidp;
+class vect : public foo
+{
+public:
+ voidp& a();
+ int b();
+};
+
+class bar
+{
+public:
+ bar *c(bool (*f)(bar *node), voidp g)
+ {
+ int i=0;
+ bool j;
+ while (i < d.b()){
+ j = (f == __null) || f((bar*)d.a());
+ if (j)
+ ((bar*)d.a())->c(f, g);
+ i++;
+ }
+ return this;
+ }
+ public:
+ vect d;
+ bar *e(foo *k);
+};
+
+bar *bar::e(foo *k)
+{
+ return c(__null, k);
+}
+
+voidp &vect::a()
+{
+ static voidp x;
+ return x;
+}
+
+int vect::b()
+{
+ static int x;
+ return x;
+}
+
+int main()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash23.C b/gcc/testsuite/g++.old-deja/g++.other/crash23.C
new file mode 100644
index 000000000..13249020f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash23.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// Origin: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+class T;
+inline void operator<(T&, T&) { } // { dg-error "" } previous definition
+inline void operator<(T&, T&) { } // { dg-error "" } duplicate definition
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash24.C b/gcc/testsuite/g++.old-deja/g++.other/crash24.C
new file mode 100644
index 000000000..b1fa01c9b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash24.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class foo {
+ public:
+ class __iterator;
+ friend class __iterator;
+ typedef __iterator const_iterator;
+ virtual ~foo() { }
+ __iterator begin(); // { dg-message "foo::begin|no known conversion for implicit" }
+};
+static void iteratorTest(const foo &x)
+{
+ foo::const_iterator i = x.begin(); // { dg-error "incomplete type" "incomplete type" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 14 }
+ // { dg-error "no matching" "no matching" { target *-*-* } 14 }
+ for (; i; ++i)
+ *i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash25.C b/gcc/testsuite/g++.old-deja/g++.other/crash25.C
new file mode 100644
index 000000000..5460e0388
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash25.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-fshow-column" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class X { // { dg-error "1:new types may not be defined in a return type" "new types" }
+// { dg-message "1:\\(perhaps a semicolon is missing after the definition of 'X'\\)" "note" { target *-*-* } 5 }
+public:
+ X();
+ virtual ~X();
+}
+
+X::x() // { dg-error "6:no 'X X::x\\(\\)' member function declared in class 'X'" }
+{
+}
+
+X::~x() // { dg-error "6:expected class-name before '\\(' token" }
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash26.C b/gcc/testsuite/g++.old-deja/g++.other/crash26.C
new file mode 100644
index 000000000..c9a12d0fb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash26.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class foo {
+public:
+ foo(int);
+};
+
+void bar(bool x)
+{
+ if(x)
+ foo *a = new foo(foo::not); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash27.C b/gcc/testsuite/g++.old-deja/g++.other/crash27.C
new file mode 100644
index 000000000..b02f3103b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash27.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+X(Y(long, Type, CLink)); break; default: break; } } } // { dg-error "" }
+
+struct A {
+ inline A ();
+};
+
+inline A::A ()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash28.C b/gcc/testsuite/g++.old-deja/g++.other/crash28.C
new file mode 100644
index 000000000..59f1e844e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash28.C
@@ -0,0 +1,35 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+namespace N
+{
+ class X;
+ template <class T>
+ class Y
+ {
+ public:
+ inline Y () {}
+ inline operator const Y<X> & () const
+ {
+ return *reinterpret_cast<const Y<X> *>(this);
+ }
+ };
+}
+class bar
+{
+public:
+ inline bar () {}
+ inline bar (const ::N::Y< ::N::X>& a);
+};
+
+class foo
+{
+ bool b;
+public:
+ foo();
+ void x () throw(bar);
+};
+void foo::x() throw(bar)
+{
+ if (!b) throw bar (static_cast<::N::X*>(this)); // { dg-error "lambda expressions|expected" } parse error
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash29.C b/gcc/testsuite/g++.old-deja/g++.other/crash29.C
new file mode 100644
index 000000000..cbcfcf5c8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash29.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class bar
+{
+public:
+ void foo ();
+ void baz ();
+};
+void bar::foo ()
+{
+ baz x(); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash3.C b/gcc/testsuite/g++.old-deja/g++.other/crash3.C
new file mode 100644
index 000000000..5a2182716
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash3.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-g -O2" }
+
+inline void f() {
+ struct S {};
+ S s;
+}
+
+void g()
+{
+ for (int i = 0; i < 2; ++i)
+ f();
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash30.C b/gcc/testsuite/g++.old-deja/g++.other/crash30.C
new file mode 100644
index 000000000..043d54fa4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash30.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+struct foo
+{
+ foo();
+ void x();
+};
+
+void foo::x() throw(bar) // { dg-error "" } parse error
+{
+}
+
+void bar()
+{
+ foo x;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash31.C b/gcc/testsuite/g++.old-deja/g++.other/crash31.C
new file mode 100644
index 000000000..b6d19527a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash31.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+namespace bar
+{
+struct foo
+{
+ foo();
+}; // { dg-error "expected" }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash32.C b/gcc/testsuite/g++.old-deja/g++.other/crash32.C
new file mode 100644
index 000000000..b9c4cf98c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash32.C
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+struct foo
+{
+ enum e
+ {
+ not // { dg-error "" }
+ }; // { dg-bogus "" }
+ ~foo(); // { dg-bogus "" "" { xfail *-*-* } }
+ void x (foo *&a, bool b = (unsigned char)0);
+}; // { dg-bogus "" "" { xfail *-*-* } }
+
+namespace N
+{
+ struct bar;
+
+ template<class T>
+ struct baz
+ {
+ baz(T *p);
+ };
+
+ typedef baz<bar> c;
+}
+
+{
+ int a;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash33.C b/gcc/testsuite/g++.old-deja/g++.other/crash33.C
new file mode 100644
index 000000000..1d2227aa6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash33.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+template <class T>
+inline const T& bar(const T& a, const T& b)
+{
+ return a < b ? b : a;
+}
+
+int foo(void)
+{
+ return bar(sizeof(int), sizeof(long));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash34.C b/gcc/testsuite/g++.old-deja/g++.other/crash34.C
new file mode 100644
index 000000000..4e3c30a9a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash34.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+
+class v
+{
+ double x, y;
+public:
+ v();
+};
+
+class w : public v {
+public :
+ static const w X;
+ w();
+};
+
+void bar(w x);
+
+void foo()
+{
+ bar(w::X);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash35.C b/gcc/testsuite/g++.old-deja/g++.other/crash35.C
new file mode 100644
index 000000000..bb52ff779
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash35.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+void foo()
+{
+ if [ // { dg-error "" } parse error
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash36.C b/gcc/testsuite/g++.old-deja/g++.other/crash36.C
new file mode 100644
index 000000000..4002ce3af
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash36.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Nov 2000 <nathan@codesourcery.com>
+
+// Bug 573. We ICE'd verifying operator new and operator delete conformed
+// to the standard's expectation.
+
+void *operator new (__SIZE_TYPE__); // ok
+void operator new (__SIZE_TYPE__); // { dg-error "" } must return void *
+void *operator new (); // { dg-error "" } must take size_t
+void *operator new (char); // { dg-error "" } must take size_t
+void *operator new (__SIZE_TYPE__, ...) throw(); // ok
+
+void operator delete (void *) throw (); // ok
+int operator delete (void *) throw (); // { dg-error "" } must return void
+void operator delete () throw (); // { dg-error "" } must take void *
+void operator delete (int *) throw (); // { dg-error "" } must take void *
+void operator delete (void *, __SIZE_TYPE__) throw (); // ok
+
+void operator delete (...) throw (); // { dg-error "" } must take void *
+void operator delete (void *, ...) throw (); // ok
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash37.C b/gcc/testsuite/g++.old-deja/g++.other/crash37.C
new file mode 100644
index 000000000..900fd72cd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash37.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 23 Nov 2000 <nathan@codesourcery.com>
+
+// bug 706. We iced when meeting a decl with type error-mark-node
+
+class bifstream;
+
+
+int main()
+{
+ bifstream bifs; // { dg-error "" } incomplete type
+ if (!bifs)
+ {
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash38.C b/gcc/testsuite/g++.old-deja/g++.other/crash38.C
new file mode 100644
index 000000000..d07115e51
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash38.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Nov 2000 <nathan@codesourcery.com>
+
+// Bug 611. We ICEd when calling a member function returning an incomplete
+// type by value.
+
+struct X; // { dg-error "" } forward ref
+
+struct Y
+{
+ X foo ();
+};
+
+void baz (Y *p)
+{
+ p->foo (); // { dg-error "" } incomplete
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash39.C b/gcc/testsuite/g++.old-deja/g++.other/crash39.C
new file mode 100644
index 000000000..a7af2881b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash39.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Jan 2001 <nathan@codesourcery.com>
+
+// Bug 595. We failed to clear out some things after seeing a duplicate
+// struct definition. That caused us to become inconsistent.
+
+struct X
+{
+ ~X ();
+};
+struct S { X a; }; // { dg-error "" } previous defn
+struct S { X a; }; // { dg-error "" } redefinition
+
+void c1(S s)
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash4.C b/gcc/testsuite/g++.old-deja/g++.other/crash4.C
new file mode 100644
index 000000000..929847196
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash4.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+struct T {
+ struct S __attribute__ ((packed)) { // { dg-error "" } parse error
+ int i;
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash40.C b/gcc/testsuite/g++.old-deja/g++.other/crash40.C
new file mode 100644
index 000000000..4eb0233b3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash40.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 April 2001 <nathan@codesourcery.com>
+// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+// Bug 1917. We were considering thunks to clones to be clones. and
+// hence getting confused.
+
+struct A { virtual ~A(); };
+struct B { virtual ~B(); };
+
+struct C: public A,B {};
+
+template <class TYPE>
+inline TYPE
+sqr(const TYPE& x) {
+ return 1;
+}
+int f(const int t) { return sqr(t); }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash41.C b/gcc/testsuite/g++.old-deja/g++.other/crash41.C
new file mode 100644
index 000000000..77f152b49
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash41.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com>
+
+// Bug 2744. We ICE'd on strange characters
+
+@ // { dg-error "" } parse error
+int a; #// { dg-error "" } parse error
+## // { dg-error "" } parse error
+$ // { dg-error "" } parse error
+£ // { dg-error "" } parse error
+` // { dg-error "" } parse error
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash42.C b/gcc/testsuite/g++.old-deja/g++.other/crash42.C
new file mode 100644
index 000000000..a6d9e6149
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash42.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// { dg-options "-g" }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Jul 2001 <nathan@codesourcery.com>
+
+// Bug 3152. Using a typedef to declare a function used an unset
+// global variable, last_function_parms.
+
+struct actor
+{
+ typedef bool (operation)();
+
+ operation a;
+ operation b;
+ operation c;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash5.C b/gcc/testsuite/g++.old-deja/g++.other/crash5.C
new file mode 100644
index 000000000..070410296
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash5.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+class TecMesh {};
+
+extern TecMesh& m;
+
+struct X {
+ X(TecMesh&);
+};
+
+struct D {
+ D();
+ TecMesh& Mesh;
+};
+
+
+D::D ()
+ : Mesh(m)
+{
+ X x(D::Mesh);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash6.C b/gcc/testsuite/g++.old-deja/g++.other/crash6.C
new file mode 100644
index 000000000..6c1b7f69e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash6.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+
+struct E
+{
+ int f(int);
+};
+
+void ha()
+{
+ enum {X = 0};
+
+ int A, C;
+
+ E vList[10];
+
+ A = (C + 1) % 3;
+ vList[1].f(A);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash60.C b/gcc/testsuite/g++.old-deja/g++.other/crash60.C
new file mode 100644
index 000000000..06f31272b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash60.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+void foo ()
+{
+ int e;
+ e := e; // { dg-error "" } parse error
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash7.C b/gcc/testsuite/g++.old-deja/g++.other/crash7.C
new file mode 100644
index 000000000..d579df0bf
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash7.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+void f()
+{
+ union {
+ private:
+ int i; // { dg-error "" } private
+ } u;
+
+ u.i = 3; // { dg-error "" } within this context
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash8.C b/gcc/testsuite/g++.old-deja/g++.other/crash8.C
new file mode 100644
index 000000000..5e35793e8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash8.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+int main()
+{
+ void f();
+ class A {
+ friend void f();
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash9.C b/gcc/testsuite/g++.old-deja/g++.other/crash9.C
new file mode 100644
index 000000000..a0d487320
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash9.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+struct A { };
+struct B : public A
+{
+ int A;
+};
+struct C : public B { };
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ctor1-aux.cc b/gcc/testsuite/g++.old-deja/g++.other/ctor1-aux.cc
new file mode 100644
index 000000000..9990ca293
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ctor1-aux.cc
@@ -0,0 +1,12 @@
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+struct S {
+ template <class U>
+ S (U);
+};
+
+int main ()
+{
+ S<int> (3.0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ctor1.C b/gcc/testsuite/g++.old-deja/g++.other/ctor1.C
new file mode 100644
index 000000000..e813d20b1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ctor1.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+// { dg-additional-sources " ctor1-aux.cc" }
+
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+struct S {
+ template <class U>
+ S (U);
+};
+
+template <class T>
+template <class U>
+S<T>::S (U) {}
+
+template S<int>::S (double);
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cvqual1.C b/gcc/testsuite/g++.old-deja/g++.other/cvqual1.C
new file mode 100644
index 000000000..e00590a26
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cvqual1.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int i = 3;
+void *pv=&i;
+const void* pcv=&i;
+int main()
+{
+ pcv = 0 ? pv : pcv;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cvt1.C b/gcc/testsuite/g++.old-deja/g++.other/cvt1.C
new file mode 100644
index 000000000..aa030827a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cvt1.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+
+typedef int Array_T[2];
+
+struct S1 {
+ S1(const Array_T&);
+};
+
+struct S2 {
+ S1 g();
+ Array_T a;
+};
+
+S1 S2::g()
+{
+ return S1(a);
+}
+
+void h()
+{
+ S2 s2;
+ s2.g();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dcast1.C b/gcc/testsuite/g++.old-deja/g++.other/dcast1.C
new file mode 100644
index 000000000..830def8cb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dcast1.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+class C {
+public:
+ virtual void f();
+};
+
+extern volatile C* cp;
+extern volatile C& cr;
+
+void f ()
+{
+ dynamic_cast<void*>(cp); // { dg-error "" } cannot dynamic_cast
+ dynamic_cast<C&>(cr); // { dg-error "" } cannot dynamic_cast
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dcast2.C b/gcc/testsuite/g++.old-deja/g++.other/dcast2.C
new file mode 100644
index 000000000..0f08e066e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dcast2.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+// Based on a testcase by Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
+
+struct B {
+ virtual ~B();
+};
+
+struct D : public B {
+};
+
+void foo() {
+ B x;
+ dynamic_cast<D*>(&x); // { dg-warning "" } will never succeed
+ B* p = &x;
+ dynamic_cast<D*>(p);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug1.C b/gcc/testsuite/g++.old-deja/g++.other/debug1.C
new file mode 100644
index 000000000..58fd2ca19
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug1.C
@@ -0,0 +1,48 @@
+// { dg-do assemble }
+// { dg-options "-g" }
+
+typedef unsigned int size_t;
+
+
+struct dummy { };
+
+struct arrrrrgh { };
+
+
+template<class Par,class Rand = arrrrrgh>
+struct whyyyyyyy { };
+
+
+
+
+template<class T, class S =dummy>
+struct grrrrrrrr { };
+
+
+template<class Par, class Par2 =Par, class Rand =arrrrrgh>
+class no_future
+{
+public:
+
+
+ template<class S>
+ no_future(const grrrrrrrr<whyyyyyyy<Par,Rand>*,S>& man ) { }
+
+ ~no_future( ) { }
+
+private:
+
+
+ no_future(const no_future&);
+ no_future& operator=(const no_future&);
+};
+
+
+int main( )
+{
+ grrrrrrrr<whyyyyyyy<double>*> man;
+
+ no_future<double> here(man);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug2.C b/gcc/testsuite/g++.old-deja/g++.other/debug2.C
new file mode 100644
index 000000000..f5f0a4f2e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug2.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// { dg-options "-funroll-loops -O2 -g" }
+
+inline void f()
+{
+ typedef int T;
+}
+
+inline void g()
+{
+ typedef double U;
+}
+
+int n;
+
+struct B
+{
+ ~B() {
+ for (int i = 0; i < n; ++i)
+ g();
+ }
+};
+
+struct D : public B {
+ ~D() {
+ for (int j = 0; j < n; ++j)
+ f();
+ }
+};
+
+D d;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug3.C b/gcc/testsuite/g++.old-deja/g++.other/debug3.C
new file mode 100644
index 000000000..1b5507b16
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug3.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ ~S();
+};
+
+inline void f()
+{
+ static S s;
+}
+
+typedef void (*fn_t)();
+
+fn_t g()
+{
+ return &f;
+}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug4.C b/gcc/testsuite/g++.old-deja/g++.other/debug4.C
new file mode 100644
index 000000000..e6c640792
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug4.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// { dg-options "-g" }
+
+typedef volatile struct {
+ int i;
+} mutex_t;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug5.C b/gcc/testsuite/g++.old-deja/g++.other/debug5.C
new file mode 100644
index 000000000..706eabec5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug5.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "-g" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ ~S ();
+};
+
+void f ()
+{
+ t:
+ S s3;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug6.C b/gcc/testsuite/g++.old-deja/g++.other/debug6.C
new file mode 100644
index 000000000..a4d088413
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug6.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// { dg-options "-g -O2" }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
+
+// This causes assember relocation errors
+
+struct X
+{
+ virtual ~X () {}
+};
+
+struct Y
+{
+ Y (){};
+};
+
+void foo ()
+{
+ X *x = new X;
+ x->~X ();
+ Y ys[2];
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug7.C b/gcc/testsuite/g++.old-deja/g++.other/debug7.C
new file mode 100644
index 000000000..f486de1ab
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug7.C
@@ -0,0 +1,11 @@
+// { dg-do link }
+// { dg-options "-g -O2" }
+// Origin: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
+
+namespace std {
+ const int __stl_chunk_size = 7;
+}
+
+int main ()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug8.C b/gcc/testsuite/g++.old-deja/g++.other/debug8.C
new file mode 100644
index 000000000..d50aec487
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug8.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// { dg-options "-g" }
+
+struct X {
+ const int x[4];
+};
+
+struct A {
+ A();
+ A(const A&);
+};
+
+struct B {
+ A a;
+ int b[4];
+};
+
+struct C {
+ A a;
+ C() { B b=B(); };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug9.C b/gcc/testsuite/g++.old-deja/g++.other/debug9.C
new file mode 100644
index 000000000..2ddc927d8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug9.C
@@ -0,0 +1,42 @@
+// { dg-do assemble }
+// { dg-options "-g" }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Jeffrey D. Oldham 2001 May 17 <oldham@codesourcery.com>.
+
+// This illustrates that debugging information for CONCAT RTL's
+// supports only COMPLEX_TYPE types, not other types.
+
+namespace std {
+ template<typename _Tp> class complex;
+
+ template<> class complex<double>
+ {
+ public:
+ complex(double =0.0, double =0.0);
+
+ private:
+ typedef __complex__ double _ComplexT;
+ _ComplexT _M_value;
+ };
+
+ inline
+ complex<double>::complex(double __r, double __i)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = __i;
+ }
+}
+
+template <int Dim, class T>
+class Engine
+{
+public:
+ Engine (T val = T()) {}
+};
+
+int main()
+{
+ Engine<1, std::complex<double> > e;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl1.C b/gcc/testsuite/g++.old-deja/g++.other/decl1.C
new file mode 100644
index 000000000..07bcc9145
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl1.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// Based on a test case by Phil Blecker <tmwg@inxservices.com>
+
+
+int foo(int);
+int bar() {
+ int baz(int(foo(0)));
+ int foo = baz;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl2.C b/gcc/testsuite/g++.old-deja/g++.other/decl2.C
new file mode 100644
index 000000000..a466a207a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl2.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// Based on a testcase by Maciej Radziejewski <maciejr@iws.uni-stuttgart.de>
+
+int i(0)(1); // { dg-error "" } multiple initialization
+int j(2) = 3; // { dg-error "" } multiple initialization
+int k(4)(5)(6); // { dg-error "" } multiple initialization
+int m, n(7)(8); // { dg-error "" } multiple initialization
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl3.C b/gcc/testsuite/g++.old-deja/g++.other/decl3.C
new file mode 100644
index 000000000..bdcfcb02c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl3.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+// Origin: Adapted by Nathan Sidwell 29 Apr 1999 <nathan@acm.org>
+// from a test case submitted by Corey Kosak <kosak@cs.cmu.edu>
+// http://gcc.gnu.org/ml/gcc-bugs/1999-04n/msg00505.html
+
+// We should not allow arrays of abstract type. [class.abstract/2]
+
+struct cow_t { // { dg-message "pure" }
+ virtual void f()=0; // { dg-message "note" }
+};
+
+
+int main()
+{
+ cow_t cow[2]; // { dg-error "invalid abstract type" }
+ cow[0].f();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl4.C b/gcc/testsuite/g++.old-deja/g++.other/decl4.C
new file mode 100644
index 000000000..11196022c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl4.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+
+// Reported by Harri Porten <porten@tu-harburg.de>
+// Simplified for testsuite by Alexandre Oliva
+
+struct foo { operator long double(); };
+int bar(int __opr);
+int bar(int __ope);
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl5.C b/gcc/testsuite/g++.old-deja/g++.other/decl5.C
new file mode 100644
index 000000000..d13f7b1d0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl5.C
@@ -0,0 +1,79 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Apr 1999 <nathan@acm.org>
+// derived from a bug report by <rch@larissa.sd.bi.ruhr-uni-bochum.de>
+// http://gcc.gnu.org/ml/gcc-bugs/1999-04n/msg00631.html
+// the code is wrong, but we fell over badly
+
+
+struct A {
+ int A::fn(); // { dg-error "extra qualification" }
+ int A::m; // { dg-error "extra qualification" }
+ struct e;
+ struct A::e {int i;}; // { dg-error "extra qualification" "qual" }
+ // { dg-error "anonymous struct" "anon" { target *-*-* } 14 }
+ struct A::expand { // { dg-error "qualified name" }
+ int m;
+ };
+ struct Z;
+ expand me; // { dg-error "'expand' does not name a type" }
+ void foo(struct A::e);
+ void foo(struct A::z); // { dg-error "does not name a type" }
+};
+
+struct Q;
+struct B {
+ struct A::fink { // { dg-error "does not name a class before" }
+ int m;
+ };
+ struct A::Z { // { dg-error "does not enclose" } A::Z not a member of B
+ int m;
+ };
+ int m;
+ int n;
+ struct ::Q { // { dg-error "global qual" } ::Q not a member of B
+ int m;
+ };
+ int A::fn() { // { dg-error "cannot define member" } A::fn not a member of B
+ return 0;
+ }
+ void fn(struct ::Q &);
+ void foo(struct A::y); // { dg-error "does not name a type" } no such member
+};
+
+struct ::C { // { dg-error "invalid before" } extra qualification
+ int i;
+};
+
+namespace N {
+ int fn();
+ struct F;
+}
+
+namespace NMS
+{
+ void NMS::fn(); // { dg-error "explicit qual" }
+ int NMS::i; // { dg-error "explicit qual" }
+ struct NMS::D { // { dg-error "does not name a class" }
+ int i;
+ };
+ struct N::E { // { dg-error "does not name a class" } no such type
+ int i;
+ };
+ struct ::F { // { dg-error "global qual" } no such type
+ int i;
+ };
+ int N::fn() { // { dg-error "namespace" } N::fn not a member of NMS
+ return 0;
+ }
+ struct N::F { // { dg-error "namespace" } N::F not a member of NMS
+ int i;
+ };
+}
+
+NMS::D thing; // { dg-error "'D' in namespace 'NMS' does not name a type" }
+void NMS::fn()
+{
+ i = 3;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl6.C b/gcc/testsuite/g++.old-deja/g++.other/decl6.C
new file mode 100644
index 000000000..40247b81e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl6.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+//
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Sep 1999 <nathan@acm.org>
+
+int j();
+struct B {};
+struct A
+{
+ friend explicit int j(); // { dg-error "" } only ctor decls can be explicit
+ friend explicit B::B (); // { dg-error "" } only ctor decls can be explicit
+ int f(const); // { dg-error "" } ansi forbids no type
+ const k; // { dg-error "" } ansi forbids no type
+ mutable friend int j1 (); // { dg-error "" } non-member cannot be mutable
+ mutable typedef int d; // { dg-error "" } non-object cannot be mutable
+ mutable int fn (); // { dg-error "" } non-object cannot be mutable
+ void fn (mutable int); // { dg-error "" } non-member cannot be mutable
+ mutable static int s; // { dg-error "" } static cannot be mutable
+ mutable const int s1; // { dg-error "" } const cannot be mutable
+ mutable const int *s2; // ok
+ mutable int *const s3; // { dg-error "" } const cannot be mutable
+ explicit A (); // ok
+};
+mutable int g; // { dg-error "" } non-member cannot be mutable
+explicit A::A () {} // { dg-error "" } only ctor decls can be explicit
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl7.C b/gcc/testsuite/g++.old-deja/g++.other/decl7.C
new file mode 100644
index 000000000..cc9e3a983
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl7.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ void* sp;
+};
+
+void* f ()
+{
+ struct S s = { &s.sp };
+ return s.sp;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl8.C b/gcc/testsuite/g++.old-deja/g++.other/decl8.C
new file mode 100644
index 000000000..705fc6c5d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl8.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Sergei Organov <osv@javad.ru>
+
+void foo(void)
+{
+ extern int i; // { dg-error "" } previous declaration
+ extern double i; // { dg-error "" } conflicting type
+ extern int j;
+ extern int j;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl9.C b/gcc/testsuite/g++.old-deja/g++.other/decl9.C
new file mode 100644
index 000000000..9be187add
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl9.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Build don't link
+// Origin: batali@cogsci.ucsd.edu
+// Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
+
+typedef struct { } S; // OK
+typedef struct { }; // { dg-error "" } Missing type-name
+
+typedef union { } U; // OK
+typedef union { }; // { dg-error "" } Missing type-name
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg1.C b/gcc/testsuite/g++.old-deja/g++.other/defarg1.C
new file mode 100644
index 000000000..773336ca0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg1.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+
+int f (int x)
+{
+ extern void g (int i = f (x)); // { dg-error "" } default argument uses local
+
+ g();
+
+ return 0;
+}
+
+int f (void);
+
+int h1 (int (*)(int) = f);
+int h2 (int (*)(double) = f); // { dg-error "" } no matching f
+
+template <class T>
+int j (T t)
+{
+ extern void k (int i = j (t)); // { dg-error "" } default argument uses local
+
+ k ();
+
+ return 0;
+}
+
+template int j (double);
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg2.C b/gcc/testsuite/g++.old-deja/g++.other/defarg2.C
new file mode 100644
index 000000000..cc03cebc1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg2.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+// Test that default args don't mess up pmf type comparisons.
+// Contributed by Jason Merrill <jason@cygnus.com>.
+
+struct A {
+ void f (int = 0) { }
+};
+
+int
+main ()
+{
+ void (A::*p)(int) = 0;
+ p = &A::f;
+ if (p != &A::f)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg3.C b/gcc/testsuite/g++.old-deja/g++.other/defarg3.C
new file mode 100644
index 000000000..34709613c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg3.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int* hp;
+int* jp;
+
+void f (int *ip, int kp = hp - jp)
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg4.C b/gcc/testsuite/g++.old-deja/g++.other/defarg4.C
new file mode 100644
index 000000000..ace3ee220
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg4.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+// Origin: scott snyder <snyder@fnal.gov>
+
+class complex
+{
+public:
+ complex();
+};
+
+struct MLC33
+{
+ MLC33( const complex& = complex() );
+};
+
+void EmptyClone()
+{
+ MLC33();
+}
+
+void makeM33()
+{
+ MLC33();
+}
+
+void Clone()
+{
+ MLC33();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg5.C b/gcc/testsuite/g++.old-deja/g++.other/defarg5.C
new file mode 100644
index 000000000..9b294766f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg5.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// Bug: the SAVE_EXPR in the new expression remembers that it's in g(),
+// causing the compiler to crash in h().
+
+
+struct A {
+ A ();
+};
+
+void f (A* = new A);
+
+void g ()
+{
+ f ();
+}
+
+void h ()
+{
+ f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg6.C b/gcc/testsuite/g++.old-deja/g++.other/defarg6.C
new file mode 100644
index 000000000..fabf01980
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg6.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+#include <vector>
+#include <fstream>
+
+class STACK {
+public:
+ std::vector<int> data;
+
+ STACK() : data()
+ { }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg7.C b/gcc/testsuite/g++.old-deja/g++.other/defarg7.C
new file mode 100644
index 000000000..244b55ed5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg7.C
@@ -0,0 +1,44 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Jan 2001 <nathan@codesourcery.com>
+
+// As of G++ 3.4, we no longer attempt to detect dependencies; the
+// standard does not require that we do.
+
+// Bug 1038. Default args on class members can produce circular dependencies.
+// Make sure we spot them, and don't depend on a particular ordering.
+
+struct A
+{
+ static int Foo (int = Baz ()); // { dg-error "" }
+ static int Baz (int = Foo ());
+};
+
+struct Test
+{
+ Test (void * = 0);
+ void set (const Test &arg = Test ());
+};
+
+struct B
+{
+ static int Bar (int = Foo (1));
+ static int Foo (int = Baz ()); // { dg-error "" }
+ static int Baz (int = Foo (1));
+};
+
+int main ()
+{
+ Test t;
+ t.set ();
+ t.set (t);
+ B::Bar ();
+ B::Bar (1);
+ B::Baz ();
+ B::Baz (1);
+ B::Foo ();
+ B::Foo (1);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg8.C b/gcc/testsuite/g++.old-deja/g++.other/defarg8.C
new file mode 100644
index 000000000..359843186
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg8.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// { dg-options "-pedantic-errors -ansi -w" }
+
+// Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Jan 2001 <nathan@codesourcery.com>
+
+// As of G++ 3.4, we no longer attempt to detect dependencies; the
+// standard does not require that we do.
+
+// Bug 1038. Default args on class members can produce circular dependencies.
+// Make sure we spot them, and don't depend on a particular ordering.
+
+struct AA
+{
+ static int Foo (int = Baz ()); // { dg-error "" } not yet been parsed
+ static int Baz (int = Foo ());
+};
+
+int main ()
+{
+ AA::Foo ();
+ AA::Foo (1);
+ AA::Baz ();
+ AA::Baz (1);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg9.C b/gcc/testsuite/g++.old-deja/g++.other/defarg9.C
new file mode 100644
index 000000000..440f3a270
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg9.C
@@ -0,0 +1,52 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 April 2001 <nathan@codesourcery.com>
+
+// Bug 2608. A default parameter introduced in the definition of a
+// ctor never made it into the clones, leading to later overload
+// resolution failures. This is related to bug 2356.
+
+struct A
+{
+ A (int, int);
+};
+
+A::A (int d, int = 0)
+{
+ if (d)
+ {
+ A a (0);
+ }
+}
+
+void get_width ()
+{
+ A a (1);
+}
+
+struct B : A
+{
+ B ();
+};
+B::B ()
+ :A (1)
+{
+}
+
+struct C : virtual A
+{
+ C (int, int);
+};
+C::C (int, int = 0)
+ :A (1)
+{
+}
+struct D: C
+{
+ D ();
+};
+D::D ()
+ :A (0), C (0)
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete1.C b/gcc/testsuite/g++.old-deja/g++.other/delete1.C
new file mode 100644
index 000000000..d8c86a7f5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete1.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+struct cl_heap_ring{
+ void operator delete (void* ptr) { }
+ cl_heap_ring ()
+ { }
+};
+
+struct cl_heap_null_ring : public cl_heap_ring {
+ void operator delete (void* ptr) { }
+};
+
+void f()
+{
+ new cl_heap_null_ring();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete2.C b/gcc/testsuite/g++.old-deja/g++.other/delete2.C
new file mode 100644
index 000000000..1d0554f2d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete2.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+struct foo {
+ operator char*() const;
+};
+
+void bar(foo a) {
+ delete a; // should be accepted
+ delete[] a; // should be accepted
+ char b[1];
+ delete b; // { dg-warning "deleting array" } expecting pointer type
+ delete[] b; // { dg-warning "deleting array" } expecting pointer type
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete3.C b/gcc/testsuite/g++.old-deja/g++.other/delete3.C
new file mode 100644
index 000000000..9c6c58e96
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete3.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+#include <new>
+
+int i;
+
+extern "C" int printf (const char *, ...);
+
+template <class T, class U>
+struct map {
+ ~map ();
+};
+
+template <class T, class U>
+map<T, U>::~map ()
+{}
+
+struct SomeClass { };
+
+void* operator new(std::size_t numBytes, SomeClass&, const std::nothrow_t&) throw()
+{
+ return operator new(numBytes, std::nothrow);
+}
+
+void operator delete(void* pMemory, SomeClass&, const std::nothrow_t&) throw()
+{
+ i = 7;
+ return operator delete(pMemory);
+}
+
+int
+main()
+{
+ map< int, int>* pMap = new map< int, int>;
+
+ delete pMap;
+
+ if (i == 7)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete4.C b/gcc/testsuite/g++.old-deja/g++.other/delete4.C
new file mode 100644
index 000000000..0971eb982
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete4.C
@@ -0,0 +1,53 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Apr 1999 <nathan@acm.org>
+
+// delete (void *)e and delete[] (void *)e result in undefined behavior
+// [expr.delete/3]. Check we warn about them
+// operator new functions can only return NULL, if their exceptions
+// specification is `throw()'. All other cases must return a non-null pointer
+// [expr.new/13].
+
+typedef __SIZE_TYPE__ size_t;
+
+void *operator new(size_t)
+{
+ return 0; // { dg-warning "NULL" } cannot return NULL
+}
+void *operator new[](size_t)
+{
+ return 0; // { dg-warning "NULL" } cannot return NULL
+}
+
+struct X
+{
+ void *operator new(size_t)
+ {
+ return 0; // { dg-warning "NULL" } cannot return NULL
+ }
+ void *operator new[](size_t)
+ {
+ return 0; // { dg-warning "NULL" } cannot return NULL
+ }
+};
+
+struct Y
+{
+ void *operator new(size_t) throw()
+ {
+ return 0; // ok
+ }
+ void *operator new[](size_t) throw()
+ {
+ return 0; // ok
+ }
+};
+
+void fn(double *d, void *v)
+{
+ delete d; // ok
+ delete v; // { dg-warning "" } deleting void
+ delete[] d; // ok
+ delete[] v; // { dg-warning "" } deleting void
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete5.C b/gcc/testsuite/g++.old-deja/g++.other/delete5.C
new file mode 100644
index 000000000..c447b73e5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete5.C
@@ -0,0 +1,42 @@
+// { dg-do assemble }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Apr 1999 <nathan@acm.org>
+
+typedef __SIZE_TYPE__ size_t;
+
+struct X
+{
+ int i;
+
+ X():i(){}
+ void *operator new(size_t)
+ {
+ return 0; // { dg-warning "" } cannot return NULL
+ }
+ void *operator new[](size_t)
+ {
+ return 0; // { dg-warning "" } cannot return NULL
+ }
+};
+
+struct Y
+{
+ int i;
+
+ Y():i(){}
+ void *operator new(size_t) throw()
+ {
+ return 0; // ok
+ }
+ void *operator new[](size_t) throw()
+ {
+ return 0; // ok
+ }
+};
+
+int main()
+{
+ Y *yp = new Y;
+
+ return yp != 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete6.C b/gcc/testsuite/g++.old-deja/g++.other/delete6.C
new file mode 100644
index 000000000..733a6e22c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete6.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// Origin: Alexander Schiemann (aschiem@count.math.uni-sb.de)
+
+typedef __SIZE_TYPE__ size_t;
+
+int i;
+
+struct B{};
+
+struct A{
+
+ static void* operator new(size_t)
+ {return &i;}
+
+ inline static void operator delete(void*p);
+
+ static void operator delete(void*, const B&){}
+
+};
+
+
+inline void A::operator delete(void*p)
+{A::operator delete(p,B());}
+
+
+int main()
+{A *ap=new A;
+delete ap;}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete7.C b/gcc/testsuite/g++.old-deja/g++.other/delete7.C
new file mode 100644
index 000000000..e55af6a8d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete7.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// Test that we call a class-specific vector op delete.
+
+#include <new>
+
+int r = 1;
+
+struct A
+{
+ void operator delete[](void *p) { r = 0; ::operator delete (p); }
+};
+
+int main ()
+{
+ A (*p)[2] = new A[2][2];
+ delete [] p;
+ return r;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete8.C b/gcc/testsuite/g++.old-deja/g++.other/delete8.C
new file mode 100644
index 000000000..ea44445b0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete8.C
@@ -0,0 +1,40 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+#include <stdlib.h>
+
+struct S {
+ ~S ();
+};
+
+bool flag;
+S* s1;
+S* s2;
+
+void* operator new (size_t s)
+{
+ return malloc (s);
+}
+
+void operator delete (void* p)
+{
+ if (flag && p != s2)
+ abort ();
+}
+
+S::~S () {
+ if (this != s2)
+ abort ();
+ s1 = 0;
+}
+
+int main () {
+ s2 = new S;
+ s1 = s2;
+ // Turn on the check in `operator delete'.
+ flag = true;
+ delete s1;
+ // Turn it off again so that normal shutdown code works.
+ flag = false;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/deref1.C b/gcc/testsuite/g++.old-deja/g++.other/deref1.C
new file mode 100644
index 000000000..1b32c8c56
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/deref1.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Sep 1999 <nathan@acm.org>
+
+// [expr.unary.op]/1 says you can dereference all pointers except for pointers
+// to cv void.
+
+void fn (void *vp, volatile void *vvp)
+{
+ *vp; // { dg-error "" } not a pointer to object
+ *vvp; // { dg-error "" } not a pointer to object
+ &*vp; // { dg-error "" } not a pointer to object
+ &*vvp; // { dg-error "" } not a pointer to object
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dll-1.C b/gcc/testsuite/g++.old-deja/g++.other/dll-1.C
new file mode 100644
index 000000000..8468c1b91
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dll-1.C
@@ -0,0 +1,9 @@
+// { dg-do assemble { target arm-*-*pe } }
+// { dg-options "-mno-nop-fun-dllimport" }
+// declspec test #1
+// set compiler_result "__imp_imp.*\.section${spaces}.drectve\n\[^\n\]*-export:exp"
+// set not_compiler_result "__imp_exp"
+
+__declspec (dllimport) void imp ();
+
+__declspec (dllexport) void exp () { imp (); }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dll-2.C b/gcc/testsuite/g++.old-deja/g++.other/dll-2.C
new file mode 100644
index 000000000..d3fb6a7ba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dll-2.C
@@ -0,0 +1,18 @@
+// { dg-do assemble { target arm-*-*pe } }
+// Microsoft's MSVC 2.0 allows dllimport followed by dllexport for variables,
+// but does not allow dllexport followed by dllimport.
+//
+// Switching between dll{export,import} works for functions.
+// We test for that too (by ensuring no error is produced).
+
+__declspec (dllimport) int foo1 ();
+__declspec (dllexport) int foo1 ();
+
+__declspec (dllexport) int foo2 ();
+__declspec (dllimport) int foo2 ();
+
+__declspec (dllimport) int bar1;
+__declspec (dllexport) int bar1;
+
+__declspec (dllexport) int bar2; // { dg-error "" } previously declared
+__declspec (dllimport) int bar2; // { dg-error "" } redefinition
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dll-3.C b/gcc/testsuite/g++.old-deja/g++.other/dll-3.C
new file mode 100644
index 000000000..d2784bca8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dll-3.C
@@ -0,0 +1,16 @@
+// { dg-do assemble { target arm-*-*pe } }
+// { dg-options "-mno-nop-fun-dllimport" }
+// set compiler_result "__imp_f1.*\.section${spaces}.drectve\n\[^\n\]*-export:f2"
+// set not_compiler_result "__imp_f2"
+
+class aClass
+{
+public:
+ __declspec(dllimport) int f1();
+ __declspec(dllexport) int f2();
+};
+
+__declspec(dllexport) int aClass::f2()
+{
+ return f1();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dll-4.C b/gcc/testsuite/g++.old-deja/g++.other/dll-4.C
new file mode 100644
index 000000000..ea5593e5f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dll-4.C
@@ -0,0 +1,13 @@
+// { dg-do assemble { target arm-*-*pe } }
+// Ensure dllexport overrides dllimport.
+// set compiler_result "\.section${spaces}\.drectve\n\[^\n\]*-export:foo1.*\.section${spaces}\.drectve\n\[^\n\]*-export:foo2"
+// set not_compiler_result "(__imp_foo1|__imp_foo2)"
+
+__declspec (dllimport) int foo1 ();
+__declspec (dllexport) int foo1 ();
+
+__declspec (dllexport) int foo2 ();
+__declspec (dllimport) int foo2 ();
+
+__declspec (dllexport) int foo1 () { return foo2 (); }
+__declspec (dllexport) int foo2 () { return foo1 (); }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dll-5.C b/gcc/testsuite/g++.old-deja/g++.other/dll-5.C
new file mode 100644
index 000000000..c02be8932
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dll-5.C
@@ -0,0 +1,12 @@
+// { dg-do assemble { target arm-*-*pe } }
+// dllimport is "sorta like" to "extern".
+// set compiler_result "(\nfoo1:.*\nfoo2:|\nfoo2:.*\nfoo1:)"
+// set not_compiler_result "__imp_"
+
+__declspec (dllimport) int foo1;
+int foo1;
+
+__declspec (dllimport) int foo2;
+int foo2 = 5;
+
+int f () { return foo1 + foo2; }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dll-6.C b/gcc/testsuite/g++.old-deja/g++.other/dll-6.C
new file mode 100644
index 000000000..f094c08bf
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dll-6.C
@@ -0,0 +1,14 @@
+// { dg-do assemble { target arm-*-*pe } }
+// set not_compiler_result "__imp_"
+// dll.h
+class aClass
+ {
+public:
+ __declspec(dllimport) aClass();
+ };
+
+// dll.cpp
+
+__declspec(dllexport) aClass::aClass()
+ {
+ }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor1.C b/gcc/testsuite/g++.old-deja/g++.other/dtor1.C
new file mode 100644
index 000000000..103c4705f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor1.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// Test for use of typedef in explicit destructor call.
+
+#include <new>
+
+struct X {
+ typedef X foo;
+};
+
+X x;
+unsigned char bar[sizeof (X)];
+
+int
+main ()
+{
+ X* p = new (bar) X;
+ p->~foo();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor10.C b/gcc/testsuite/g++.old-deja/g++.other/dtor10.C
new file mode 100644
index 000000000..81ed0c1ac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor10.C
@@ -0,0 +1,41 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+extern "C" void abort ();
+
+int j;
+
+struct S {
+ static S* s[5];
+
+ S () { s[j++] = this; }
+ S (const S&) { s[j++] = this; }
+ ~S () {
+ for (int k = 0; k < j; ++k)
+ if (s[k] == this)
+ return;
+ abort ();
+ }
+};
+
+S* S::s[5];
+
+struct T {
+ int i;
+ S s;
+};
+
+T t;
+
+T f () {
+ return t;
+}
+
+void g (S) {
+}
+
+int main ()
+{
+ g (f ().s);
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor11.C b/gcc/testsuite/g++.old-deja/g++.other/dtor11.C
new file mode 100644
index 000000000..e20fa034f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor11.C
@@ -0,0 +1,35 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+extern "C" void abort ();
+
+int j;
+
+struct S {
+ S () { ++j; }
+ S (const S&) { ++j; }
+ ~S () {
+ if (--j < 0)
+ abort ();
+ }
+};
+
+struct T {
+ void g (S) {
+ }
+};
+
+struct U {
+ int i;
+ S s;
+};
+
+U u;
+
+U f () { return u; }
+
+int main ()
+{
+ T t;
+ t.g (f ().s);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor12.C b/gcc/testsuite/g++.old-deja/g++.other/dtor12.C
new file mode 100644
index 000000000..9890e6392
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor12.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+// Test that we don't complain about calling a destructor on a const object.
+
+#include <new>
+
+struct A
+{
+ ~A() {}
+};
+
+const A a = {};
+int main()
+{
+ a.~A();
+ a.A::~A(); // { dg-bogus "" } const violation
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor13.C b/gcc/testsuite/g++.old-deja/g++.other/dtor13.C
new file mode 100644
index 000000000..0b998ab46
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor13.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T> struct S { ~S(); };
+int i;
+
+void f ()
+{
+ i.~S(); // { dg-error "" } invalid destructor call.
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor2.C b/gcc/testsuite/g++.old-deja/g++.other/dtor2.C
new file mode 100644
index 000000000..48f89bcc2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor2.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+class K {
+public:
+ friend class C;
+
+private:
+ static K qwe;
+ K();
+ ~K();
+};
+
+K K::qwe;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor3.C b/gcc/testsuite/g++.old-deja/g++.other/dtor3.C
new file mode 100644
index 000000000..f5a00ed57
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor3.C
@@ -0,0 +1,51 @@
+// { dg-do assemble }
+
+struct S1
+{
+ ~S1(int); // { dg-error "" } destructors may not have parameters
+};
+
+
+template <class T>
+struct S2
+{
+ ~S2(int); // { dg-error "" } destructors may not have parameters
+};
+
+
+struct S3
+{
+ ~S3(double) {} // { dg-error "" } destructors may not have parameters
+};
+
+
+template <class T>
+struct S4
+{
+ ~S4(double) {} // { dg-error "" } destructors may not have parameters
+};
+
+
+struct S5
+{
+ ~S5();
+};
+
+S5::~S5(float) // { dg-error "" } destructors may not have parameters
+{
+}
+
+
+template <class T>
+struct S6
+{
+ ~S6();
+};
+
+template <class T>
+S6<T>::~S6(float) // { dg-error "" } destructors may not have parameters
+{
+}
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor4.C b/gcc/testsuite/g++.old-deja/g++.other/dtor4.C
new file mode 100644
index 000000000..a4db38ba7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor4.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+
+struct S1 {
+ ~S1(); // { dg-error "" } candidate
+};
+
+S1::~S1() const // { dg-error "" } prototype does not match
+{
+}
+
+
+struct S2 {
+ ~S2() volatile; // { dg-error "" } destructors may not be volatile
+};
+
+
+template <class T>
+struct S3 {
+ ~S3(); // { dg-error "" } candidate
+};
+
+template <class T>
+S3<T>::~S3() volatile // { dg-error "" } prototype does not match
+{
+}
+
+
+template <class T>
+struct S4 {
+ ~S4() const; // { dg-error "" } destructors may not be const
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor5.C b/gcc/testsuite/g++.old-deja/g++.other/dtor5.C
new file mode 100644
index 000000000..fc1ef385d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor5.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+extern "C" void abort ();
+
+struct B;
+
+struct S
+{
+ S (B*);
+ ~S ();
+
+ B* b_;
+};
+
+struct B
+{
+ B () : s (this) { }
+
+ virtual void f () { }
+
+ S s;
+};
+
+S::S (B* b) : b_ (b) { }
+
+S::~S () { b_->f (); }
+
+struct D : public B
+{
+ virtual void f () { abort (); }
+};
+
+int main ()
+{
+ D d;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor6.C b/gcc/testsuite/g++.old-deja/g++.other/dtor6.C
new file mode 100644
index 000000000..f8c1d8563
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor6.C
@@ -0,0 +1,45 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+extern "C" void abort ();
+
+int count;
+
+struct S
+{
+ S ();
+ S (const S&);
+ ~S ();
+
+ int i;
+};
+
+S::S ()
+{
+ i = count++;
+}
+
+S::S (const S&)
+{
+ i = count++;
+}
+
+S::~S ()
+{
+ if (--count != i)
+ abort ();
+}
+
+void f (S, S)
+{
+}
+
+int main ()
+{
+ {
+ S s;
+ f (s, s);
+ }
+ return count != 0;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor7.C b/gcc/testsuite/g++.old-deja/g++.other/dtor7.C
new file mode 100644
index 000000000..c212d9476
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor7.C
@@ -0,0 +1,43 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Origin: Mark Mitchell <mitchell@codesourcery.com>
+
+int i;
+int j;
+
+struct A
+{
+ A ();
+ A (const A&);
+ ~A ();
+};
+
+A::A ()
+{
+ ++i;
+}
+
+A::A (const A&)
+{
+ ++i;
+}
+
+A::~A ()
+{
+ --i;
+}
+
+A f ()
+{
+ return A ();
+}
+
+void g (const A&)
+{
+}
+
+int main ()
+{
+ g (f ());
+ return i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor8.C b/gcc/testsuite/g++.old-deja/g++.other/dtor8.C
new file mode 100644
index 000000000..5f2071d5a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor8.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+// { dg-options "-O1" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int result;
+
+struct S
+{
+ S ();
+ S (const S&);
+ ~S ();
+
+ int i;
+ double d[18];
+};
+
+S* s;
+
+S::S ()
+{
+ s = this;
+}
+
+S::~S ()
+{
+ if (s != this)
+ result = 1;
+}
+
+inline S f ()
+{
+ return S ();
+}
+
+int main ()
+{
+ f ();
+ return result;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor9.C b/gcc/testsuite/g++.old-deja/g++.other/dtor9.C
new file mode 100644
index 000000000..0df88a828
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dtor9.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+int i;
+
+struct CC
+{
+ virtual ~CC () { ++i; }
+};
+
+class BB : virtual public CC
+{
+};
+
+class AA : public virtual BB
+{
+};
+
+int main ()
+{
+ {
+ AA xx;
+ }
+ if (i != 1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dyncast1.C b/gcc/testsuite/g++.old-deja/g++.other/dyncast1.C
new file mode 100644
index 000000000..6feec30e6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dyncast1.C
@@ -0,0 +1,123 @@
+// { dg-do run }
+// Author: Alfred Miniarik <a8601248@unet.univie.ac.at>
+// test of dynamic_cast
+// runtime detecting of nonpublic
+// inheritance within a cast
+// and therefor failing with result 0.
+
+extern "C" void abort();
+extern "C" int printf (const char *, ...);
+
+static int errors = 0;
+void error(int i)
+{
+ printf("Error %i\n",i);
+ errors++;
+}
+
+// 1. downcast
+
+// 1.1. single inheritance case
+
+struct A {virtual ~A(){}};
+struct AA : A {};
+struct B : A {};
+struct BB : B {};
+class C : B {};
+struct D : C {};
+
+struct CC : B {};
+class DD : CC {};
+
+class CCC : protected B {};
+class DDD : protected CCC {};
+
+void
+test01 ()
+{
+ D d;
+ if(dynamic_cast<D*> ((A*)&d)) error(1);
+ if(dynamic_cast<D*> ((B*)&d)) error(2);
+ if(&d != dynamic_cast<D*> ((C*)&d)) error(3); //counter example
+ if(dynamic_cast<C*> ((B*)&d)) error(4);
+
+ DD dd;
+ if(dynamic_cast<DD*> ((A*)&dd)) error(5);
+ if(dynamic_cast<DD*> ((B*)&dd)) error(6);
+
+ DDD ddd;
+ if(dynamic_cast<DDD*> ((A*)&ddd)) error(7);
+ if(dynamic_cast<DDD*> ((B*)&ddd)) error(8);
+ if(dynamic_cast<CCC*> ((B*)&ddd)) error(9);
+}
+
+// 1.2. multiple inheritance case
+// 1.2.1. all bases are public
+
+struct E : D, CC {};
+struct EE : CC, D {}; //Will search in reverse order.
+
+void
+test02 ()
+{
+ E e;
+ if(dynamic_cast<E*> ((A*)(D*)&e)) error(10);
+ if(dynamic_cast<E*> ((B*)(D*)&e)) error(11);
+ if(&e != dynamic_cast<E*> ((C*)(D*)&e)) error(12); //counter example
+ if(&e != dynamic_cast<E*> ((B*)(CC*)&e)) error(13); //counter example
+ if((CC*)&e != dynamic_cast<CC*> ((B*)(CC*)&e)) error(14); //counter example
+
+ EE ee;
+ if(dynamic_cast<EE*> ((A*)(D*)&ee)) error(15);
+ if(dynamic_cast<EE*> ((B*)(D*)&ee)) error(16);
+ if(&ee != dynamic_cast<EE*> ((C*)(D*)&ee)) error(17); //counter example
+ if(&ee != dynamic_cast<EE*> ((B*)(CC*)&ee)) error(18); //counter example
+ if((CC*)&ee != dynamic_cast<CC*> ((B*)(CC*)&ee)) error(19); //counter example
+}
+
+// 1.2.2 one or more branches are nonpublic
+
+struct X : private BB, E {};
+struct Y : AA, private B {};
+
+class XX : BB, E {};
+
+void
+test03 ()
+{
+ X x;
+ if(&x != dynamic_cast<X*>((B*)(CC*)(E*)&x)) error(20); //counter example
+ XX xx;
+ if(dynamic_cast<XX*>((B*)(CC*)(E*)&xx)) error(21);
+ Y y;
+ if(dynamic_cast<Y*>((B*)&y)) error (22);
+ if(dynamic_cast<Y*>((A*)(B*)&y)) error (23);
+}
+
+// 2. crosscast
+
+struct J {virtual ~J(){}};
+struct K : CC, private J {};
+class KK : J, CC{};
+
+void
+test04 ()
+{
+ E e;
+ if(dynamic_cast<CC*> ((B*)(D*)&e)) error(24);
+ if((CC*)&e != dynamic_cast<CC*> ((C*)(D*)&e)) error(25); //counter example
+ K k;
+ if(dynamic_cast<J*> ((B*)&k)) error(26);
+ KK kk;
+ if(dynamic_cast<J*> ((CC*)&kk)) error(27);
+}
+
+int
+main ()
+{
+ test01();
+ test02();
+ test03();
+ test04();
+ return errors ? 1 : 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dyncast2.C b/gcc/testsuite/g++.old-deja/g++.other/dyncast2.C
new file mode 100644
index 000000000..bea82cb46
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dyncast2.C
@@ -0,0 +1,85 @@
+// { dg-do run }
+// Author: Alfred Miniarik <a8601248@unet.univie.ac.at>
+// test of dynamic_cast
+// runtime detecting of valid
+// downcasts within nonpublic
+// baseclasses.
+
+extern "C" void abort();
+extern "C" int printf (const char *, ...);
+
+static int errors = 0;
+
+void error(int i)
+{
+ printf("Error %i\n",i);
+ errors++;
+}
+
+// 1. downcast
+// 1.1 single inheritance case
+
+struct A {virtual ~A(){} int i;};
+struct B : A {int i;};
+struct C : B {int i;};
+struct CC : C {};
+class D : C {int i;};
+
+struct E : D {int i;};
+class F : E {int i;};
+
+void
+test01 ()
+{
+ D d;
+ if((C*)&d != dynamic_cast<C*> ((A*)&d)) error(1);
+ if((C*)&d != dynamic_cast<C*> ((B*)&d)) error(2);
+ if((B*)&d != dynamic_cast<B*> ((A*)&d)) error(3);
+
+ E e;
+ if((C*)&e != dynamic_cast<C*> ((A*)&e)) error(4);
+
+ F f;
+ if((C*)&f != dynamic_cast<C*> ((B*)&f)) error(5);
+ if((B*)&f != dynamic_cast<B*> ((A*)&f)) error(6);
+ if((E*)&f != dynamic_cast<E*> ((D*)&f)) error(7);
+ if(dynamic_cast<E*> ((C*)&f)) error(8); //counter example
+}
+
+// 1.2 multiple inheritance case
+
+struct G : CC, F{};
+
+void
+test02 ()
+{
+ G g;
+ if((B*)(F*)&g != dynamic_cast<B*> ((A*)(F*)&g)) error(9);
+ if(dynamic_cast<D*> ((A*)(F*)&g)) error(10);
+ if(dynamic_cast<G*> ((B*)(F*)&g)) error(11);
+}
+
+// 2. crosscast (always fail)
+
+struct I : C{};
+struct J : F{};
+struct K : I, J{};
+class L : K{};
+
+void
+test03 ()
+{
+ L l;
+ if(dynamic_cast<J*> ((I*)&l)) error(12);
+ if(dynamic_cast<J*> ((E*)&l)) error(13);
+ if(dynamic_cast<I*> ((J*)&l)) error(14);
+}
+
+int
+main ()
+{
+ test01();
+ test02();
+ test03();
+ return errors ? 1 : 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dyncast3.C b/gcc/testsuite/g++.old-deja/g++.other/dyncast3.C
new file mode 100644
index 000000000..cd59efa6c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dyncast3.C
@@ -0,0 +1,33 @@
+// { dg-do run }
+// Author: Alfred Miniarik <a8601248@unet.univie.ac.at>
+// test of dynamic_cast
+// runtime detecting of nonpublic
+// inheritance within a cast
+// and therefor failing with result 0.
+
+extern "C" void abort();
+extern "C" int printf (const char *, ...);
+
+static int errors = 0;
+
+void error(int i)
+{
+ printf("Error %i\n",i);
+ errors++;
+}
+
+struct A {virtual ~A(){}};
+struct B : private virtual A {};
+struct C : virtual A {};
+struct D : B, C {};
+
+int
+main()
+{
+ D d;
+ A* ap= &d;
+ if(&d != dynamic_cast<D*>(ap)) error(1);
+ if((B*)&d != dynamic_cast<B*>(ap)) error(2);
+ if((C*)&d != dynamic_cast<C*>(ap)) error(3);
+ return errors ? 1 : 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dyncast4.C b/gcc/testsuite/g++.old-deja/g++.other/dyncast4.C
new file mode 100644
index 000000000..a49ef4b67
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dyncast4.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// Author: Alfred Miniarik <a8601248@unet.univie.ac.at>
+
+// Even in a derived class, a private base cannot be dynamically downcasted
+// from.
+
+extern "C" void abort();
+
+struct A {
+ virtual ~A () {}
+};
+
+struct B : private A {
+ B* a2b (A* objp)
+ {
+ return dynamic_cast<B*> (objp);
+ }
+};
+
+int
+main ()
+{
+ B b;
+ A* aptr = (A*) &b;
+ if (dynamic_cast <B*> (aptr)) abort ();
+ if (b.a2b (aptr)) abort();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dyncast5.C b/gcc/testsuite/g++.old-deja/g++.other/dyncast5.C
new file mode 100644
index 000000000..120a75ae6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dyncast5.C
@@ -0,0 +1,38 @@
+// { dg-do run }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Jun 1999 <nathan@acm.org>
+
+// dynamic cast can only cast to public unambiguous bases
+
+extern "C" void abort ();
+
+struct A {virtual ~A(){} int m; };
+struct B {virtual ~B(){} int m; };
+
+struct C1 : A {int m;};
+struct C2 : A {int m;};
+
+// A is ambiguous, but private in one branch
+struct D1 : B, C1, private C2 {int m;};
+// A is ambiguous, and public in both branches
+struct D2 : B, C1, C2 {int m;};
+
+void fn(B *bd1, B *bd2)
+{
+ A *ad1;
+ A *ad2;
+
+ ad1 = dynamic_cast<A *>(bd1);
+ if(ad1) abort();
+ ad2 = dynamic_cast<A *>(bd2);
+ if(ad2) abort();
+}
+
+int main()
+{
+ D1 d1;
+ D2 d2;
+
+ fn((B *)&d1, (B *)&d2);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dyncast6.C b/gcc/testsuite/g++.old-deja/g++.other/dyncast6.C
new file mode 100644
index 000000000..52b57e544
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dyncast6.C
@@ -0,0 +1,73 @@
+// { dg-do run }
+// { dg-options "-w -ansi -pedantic-errors" }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 20 June 2000 <nathan@codesourcery.com>
+
+// Origin GNATS bug report 143 from Carlo Wood <carlo@runaway.xs4all.nl>
+// We were generating incorrect type_info structures, and hence breaking
+// dynamic_cast.
+
+#include <stdio.h>
+
+class OBASE { public: virtual void bz () {}};
+class IBASE { public: virtual void by () {}};
+
+class V {public:int m; };
+
+class A : public virtual V { };
+class AA : public A {};
+
+class B : public OBASE, public A { public: virtual void foo(void) { } };
+class B1 : public OBASE, public AA { public: virtual void foo(void) { } };
+
+class C : public IBASE, public virtual V { };
+
+class D : public B, public C { };
+
+class E : public B, public virtual V { };
+
+class E1 : public B1, public virtual V {};
+
+class E2 : public B1, public A, public virtual V {};
+
+int main(void)
+{
+ D d;
+ E e;
+ E1 e1;
+ E2 e2;
+ int code = 0;
+
+ OBASE* osd = &d;
+ OBASE* ose = &e;
+ OBASE* ose1 = &e1;
+ OBASE* ose2 = &e2;
+
+
+ if (!dynamic_cast<V*>(osd))
+ {
+ printf ("fail osd\n");
+ code++;
+ }
+
+ if (!dynamic_cast<V*>(ose))
+ {
+ printf ("fail ose\n");
+ code++;
+ }
+
+ if (!dynamic_cast<V*>(ose1))
+ {
+ printf ("fail ose1\n");
+ code++;
+ }
+
+ if (!dynamic_cast<V*>(ose2))
+ {
+ printf ("fail ose2\n");
+ code++;
+ }
+
+ return code;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh.C b/gcc/testsuite/g++.old-deja/g++.other/eh.C
new file mode 100644
index 000000000..13cbb730c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+class foo {
+public:
+ ~foo();
+ foo &operator=(const foo &);
+ foo e() const;
+};
+class bar {
+public:
+ foo d() const;
+};
+struct x {
+ foo a;
+ bar* b;
+};
+void baz(x *f, int ic)
+{
+ f->a = ic ? f->b->d().e() : f->b->d();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh1.C b/gcc/testsuite/g++.old-deja/g++.other/eh1.C
new file mode 100644
index 000000000..e7cdc2777
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh1.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+class C2 {
+public:
+ ~C2();
+ C2 a() const;
+};
+class C3 {
+public:
+ C3(const C2 &c);
+};
+class C4
+{
+public:
+ C3 *foo(bool b, const C2 &c);
+ C2 d() const;
+};
+C3 *C4::foo(bool b, const C2 &c)
+{
+ return new C3(b ? d().a() : c);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh2.C b/gcc/testsuite/g++.old-deja/g++.other/eh2.C
new file mode 100644
index 000000000..158ae2087
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh2.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class a {
+public:
+ double b;
+ int c;
+ ~a() { }
+};
+
+int bar(a x);
+a foo(double x);
+
+int baz(double x, int y)
+{
+ return bar(foo(x));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh3.C b/gcc/testsuite/g++.old-deja/g++.other/eh3.C
new file mode 100644
index 000000000..4e6189282
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh3.C
@@ -0,0 +1,33 @@
+// { dg-do run }
+// { dg-options "-O" }
+typedef struct { } e;
+
+char *p;
+
+void _Jv_throw ();
+
+int barf (int len)
+{
+ char a[len];
+
+ p = a;
+ _Jv_throw ();
+ return 0;
+}
+
+void _Jv_throw ()
+{
+ e ex;
+ throw ex;
+}
+
+int main ()
+{
+ try {
+ barf (2);
+ }
+ catch (...) {
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh4.C b/gcc/testsuite/g++.old-deja/g++.other/eh4.C
new file mode 100644
index 000000000..999e2943a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh4.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: Jean-Marc Bourguet <bourguet@cadence.com>
+
+class foo {
+public:
+ foo() {}
+ void throwMe () {
+ throw *this; // { dg-error "" } cannot be used in throw-expression
+ }
+ virtual void test () = 0;
+};
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh5.C b/gcc/testsuite/g++.old-deja/g++.other/eh5.C
new file mode 100644
index 000000000..59ed4dd5b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh5.C
@@ -0,0 +1,34 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+
+struct X {};
+
+struct Y
+{
+ Y();
+ virtual ~Y();
+};
+
+struct Z
+{
+ int f (const int *x);
+ int g;
+};
+
+inline int
+operator<< (Z &os, int x)
+{
+ os.f (&x);
+ return os.g;
+}
+
+void foo (Z &a, X *b, X &c)
+{
+ X *d = b;
+ int e = 0;
+ Z &f = a;
+ if (!(f << e))
+ do { do { } while (&c == 0); throw Y(); } while (0);
+ do { } while (&d == 0);
+ do { } while (&c == 0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/elab1.C b/gcc/testsuite/g++.old-deja/g++.other/elab1.C
new file mode 100644
index 000000000..5588651df
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/elab1.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+typedef struct {} S; // { dg-error "" } Previous declaration of S
+
+S s1;
+struct S* s2; // { dg-error "" } S is a typedef name
+
+template <class T>
+struct X {
+ friend class T; // { dg-error "" } T is a template type parameter
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/empty1.C b/gcc/testsuite/g++.old-deja/g++.other/empty1.C
new file mode 100644
index 000000000..47a5b7a51
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/empty1.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+// This test case checks that the return value optimization works for
+// empty classes.
+
+// PR c++/5995
+
+extern "C" void abort();
+extern "C" int printf (const char *, ...);
+
+int i;
+
+struct A;
+
+struct A* as[10];
+
+struct A {
+ A () { as[i++] = this; }
+ A (const A&) { as[i++] = this; }
+ ~A() { if (i == 0 || as[--i] != this) abort(); }
+};
+
+A f() { return A(); }
+
+int main ()
+{
+ A a (f ());
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/empty2.C b/gcc/testsuite/g++.old-deja/g++.other/empty2.C
new file mode 100644
index 000000000..a3a6bace6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/empty2.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct E {};
+
+void f () {
+ E e1, e2;
+ e1 = e2; // We should not warn about this statement, even though no
+ // code is generated for it.
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum1.C b/gcc/testsuite/g++.old-deja/g++.other/enum1.C
new file mode 100644
index 000000000..9685f6a04
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/enum1.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+extern "C" void abort();
+
+struct A
+{
+ enum { a = 3}* p;
+ int f() { return (int) a; }
+};
+
+int main()
+{
+ A a;
+
+ if (a.f() != 3)
+ abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum2.C b/gcc/testsuite/g++.old-deja/g++.other/enum2.C
new file mode 100644
index 000000000..40328bfc6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/enum2.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 3 Jun 1999 <nathan@acm.org>
+
+// We'd like the enum location to be its identifier.
+
+enum thing // { dg-error "" } previous def
+{
+ val1
+};
+
+enum thing // { dg-error "" } multiple def
+{
+ val2
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum3.C b/gcc/testsuite/g++.old-deja/g++.other/enum3.C
new file mode 100644
index 000000000..16e71ac67
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/enum3.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 338 and DR 128. Allow static cast to convert between enums.
+
+enum E1 {e1};
+enum E2 {e2};
+
+E2 Foo (E1 e)
+{
+ return static_cast <E2> (e);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum4.C b/gcc/testsuite/g++.old-deja/g++.other/enum4.C
new file mode 100644
index 000000000..429e8127c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/enum4.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// { dg-options "-fshort-enums" }
+
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+// On ARM EABI targets this testcase will cause a warning to be emitted
+// whilst EABI attributes are being merged at link time unless
+// the --no-enum-size-warning option is passed to the linker. Whilst the
+// enum-size attributes should only be emitted if there are values of
+// enum type that can escape the compilation unit, gcc cannot currently
+// detect this; if this facility is added then this linker option should
+// not be needed. arm-*-linux*eabi should be a good approximation to
+// those platforms where the EABI supplement defines enum values to be
+// 32 bits wide.
+// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
+
+enum E {
+ a = -312
+};
+
+E e = a;
+
+int main () {
+ if ((int) e != -312)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum5.C b/gcc/testsuite/g++.old-deja/g++.other/enum5.C
new file mode 100644
index 000000000..ad40d4e1f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/enum5.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+// Contributed by Ben Elliston <bje@redhat.com>
+
+// PR 80: Packed enums use minimum required storage.
+
+extern "C" void abort();
+
+enum numbers { one, two, three } __attribute__ ((packed)) nums;
+enum colours { red = 1000, green, blue } __attribute__ ((packed)) cols;
+enum conditions { fine, rain, cloudy } __attribute__ ((packed)) forecast;
+
+int
+main()
+{
+ if (sizeof (nums) != 1)
+ abort ();
+
+ if (sizeof (cols) != 2)
+ abort ();
+
+ if (sizeof (forecast) != 1)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/explicit1.C b/gcc/testsuite/g++.old-deja/g++.other/explicit1.C
new file mode 100644
index 000000000..123efb743
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/explicit1.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@redhat.com>
+
+struct A
+{
+ A ();
+ explicit A (int);
+};
+
+int main ()
+{
+ const A& r = 1; // { dg-error "" } no suitable constructor
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/expr1.C b/gcc/testsuite/g++.old-deja/g++.other/expr1.C
new file mode 100644
index 000000000..87166f0ae
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/expr1.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+// Simplified from bug report by Trevor Taylor <ttaylor@powerup.com.au>
+
+struct T { // { dg-message "candidate" }
+ int operator()(int) { } // { dg-message "operator|candidate expects" }
+};
+
+int main() {
+ T()(); // { dg-error "match" } no such operator
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C b/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C
new file mode 100644
index 000000000..abe072999
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/exprstmt1.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// { dg-options "-O" }
+// { dg-error "limited range of data type" "16-bit target" { target xstormy16-*-* } 0 }
+// { dg-error "shift count >=" "16-bit target" { target xstormy16-*-* } 0 }
+
+int main()
+{
+ unsigned int x = 1381237248;
+
+ if (sizeof (x) != 4)
+ return 0;
+
+ x =
+ ({
+ unsigned int y = x;
+ ({
+ unsigned int z = y;
+ (unsigned int)
+ ((((unsigned int)z & (unsigned int)0x000000ffUL) << 24)
+ | (((unsigned int)z & (unsigned int)0x0000ff00UL) << 8)
+ | (((unsigned int)z & (unsigned int)0x00ff0000UL) >> 8)
+ | (((unsigned int)z & (unsigned int)0xff000000UL) >> 24));
+ });
+ });
+ return x != 152658;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/externC1.C b/gcc/testsuite/g++.old-deja/g++.other/externC1.C
new file mode 100644
index 000000000..0e485053a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/externC1.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mitchell@codesourcery.com>
+
+extern "C"
+{
+ struct T
+ {
+ ~T ();
+ };
+
+ struct S
+ {
+ T t;
+ };
+}
+
+S* s;
+
+void f ()
+{
+ delete s;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/externC2.C b/gcc/testsuite/g++.old-deja/g++.other/externC2.C
new file mode 100644
index 000000000..d5b23303b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/externC2.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// Origin: Boris Zentner <boris@m2b.de>
+
+extern "C"
+{
+struct xx
+{
+ int x;
+ xx();
+};
+
+xx::xx()
+{
+ x = 0;
+}
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/externC3.C b/gcc/testsuite/g++.old-deja/g++.other/externC3.C
new file mode 100644
index 000000000..9f56ed3a7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/externC3.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+// Test that two extern "C" declarations of the same name in different
+// namespaces are treated as declaring the same function.
+
+namespace foo {
+ extern "C" int f ();
+}
+
+extern "C" int f () { return 0; }
+
+using namespace foo;
+
+int main ()
+{
+ f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/externC4.C b/gcc/testsuite/g++.old-deja/g++.other/externC4.C
new file mode 100644
index 000000000..daf097fc8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/externC4.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Origin: Neil Booth, from PR #66
+
+extern "C"
+{
+ class foo
+ {
+ public:
+ ~foo ();
+ void bar (foo *);
+ foo ();
+ };
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/externC5.C b/gcc/testsuite/g++.old-deja/g++.other/externC5.C
new file mode 100644
index 000000000..3e32d4ffa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/externC5.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// Origin: schmid@snake.iap.physik.tu-darmstadt.de
+
+extern "C" int rand (void) throw ();
+
+namespace std
+{
+extern "C" int rand(void) throw();
+template <class T> void f(T a) {}
+}
+
+using namespace std;
+
+int main()
+{
+ f(rand);
+ f(std::rand);
+ f(::rand);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/field1.C b/gcc/testsuite/g++.old-deja/g++.other/field1.C
new file mode 100644
index 000000000..5b8b3617c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/field1.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+struct X
+{
+ static const bool b = true;
+ static const int i = b ? 1 : 2;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/field2.C b/gcc/testsuite/g++.old-deja/g++.other/field2.C
new file mode 100644
index 000000000..5dd1e97fb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/field2.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// Test for proper handling of field calls.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+struct A {
+ inline A* operator()() { return this; }
+};
+
+struct B {
+ int i;
+ union { A a; };
+};
+
+int
+main ()
+{
+ B b;
+ A* ap = &b.a;
+ A* ap2 = b.a();
+ return (ap != ap2);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/fnname1.C b/gcc/testsuite/g++.old-deja/g++.other/fnname1.C
new file mode 100644
index 000000000..e8e3254ab
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/fnname1.C
@@ -0,0 +1,8 @@
+// { dg-do link }
+// { dg-options "-g" }
+// Origin: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
+
+int main ()
+{
+ const char *s = __FUNCTION__;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/for1.C b/gcc/testsuite/g++.old-deja/g++.other/for1.C
new file mode 100644
index 000000000..88d79933b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/for1.C
@@ -0,0 +1,43 @@
+// { dg-do assemble }
+
+int i;
+int j;
+
+struct S {
+ int operator()(int)
+ {
+ i = 1;
+ return i;
+ }
+
+ typedef int I;
+
+ void f() {
+ for (S I; false; )
+ ;
+ int k = I(3);
+ }
+};
+
+typedef int J;
+
+struct T {
+ int operator()(int)
+ {
+ j = 1;
+ return j;
+ }
+
+ void f() {
+ for (T J; false; )
+ ;
+ int k = J(3);
+ }
+};
+
+int main()
+{
+ S s;
+ s.f();
+ return 2 * i + j;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/for2.C b/gcc/testsuite/g++.old-deja/g++.other/for2.C
new file mode 100644
index 000000000..0ba12b46d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/for2.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Jul 2000 <nathan@codesourcery.com>
+
+// Bug 306
+// binding a reference in for scope creates nameless objects. Make sure
+// we don't try and inject them into scope, for ARM compatibility.
+
+void foo ()
+{
+ for (const int &thing = 0;;)
+ ;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend1.C b/gcc/testsuite/g++.old-deja/g++.other/friend1.C
new file mode 100644
index 000000000..56236ab33
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend1.C
@@ -0,0 +1,88 @@
+// { dg-do assemble }
+// f() should be able to access B::j, as of FDIS [class.protected]/1
+
+// Subject: Re: [bug] Inheritance and friend access control broken
+// References: <199803032141.WAA09332@piano.dptmaths.ens-cachan.fr>
+// <orhg5ff544.fsf@iguacu.dcc.unicamp.br>
+// <199803041125.MAA06937@cor.dptmaths.ens-cachan.fr>
+// <orn2f6ek92.fsf@iguacu.dcc.unicamp.br> <19980304102900.46897@dgii.com>
+// From: Alexandre Oliva <oliva@dcc.unicamp.br>
+// Date: 06 Mar 1998 01:43:18 -0300
+
+template <int*>
+class X {};
+
+template <typename T>
+void g();
+
+struct S;
+
+template <typename T>
+struct R;
+
+class B {
+protected:
+ int i; // { dg-error "" } in this context
+ static int j;
+};
+
+class D : public B {
+ friend void f();
+ template <typename T>
+ friend void g();
+ friend struct S;
+ template <typename T>
+ friend struct R;
+};
+
+struct S {
+ void h();
+ X<&B::j> x;
+};
+
+template <typename T>
+struct R {
+ void h();
+ X<&B::j> x;
+};
+
+B b;
+D d;
+
+void f()
+{
+ b.i = 3; // { dg-error "" } protected
+ d.i = 4;
+ B::j = 5;
+ D::j = 6;
+}
+
+template <typename T>
+void g()
+{
+ b.i = 3; // { dg-error "" } protected
+ d.i = 4;
+ B::j = 5;
+ D::j = 6;
+}
+
+template void g<int>();
+
+void S::h()
+{
+ b.i = 3; // { dg-error "" } protected
+ d.i = 4;
+ B::j = 5;
+ D::j = 6;
+}
+
+template <typename T>
+void R<T>::h()
+{
+ b.i = 3; // { dg-error "" } protected
+ d.i = 4;
+ B::j = 5;
+ D::j = 6;
+}
+
+template struct R<double>;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend10.C b/gcc/testsuite/g++.old-deja/g++.other/friend10.C
new file mode 100644
index 000000000..935b2fe5b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend10.C
@@ -0,0 +1,30 @@
+// { dg-do assemble }
+// Origin: Neil Booth, from PR #78
+
+namespace MySpace
+ {
+ class Tag1 { };
+ class Tag2 { };
+
+ template<class Tag>
+ class Object
+ {
+ public:
+
+ friend void Forgotten(Object const & m) {}
+ };
+
+ typedef Object<Tag1> U1;
+ typedef Object<Tag2> U2;
+
+ void foo()
+ {
+ Forgotten(U1());
+ Forgotten(U2());
+ }
+
+ void bar()
+ {
+ Forgotten(U1());
+ }
+ }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend11.C b/gcc/testsuite/g++.old-deja/g++.other/friend11.C
new file mode 100644
index 000000000..7c04f03ac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend11.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: robt@flyingpig.com
+
+class Outer
+{
+ friend void f1();
+ class Inner2;
+};
+
+class Outer::Inner2
+{
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend2.C b/gcc/testsuite/g++.old-deja/g++.other/friend2.C
new file mode 100644
index 000000000..3f5f2a7de
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend2.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+void
+f()
+{
+ class Local_2 {
+ friend class Friend;
+
+ int i;
+ };
+
+ class Friend {
+ public:
+ void g() {
+ Local_2 l2;
+ l2.i = 3;
+ }
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend3.C b/gcc/testsuite/g++.old-deja/g++.other/friend3.C
new file mode 100644
index 000000000..79323f6ec
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend3.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+
+class foo {
+public:
+ class bar;
+ void func(bar *);
+ class bar {
+ int st;
+ friend void foo::func(bar *);
+ };
+};
+
+
+void foo::func(bar *obj) {
+ obj->st++;
+}
+
+void test02() {
+ foo obj_f;
+ foo::bar obj_b;
+
+ obj_f.func( &obj_b);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend4.C b/gcc/testsuite/g++.old-deja/g++.other/friend4.C
new file mode 100644
index 000000000..41d3a6a48
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend4.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+
+// I'm not 100% sure this program is correct, but g++ shouldn't just
+// crash.
+
+// The idea is to give privileged access to bar<A> only to
+// specializations foo<A,B>, for all B.
+
+template <class A, class B> void foo();
+template <class C> class bar {
+ int i; // { dg-error "" } private
+ template <class B> friend void foo<C,B>(); // { dg-error "" } bogus declaration
+};
+template <class A, class B> void foo() {
+ bar<A> baz; baz.i = 1; // { dg-error "" } foo cannot access bar<int>::i
+ bar<int> buz; buz.i = 1; // { dg-error "" } foo cannot access bar<int>::i
+}
+int main() {
+ foo<void,void>();
+ foo<int,void>();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend5.C b/gcc/testsuite/g++.old-deja/g++.other/friend5.C
new file mode 100644
index 000000000..44f16678a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend5.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// submitted by David C Binderman <dcb@pncl.co.uk>
+
+struct A {
+ friend bool(); // { dg-error "" } invalid declaration
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend6.C b/gcc/testsuite/g++.old-deja/g++.other/friend6.C
new file mode 100644
index 000000000..05763d986
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend6.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// Origin: Martin v. Löwis <loewis@informatik.hu-berlin.de>
+// Test for resolution of core issue 125.
+
+struct A{
+ struct B{};
+};
+
+A::B C();
+
+namespace B{
+ A C();
+}
+
+class Test{
+ friend A (::B::C)(); // Ok
+ friend A::B (::C)(); // Ok
+ friend A::B::C(); // { dg-error "" } no A::B::C
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend7.C b/gcc/testsuite/g++.old-deja/g++.other/friend7.C
new file mode 100644
index 000000000..aed56a187
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend7.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: Martin v. Löwis <loewis@informatik.hu-berlin.de>
+// Test that a friend declaration with an explicit :: finds the right fn.
+
+namespace M {
+class S;
+}
+void foo(M::S *);
+
+namespace M {
+class S {
+ friend void (::foo)(S *);
+ void Fn();
+ static S s;
+};
+}
+
+void (foo)(M::S *ptr) {
+ M::S::s.Fn();
+ ptr->Fn();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend8.C b/gcc/testsuite/g++.old-deja/g++.other/friend8.C
new file mode 100644
index 000000000..bbe4bf598
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend8.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2000 <nathan@codesourcery.com>
+
+// We failed to diagnose when a class friend declaration did not use an
+// elaborated type specifier.
+
+struct Y;
+struct Z;
+struct X
+{
+ friend class Z;
+ friend Y; // { dg-error "" } friend must use aggr tag
+};
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend9.C b/gcc/testsuite/g++.old-deja/g++.other/friend9.C
new file mode 100644
index 000000000..db9a248f7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend9.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Nov 2000 <nathan@codesourcery.com>
+
+// Bug 853: We reported the wrong line no for a friend access violation
+
+class F
+{
+ class Internal; // { dg-error "" } is private
+};
+
+class C
+{
+ friend class F::Internal; // { dg-error "" } in this context
+ public:
+ typedef enum { A, B } e;
+
+ C ();
+ ~C();
+
+ void m();
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/goto1.C b/gcc/testsuite/g++.old-deja/g++.other/goto1.C
new file mode 100644
index 000000000..0dcc8bc00
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/goto1.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ S ();
+ ~S ();
+};
+
+void f ()
+{
+ {
+ S s1; // { dg-error "" } skips initialization
+
+ t: // { dg-error "" } jump to label
+ S s2;
+ ;
+ }
+
+ goto t; // { dg-error "" } from here
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/goto2.C b/gcc/testsuite/g++.old-deja/g++.other/goto2.C
new file mode 100644
index 000000000..07adbb95d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/goto2.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-Wunused" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ S ();
+ ~S ();
+};
+
+void f ()
+{
+ {
+ S s1;
+ int j; // { dg-warning "" } unused
+
+ t: // { dg-warning "" } unused
+ S s2;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/goto3.C b/gcc/testsuite/g++.old-deja/g++.other/goto3.C
new file mode 100644
index 000000000..e063ad27d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/goto3.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// Testcase for various invalid gotos.
+// Origin: Jason Merrill <jason@redhat.com>
+
+void f ()
+{
+ goto foo1; // { dg-error "" } jumps
+ try { foo1:; } catch (...) { } // { dg-error "" } into try
+ goto foo2; // { dg-error "" } jumps
+ try { } catch (...) { foo2:; } // { dg-error "" } into catch
+ goto foo3; // { dg-error "" } jumps
+ { int i=2; foo3:; } // { dg-error "" } past init
+
+ try { foo4:; } catch (...) { } // { dg-error "" }
+ goto foo4; // { dg-error "" }
+ try { } catch (...) { foo5:; } // { dg-error "" }
+ goto foo5; // { dg-error "" }
+ { int i=2; foo6:; } // { dg-error "" }
+ goto foo6; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/goto4.C b/gcc/testsuite/g++.old-deja/g++.other/goto4.C
new file mode 100644
index 000000000..fa0dd5a79
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/goto4.C
@@ -0,0 +1,27 @@
+// { dg-do run }
+// Test that we clean up temporaries bound to references properly when
+// jumping out of their scope.
+
+int ret = 1;
+
+struct A
+{
+ ~A() { ret = 0; }
+};
+
+void f()
+{
+ if (0)
+ {
+ out:
+ return;
+ }
+ const A& a = A();
+ goto out;
+}
+
+int main()
+{
+ f();
+ return ret;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/headers1.C b/gcc/testsuite/g++.old-deja/g++.other/headers1.C
new file mode 100644
index 000000000..1080fe38c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/headers1.C
@@ -0,0 +1,59 @@
+// { dg-do run }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Loren J. Rittle 07 Jun 2000 <ljrittle@acm.org>
+//
+// This test catches the occasional macro/symbol conflict between
+// C++ and system-provided headers.
+
+#include <algorithm>
+#include <bitset>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <complex>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <deque>
+#include <exception>
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <iosfwd>
+#include <iostream>
+#include <iterator>
+#include <list>
+#include <map>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <queue>
+#include <set>
+#include <stack>
+#include <stdexcept>
+#include <string>
+#include <typeinfo>
+#include <utility>
+// The VxWorks kernel-mode headers define macros named "max" and
+// "min", which is not ISO-compliant, but is part of the VxWorks API.
+#if defined __vxworks && !defined __RTP__
+#undef max
+#undef min
+#endif
+#include <valarray>
+#include <vector>
+
+int main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/incomplete.C b/gcc/testsuite/g++.old-deja/g++.other/incomplete.C
new file mode 100644
index 000000000..a00ea1c7d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/incomplete.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+// gcc represents non-ellipsis parmlists by terminating them with
+// a void parm. We need to distinguish between a parmlist of (void), and
+// some ill-formed ones.
+
+struct S; // { dg-error "" } forward ref
+
+void f(S); // ok
+void f(S s) {} // { dg-error "" } incomplete type
+void j (int){} // ok
+void k (){} // ok
+void q (void){} // ok
+void t (void t); // { dg-error "" } incomplete
+void r (void, ...); // { dg-error "" } incomplete
+void s (void const); // { dg-error "" } incomplete
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init1.C b/gcc/testsuite/g++.old-deja/g++.other/init1.C
new file mode 100644
index 000000000..0759e460b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init1.C
@@ -0,0 +1,11 @@
+// { dg-do run }
+extern "C" void abort();
+
+int i;
+int j = i++;
+
+int main()
+{
+ if (i != 1)
+ abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init10.C b/gcc/testsuite/g++.old-deja/g++.other/init10.C
new file mode 100644
index 000000000..7fd07fa89
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init10.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+int i;
+
+struct D {
+ D () {
+ i++;
+ }
+};
+
+struct C {
+ C() {}
+
+ D d[1];
+};
+
+
+int main ()
+{
+ C c;
+
+ if (i != 1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init11.C b/gcc/testsuite/g++.old-deja/g++.other/init11.C
new file mode 100644
index 000000000..f315e570d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init11.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+// Check that elements for which no explicit initializer was given are
+// default-initialized properly.
+
+extern "C" int printf (const char *, ...);
+
+struct A
+{
+ int i;
+ A(): i (42) { }
+ A(int j): i(j) { }
+};
+
+A ar[4] = { 1, 2 };
+
+struct B
+{
+ A a1, a2, a3, a4;
+};
+
+B b = { 1, 2 };
+
+struct C
+{
+ A ar[4];
+};
+
+C c = { 1, 2 };
+
+int
+main ()
+{
+ printf ("%d %d %d %d\n%d %d %d %d\n%d %d %d %d\n",
+ ar[0].i, ar[1].i, ar[2].i, ar[3].i,
+ b.a1.i, b.a2.i, b.a3.i, b.a4.i,
+ c.ar[1-1].i, c.ar[2-1].i, c.ar[3-1].i, c.ar[4-1].i);
+
+ return (b.a4.i != 42 || c.ar[3].i != 42);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init12.C b/gcc/testsuite/g++.old-deja/g++.other/init12.C
new file mode 100644
index 000000000..9b7242699
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init12.C
@@ -0,0 +1,22 @@
+// { dg-do link }
+// { dg-options "-O3" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+typedef int (*fp)();
+
+struct S
+{
+ fp f;
+};
+
+struct T
+{
+ static int f() { return 0; }
+};
+
+static const S s = { &T::f };
+
+int main()
+{
+ return (*s.f)();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init13.C b/gcc/testsuite/g++.old-deja/g++.other/init13.C
new file mode 100644
index 000000000..a658c29cd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init13.C
@@ -0,0 +1,13 @@
+// { dg-do link }
+// { dg-options "-O3" }
+// Origin: Gabriel Dos_Reis <Gabriel.Dos_Reis@sophia.inria.fr>
+
+void f() {}
+
+struct X {
+ ~X() { f (); }
+};
+
+X x;
+
+int main () {}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init14.C b/gcc/testsuite/g++.old-deja/g++.other/init14.C
new file mode 100644
index 000000000..e3fca53f6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init14.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// Origin: bkoz@nabi.net
+
+typedef struct
+{
+ int count;
+} mbstate_t;
+
+struct fpos
+{
+ mbstate_t _M_st;
+ fpos(int __pos)
+ : _M_st() {
+ }
+};
+
+int main ()
+{
+ fpos f (2);
+}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init15.C b/gcc/testsuite/g++.old-deja/g++.other/init15.C
new file mode 100644
index 000000000..022f2ef98
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init15.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation
+// Contributed by Nathan Sidwell 21 June 2000 <nathan@codesourcery.com>
+
+// Origin GNATS bug report 136 from
+// language specific constants caused the backend's constant caching machinery
+// to fall over.
+
+struct A {
+ const char *name;
+ int reserved;
+ int a;
+ int b;
+ void (A::*func)();
+ void Fn ();
+};
+
+void Interpret() {
+ struct A cmd_list =
+ {"a",0,0, 0,&A::Fn}
+ ;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init16.C b/gcc/testsuite/g++.old-deja/g++.other/init16.C
new file mode 100644
index 000000000..de4c0ad97
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init16.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+struct bar {
+ char c;
+ bar (const char *);
+ bar (const bar &);
+};
+
+struct foo {
+ bar x;
+};
+
+extern const struct foo y = { "foo" };
+
+bar::bar (const bar &ref)
+{
+ c = ref.c;
+}
+
+bar::bar (const char *p)
+{
+ c = p[2];
+}
+
+int main ()
+{
+ return y.x.c != 'o';
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init17.C b/gcc/testsuite/g++.old-deja/g++.other/init17.C
new file mode 100644
index 000000000..32b2f1d60
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init17.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Jan 2001 <nathan@codesourcery.com>
+
+// Bug 1631. Default initialization of enumeral types did not convert to the
+// enumeral type.
+
+enum X { alpha, beta };
+
+void f(void *ptr)
+{
+ X y = X ();
+ X y1 (0); // { dg-error "" } cannot convert
+ X y2 = X (0);
+ X *x = new X ();
+ X *x2 = new X (0); // { dg-error "" } cannot convert
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init18.C b/gcc/testsuite/g++.old-deja/g++.other/init18.C
new file mode 100644
index 000000000..db579452d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init18.C
@@ -0,0 +1,42 @@
+// Some targets (e.g. those with "set_board_info needs_status_wrapper 1"
+// in their dejagnu baseboard description) require that the status is
+// final when exit is entered (or main returns), and not "overruled" by a
+// destructor calling _exit. It's not really worth it to handle that.
+//
+// Any platform that doesn't have proper __cxa_atexit support will also fail.
+//
+// { dg-do run }
+// { dg-require-effective-target unwrapped }
+// { dg-require-effective-target cxa_atexit }
+
+#include <stdlib.h>
+extern "C" void _exit (int);
+
+static int cnt = 0;
+
+class Foo2
+{
+ public:
+ Foo2() {}
+ ~Foo2() { if (++cnt == 2) _exit (0); }
+};
+
+static Foo2& GetFoo2()
+{
+ static Foo2 foo2;
+ return foo2;
+}
+
+class Foo1
+{
+ public:
+ Foo1() {}
+ ~Foo1() { if (++cnt != 1) abort(); GetFoo2(); }
+};
+
+int main( int argc, const char* argv[] )
+{
+ static Foo1 anotherFoo;
+ exit (1);
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init19.C b/gcc/testsuite/g++.old-deja/g++.other/init19.C
new file mode 100644
index 000000000..bcbe82287
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init19.C
@@ -0,0 +1,85 @@
+// { dg-do run { xfail { { ! cxa_atexit } && { ! { mips-sgi-irix* *-*-solaris2* } } } } }
+#include <stdlib.h>
+
+#define assert(x) do { if (! (x)) abort(); } while (0)
+
+int count = 0;
+
+class A
+{
+public:
+ explicit A(int i);
+ ~A();
+
+ int i;
+
+ A(const A&);
+ A& operator=(const A&);
+};
+
+A::A(int i_)
+ : i(i_)
+{
+}
+
+A::~A()
+{
+ assert(++count == i);
+ i = -1;
+}
+
+extern "C" {
+
+void one()
+{
+ static bool second_time;
+ if (second_time)
+ assert(++count == 9);
+ else
+ {
+ assert(++count == 1);
+ second_time = true;
+ }
+ static A a(10);
+ assert(a.i == 10);
+}
+
+void two()
+{
+ assert(++count == 7);
+ static A a(8);
+ assert(a.i == 8);
+}
+
+void three()
+{
+ assert(++count == 2);
+ static A a(6);
+ assert(a.i == 6);
+}
+
+void five()
+{
+ assert(++count == 4);
+ static A a(5);
+ assert(a.i == 5);
+}
+
+void four()
+{
+ assert(++count == 3);
+ atexit(five);
+}
+
+}
+
+A zero(11);
+
+int main()
+{
+ one();
+ atexit(one);
+ atexit(two);
+ three();
+ atexit(four);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init2.C b/gcc/testsuite/g++.old-deja/g++.other/init2.C
new file mode 100644
index 000000000..681229241
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init2.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// { dg-options "-O3" }
+
+typedef int (*fp)();
+
+struct S
+{
+ fp f;
+};
+
+static int f()
+{
+ return 0;
+}
+
+static const S s = { &f };
+
+int main()
+{
+ return (*s.f)();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init3.C b/gcc/testsuite/g++.old-deja/g++.other/init3.C
new file mode 100644
index 000000000..d9eb65447
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init3.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+struct X
+{
+ static const bool is_signed = true ;
+ static const int digits = is_signed ? 8 *sizeof(wchar_t)-1 : 0;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init4.C b/gcc/testsuite/g++.old-deja/g++.other/init4.C
new file mode 100644
index 000000000..f877f2a87
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init4.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+class error {
+public:
+ error(int) {}
+};
+
+class foo {
+ const error x = 1; // { dg-error "" } initialization of non-static data member
+};
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init5.C b/gcc/testsuite/g++.old-deja/g++.other/init5.C
new file mode 100644
index 000000000..7bb263a93
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init5.C
@@ -0,0 +1,29 @@
+// { dg-do run { xfail { ! cxa_atexit } } }
+// Objects must be destructed in decreasing cnt order
+// Original test attributed to James Kanze <jkanze@otelo.ibmmail.com>
+
+extern "C" void abort ();
+
+static int cnt;
+
+class A {
+ int myCnt;
+public:
+ A() : myCnt(cnt++) {}
+ ~A() { if (--cnt != myCnt) abort(); }
+};
+
+void f() { static A a; /* a.myCnt == 1 */ }
+
+class B {
+ int myCnt;
+public:
+ B() : myCnt(cnt+1) { f(); ++cnt; }
+ ~B() { if (--cnt != myCnt) abort(); }
+};
+
+static A a1; // a1.myCnt == 0
+static B b1; // b1.myCnt == 2
+static A a2; // a2.myCnt == 3
+
+int main() {}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init6.C b/gcc/testsuite/g++.old-deja/g++.other/init6.C
new file mode 100644
index 000000000..66e511a6b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init6.C
@@ -0,0 +1,13 @@
+// { dg-do run }
+// Test for default-initialization of POD-structs in functional cast notation.
+
+struct foo { int a[10]; };
+
+int main()
+{
+ foo f = foo();
+ int r = 0;
+ for (int i = 0; i < 10; ++i)
+ r |= f.a[i];
+ return r;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init7.C b/gcc/testsuite/g++.old-deja/g++.other/init7.C
new file mode 100644
index 000000000..e6c7dc151
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init7.C
@@ -0,0 +1,31 @@
+// { dg-do run }
+// simplified from testcase in Windows Developer Journal,
+// submitted by eyal.ben-david@aks.com
+
+// The initialization of a static local variable must be retried if a
+// previous try finished by throwing an exception [stmt.dcl]/4
+
+extern "C" void abort ();
+
+struct foo {
+ foo() { throw true; }
+};
+
+void bar() {
+ static foo baz;
+}
+
+int main() {
+ try {
+ bar(); // must throw
+ }
+ catch (bool) {
+ try {
+ bar(); // must throw again!
+ }
+ catch (bool) {
+ return 0;
+ }
+ }
+ abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init8.C b/gcc/testsuite/g++.old-deja/g++.other/init8.C
new file mode 100644
index 000000000..0b4b2945c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init8.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+// submitted by David C Binderman <dcb@pncl.co.uk>
+
+// According to [dcl.init]/9, this should be ill-formed
+
+void
+f()
+{
+ const int var [ 10 ]; // { dg-error "" } missing initializer
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init9.C b/gcc/testsuite/g++.old-deja/g++.other/init9.C
new file mode 100644
index 000000000..6780b5a97
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/init9.C
@@ -0,0 +1,40 @@
+// { dg-do assemble }
+
+// Based on a testcase submitted by Tudor Hulubei <tudor@cs.unh.edu>
+
+// X is not a POD because it has a user-defined destructor.
+// Therefore, we can't cross its initialization.
+
+// vector<int> is not even an aggregate; nevertheless, no error is
+// reported...
+
+struct A {
+ A() {}
+};
+
+void a() {
+ goto bar; // { dg-error "" } jump from here
+ A x; // { dg-error "" } jump crosses initialization
+ bar: // { dg-error "" } jump to here
+ ;
+}
+
+struct X {
+ ~X() {}
+};
+
+void b() {
+ goto bar; // { dg-error "" } jump from here
+ X x; // { dg-error "" } jump crosses initialization
+ bar: // { dg-error "" } jump to here
+ ;
+}
+
+#include <vector>
+
+void c() {
+ goto bar; // { dg-error "" } jump from here
+ std::vector<int> x; // { dg-error "" } jump crosses initialization
+ bar: // { dg-error "" } jump to here
+ ;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/initstring.C b/gcc/testsuite/g++.old-deja/g++.other/initstring.C
new file mode 100644
index 000000000..d56189260
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/initstring.C
@@ -0,0 +1,3 @@
+// { dg-do assemble }
+
+static const char foo[] = { "bar" };
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline1.C b/gcc/testsuite/g++.old-deja/g++.other/inline1.C
new file mode 100644
index 000000000..d862f00fb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline1.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-O2 -Winline" }
+// Origin: Martin Reinecke <martin@MPA-Garching.MPG.DE>
+
+class foo
+{
+ public:
+ float x;
+
+ foo (float xval)
+ : x (xval) {}
+
+ foo operator+ (const foo &foo2) const
+ { return foo (x+foo2.x); }
+};
+
+int main()
+{
+ foo f=foo(1)+foo(2);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline10.C b/gcc/testsuite/g++.old-deja/g++.other/inline10.C
new file mode 100644
index 000000000..cd2415753
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline10.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+};
+
+inline const S f ()
+{
+ return S ();
+}
+
+void g ()
+{
+ S s;
+ f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline11.C b/gcc/testsuite/g++.old-deja/g++.other/inline11.C
new file mode 100644
index 000000000..56d803b64
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline11.C
@@ -0,0 +1,34 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class baz
+{
+public:
+ baz& operator += (const baz&);
+};
+
+inline baz& baz::operator += (const baz& r)
+{
+ return *this;
+}
+
+inline baz operator + (int x, const baz& y)
+{
+ return y;
+}
+
+static inline baz bar (int alpha);
+static inline baz foo (int alpha)
+{
+ baz tmp = alpha + foo (alpha);
+ tmp += alpha + bar (alpha);
+ return tmp;
+}
+
+static inline baz bar (int alpha)
+{
+ baz tmp = alpha + bar (alpha);
+ tmp += alpha + foo (alpha);
+ return tmp;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline12.C b/gcc/testsuite/g++.old-deja/g++.other/inline12.C
new file mode 100644
index 000000000..c91845c41
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline12.C
@@ -0,0 +1,326 @@
+// { dg-do assemble }
+// { dg-options "-O2 -g" }
+// (Should preferrably cycle through options.)
+// Origin: Hans-Peter Nilsson <hp@axis.com>
+// See <URL:http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00310.html>
+
+typedef unsigned int udword;
+extern "C" {
+void __assert (const char *, int, const char *);
+}
+class ShZzy;
+class ShBe;
+class Sh
+{
+ public:
+ class Xy;
+ inline Sh(const char* theName,
+ const Xy& theXys);
+ virtual ~Sh();
+ inline const char* name() const;
+ inline bool shXy(const Xy& theXy);
+ virtual void setParent(Sh* theParent);
+ class Xy
+ {
+ public:
+ Xy(int theXy);
+ Xy(const Xy& theXy);
+ Xy& operator = (const Xy&);
+ bool sh(const Xy& theXy);
+ private:
+ int myXyFlags;
+ };
+ protected:
+ Xy myXys;
+ private:
+ Sh();
+ Sh(const Sh&);
+ Sh& operator = (const Sh&);
+ const char* myName;
+ Sh* myParent;
+};
+class ShZzy : public Sh
+{
+ public:
+ inline ShZzy(const char* theName);
+ inline ShZzy(const char* theName,
+ const Xy& theXys);
+ virtual ~ShZzy();
+ void addShTo(char* theParent);
+ virtual void ap() {}
+ void addSh(Sh* theSh);
+ virtual void setParent(Sh* theParent);
+ void baseAp();
+ private:
+ ShZzy();
+ ShZzy(const ShZzy&);
+ ShZzy& operator = (const ShZzy&);
+ bool iAmInited;
+};
+class ShBop
+{
+ public:
+ inline ShBop(const ShBe* theBe);
+ void shWw(bool,
+ const char* a1 = "",
+ const char* a2 = "",
+ int a3 = -1,
+ const char* a4 = "foo");
+ typedef enum { shOk,
+ shFailed,
+ shDone,
+ invalidBop } bopType;
+ inline bopType bop();
+ inline int numberOfVs();
+ inline void closeBop();
+ private:
+ ShBop(const ShBop&);
+ ShBop& operator = (const ShBop&);
+ const ShBe* myBe;
+ bopType myBop;
+ int my1;
+ int my2;
+ const char* my3;
+ const char* my4;
+ int my5;
+ const char* my6;
+};
+Sh::Sh(const char* theName,
+ const Xy& theXys)
+ :myXys(theXys),
+ myName(theName),
+ myParent(0)
+{}
+const char*
+Sh::name() const
+{
+ return myName;
+}
+bool
+Sh::shXy(const Xy& theXy)
+{
+ return myXys.sh(theXy);
+}
+ShZzy::ShZzy(const char* theName)
+ :Sh(theName, Xy(0)),
+ iAmInited(false)
+{}
+ShZzy::ShZzy(const char* theName,
+ const Xy& theXys)
+ :Sh(theName, theXys),
+ iAmInited(false)
+{}
+ShBop::ShBop(const ShBe* theBe)
+ :myBe(theBe),
+ myBop(invalidBop),
+ my1(0),
+ my2(0),
+ my3(""),
+ my4(""),
+ my5(0),
+ my6("")
+{}
+ShBop::bopType
+ShBop::bop()
+{
+ ((!my2 || myBop == shFailed) ? (void)0 : __assert("foo", 91,"foo"));
+ return myBop;
+}
+int
+ShBop::numberOfVs()
+{
+ return my2 + my1;
+}
+void
+ShBop::closeBop()
+{
+ if (myBop == invalidBop)
+ {
+ myBop = shDone;
+ }
+}
+class ShBe;
+template <class ShCc>
+class ShAp : public ShZzy
+{
+ public:
+ ShAp(const char* theName);
+ ShAp(const char* theName,
+ const Xy& theXys);
+ virtual ~ShAp() {}
+ typedef void (ShCc::*ShMethod)();
+ virtual void ap() {}
+ protected:
+ ShBop* bop();
+ private:
+ ShAp();
+ ShAp(const ShAp&);
+ ShAp& operator = (const ShAp&);
+ ShBop* myBop;
+ ShBe* myBe;
+};
+class ShBe : public Sh
+{
+ public:
+ inline ShBe(const char* theName);
+ inline ShBe(const char* theName,
+ const Xy& theXys);
+ inline virtual ~ShBe();
+ virtual void run() = 0;
+ ShBop* runBe();
+ protected:
+ inline ShBop* bop();
+ private:
+ ShBe();
+ ShBe(const ShBe&);
+ ShBe& operator = (const ShBe&);
+ ShBop* myBop;
+};
+template <class ShCc>
+ShAp<ShCc>::ShAp(const char* theName)
+ : ShZzy(theName),
+ myBop(0),
+ myBe(0)
+{}
+template <class ShCc>
+ShAp<ShCc>::ShAp(const char* theName,
+ const Sh::Xy& theXys)
+ : ShZzy(theName, theXys),
+ myBop(0),
+ myBe(0)
+{}
+template <class ShCc>
+ShBop*
+ShAp<ShCc>::bop()
+{
+ ((myBop) ? (void)0 : __assert("foo", 96,"foo"));
+ return myBop;
+}
+class xSh : public ShAp<xSh>
+{
+ public:
+ xSh();
+ virtual ~xSh();
+ void ap();
+ void uff();
+ void rtt();
+};
+class xUff
+{
+ public:
+ xUff();
+ xUff(const xUff&);
+ xUff& operator = (const xUff&);
+ xUff(udword);
+ operator udword() const;
+ xUff& operator = (udword);
+ bool operator < (const xUff) const;
+ bool operator <= (const xUff) const;
+ bool operator > (const xUff) const;
+ bool operator >= (const xUff) const;
+ bool operator == (const xUff) const;
+ enum {size = 4};
+ xUff(unsigned char* theUff);
+ private:
+ udword myUff;
+};
+inline
+xUff::xUff()
+ : myUff(0)
+{
+}
+inline
+xUff::xUff(udword theUff)
+ : myUff(theUff)
+{
+}
+inline
+xUff::xUff(
+ const xUff& theUff)
+ : myUff(theUff.myUff)
+{
+}
+inline xUff&
+xUff::operator = (const xUff& theUff)
+{
+ myUff = theUff.myUff;
+ return *this;
+}
+inline xUff&
+xUff::operator = (udword theUff)
+{
+ myUff = theUff;
+ return *this;
+}
+inline
+xUff::operator udword() const
+{
+ return myUff;
+}
+inline bool
+xUff::operator < (const xUff ding) const
+{
+ return (((int) (myUff - ding.myUff)) < 0);
+}
+inline bool
+xUff::operator <= (const xUff ding) const
+{
+ return (((int) (myUff - ding.myUff)) <= 0);
+}
+inline bool
+xUff::operator > (const xUff ding) const
+{
+ return (((int) (myUff - ding.myUff)) > 0);
+}
+inline bool
+xUff::operator >= (const xUff ding) const
+{
+ return (((int) (myUff - ding.myUff)) >= 0);
+}
+inline bool
+xUff::operator == (const xUff ding) const
+{
+ return (myUff == ding.myUff);
+}
+inline
+xUff::xUff(unsigned char* theUff)
+{
+ myUff = *(udword *)theUff;
+}
+void
+xSh::uff()
+{
+ static const udword halfudword = 0x80000000;
+ xUff aGah((udword)0);
+ udword diagonal = halfudword + (udword) aGah;
+ xUff aGeh(diagonal - 1);
+ xUff aGoh(diagonal + 1);
+ (bop()->shWw ((aGah.operator <=(aGah)), ("foo"), ( ""), 118, "foo"));
+ (bop()->shWw ((aGah.operator >=(aGah)), ("foo"), ( ""), 119, "foo"));
+ (bop()->shWw ((!(aGah.operator <(aGah))), ("foo"), ( ""), 120, "foo"));
+ (bop()->shWw ((!(aGah.operator >(aGah))), ("foo"), ( ""), 121, "foo"));
+ (bop()->shWw ((aGah.operator <(aGeh)), ("foo"), ( ""), 124, "foo"));
+ (bop()->shWw ((aGah.operator <=(aGeh)), ("foo"), ( ""), 125, "foo"));
+ (bop()->shWw ((!(aGah.operator >(aGeh))), ("foo"), ( ""), 126, "foo"));
+ (bop()->shWw ((!(aGah.operator >=(aGeh))), ("foo"), ( ""), 127, "foo"));
+ (bop()->shWw ((aGeh.operator >(aGah)), ("foo"), ( ""), 130, "foo"));
+ (bop()->shWw ((aGeh.operator >=(aGah)), ("foo"), ( ""), 131, "foo"));
+ (bop()->shWw ((!(aGeh.operator <(aGah))), ("foo"), ( ""), 132, "foo"));
+ (bop()->shWw ((!(aGeh.operator <=(aGah))), ("foo"), ( ""), 133, "foo"));
+ (bop()->shWw ((aGeh.operator <(aGoh)), ("foo"), ( ""), 136, "foo"));
+ (bop()->shWw ((aGeh.operator <=(aGoh)), ("foo"), ( ""), 137, "foo"));
+ (bop()->shWw ((!(aGeh.operator >(aGoh))), ("foo"), ( ""), 138, "foo"));
+ (bop()->shWw ((!(aGeh.operator >=(aGoh))), ("foo"), ( ""), 139, "foo"));
+ (bop()->shWw ((aGoh.operator >(aGeh)), ("foo"), ( ""), 142, "foo"));
+ (bop()->shWw ((aGoh.operator >=(aGeh)), ("foo"), ( ""), 143, "foo"));
+ (bop()->shWw ((!(aGoh.operator <(aGeh))), ("foo"), ( ""), 144, "foo"));
+ (bop()->shWw ((!(aGoh.operator <=(aGeh))), ("foo"), ( ""), 145, "foo"));
+ (bop()->shWw ((aGah.operator >(aGoh)), ("foo"), ( ""), 152, "foo"));
+ (bop()->shWw ((aGah.operator >=(aGoh)), ("foo"), ( ""), 153, "foo"));
+ (bop()->shWw ((!(aGah.operator <(aGoh))), ("foo"), ( ""), 154, "foo"));
+ (bop()->shWw ((!(aGah.operator <=(aGoh))), ("foo"), ( ""), 155, "foo"));
+ (bop()->shWw ((aGoh.operator <(aGah)), ("foo"), ( ""), 158, "foo"));
+ (bop()->shWw ((aGoh.operator <=(aGah)), ("foo"), ( ""), 159, "foo"));
+ (bop()->shWw ((!(aGoh.operator >(aGah))), ("foo"), ( ""), 160, "foo"));
+ (bop()->shWw ((!(aGoh.operator >=(aGah))), ("foo"), ( ""), 161, "foo"));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline13.C b/gcc/testsuite/g++.old-deja/g++.other/inline13.C
new file mode 100644
index 000000000..bf8e52e01
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline13.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Origin: Alexandre Oliva <aoliva@cygnus.com>
+
+struct foo {
+ inline void bar();
+ foo();
+};
+
+inline void foo::bar() {
+ switch (0) {
+ case 0:
+ break;
+ }
+}
+
+foo::foo() {
+ bar();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline14.C b/gcc/testsuite/g++.old-deja/g++.other/inline14.C
new file mode 100644
index 000000000..1bd74b4ac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline14.C
@@ -0,0 +1,49 @@
+// { dg-do assemble }
+// Origin: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+#include <iostream>
+
+struct IDENT
+ {
+ enum TYPE { Variable, Constant } type;
+
+ std::ostream& printTo(std::ostream& out) const
+ {
+ switch (type)
+ {
+ case Variable:
+ out << '_';
+ break;
+ default:
+ break;
+ }
+ return out;
+ }
+ };
+
+
+template <class T>
+struct TC
+ {
+ IDENT i;
+
+ const IDENT& getIdent() const
+ {
+ return i;
+ }
+ };
+
+template <class T>
+inline std::ostream& operator<< (std::ostream& out, const TC<T> &c)
+ {
+ c.getIdent().printTo(out);
+ return out;
+ }
+
+void foo(const TC<IDENT> &c)
+ {
+ std::cerr << c
+ << ": " // This line is crucial!
+ << c
+ << std::endl;
+ }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline15.C b/gcc/testsuite/g++.old-deja/g++.other/inline15.C
new file mode 100644
index 000000000..43f7f5e30
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline15.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// { dg-options "-O1" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+class Type;
+template<class E>
+class X
+{
+public:
+ X<E>();
+ inline X<E>(int);
+ inline ~X<E>();
+};
+template<class E> const Type &foo(const X<E> *);
+template<class E> inline X<E>::X(int x)
+{
+ const Type &a = foo(this);
+}
+template<class E> inline X<E>::~X()
+{
+ const Type &a = foo(this);
+}
+class Y
+{
+ X<Type> a;
+public:
+ Y(const X<Type> &x = X<Type>());
+};
+Y::Y(const X<Type> &x) : a(1)
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline16.C b/gcc/testsuite/g++.old-deja/g++.other/inline16.C
new file mode 100644
index 000000000..95bfa7aac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline16.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// { dg-options "-O1" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+struct foo {
+ bool x;
+ inline void a (unsigned char y);
+ inline void b (void);
+ virtual ~foo ();
+};
+
+foo::~foo ()
+{
+}
+
+void foo::a (unsigned char y)
+{
+ x = ((y & 2) != 0);
+}
+
+void foo::b (void)
+{
+ a(0x07);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline17.C b/gcc/testsuite/g++.old-deja/g++.other/inline17.C
new file mode 100644
index 000000000..b7890e7ef
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline17.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// { dg-options "-O3" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+struct foo
+{
+ char a;
+ foo ();
+ void bar ();
+ void baz (char c);
+};
+
+void foo::baz (char c)
+{
+ if (c != a)
+ a = c;
+}
+
+void foo::bar ()
+{
+ baz (1);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline18.C b/gcc/testsuite/g++.old-deja/g++.other/inline18.C
new file mode 100644
index 000000000..70c4cf6e0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline18.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// { dg-options "-O3" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+static void foo (int a)
+{
+ a = a;
+}
+
+static void bar (void)
+{
+ foo (-1);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline19.C b/gcc/testsuite/g++.old-deja/g++.other/inline19.C
new file mode 100644
index 000000000..76731a56e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline19.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// { dg-options "-O1" }
+// Origin: Scott Snyder <snyder@fnal.gov> via PR 1733.
+//
+
+struct TBtItem
+{
+ TBtItem();
+};
+
+
+struct TBtInnerNode
+{
+ TBtInnerNode();
+ int MaxIndex() const { return 10; }
+};
+
+
+TBtInnerNode::TBtInnerNode()
+{
+ new TBtItem[MaxIndex()+1];
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline2.C b/gcc/testsuite/g++.old-deja/g++.other/inline2.C
new file mode 100644
index 000000000..f1d196266
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline2.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// { dg-options "-O2 -Winline" }
+// Origin: Martin Reinecke <martin@MPA-Garching.MPG.DE>
+
+#include <cmath>
+
+int main()
+{
+ double foo = 4.5;
+ if (std::abs (0.5-std::abs (foo-0.5)) < 1e-10) foo+=1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline20.C b/gcc/testsuite/g++.old-deja/g++.other/inline20.C
new file mode 100644
index 000000000..0e94291fb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline20.C
@@ -0,0 +1,58 @@
+// { dg-do assemble }
+
+struct A {
+ int a, b, c, d;
+};
+
+inline void foo (int, A &);
+
+struct D {
+};
+
+struct E: public D {
+ void f (A &y)
+ {
+ foo (1, y);
+ }
+};
+
+struct F: public D {
+ void f (A &y)
+ {
+ foo (2, y);
+ }
+};
+
+E *d;
+F *e;
+
+inline int baz (int y)
+{
+ A a;
+ if (y) {
+ d->f (a);
+ } else {
+ e->f (a);
+ }
+ return 0;
+}
+
+inline void foo (int y, A &z)
+{
+ z.a = baz (y);
+ z.b = baz (y);
+ z.c = baz (y);
+ z.d = baz (y);
+}
+
+struct G {
+ E a;
+ F b;
+ void bar (A &);
+};
+
+void G::bar(A &y)
+{
+ a.f(y);
+ b.f(y);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline21.C b/gcc/testsuite/g++.old-deja/g++.other/inline21.C
new file mode 100644
index 000000000..25715acab
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline21.C
@@ -0,0 +1,40 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Origin: suckfish@ihug.co.nz
+
+// DECLARATIONS
+
+struct Record {
+ Record (int bb) :
+ b (bb)
+ { }
+ int extra; // Having an extra member in record is crucial.
+ int b;
+};
+
+struct Container {
+ Record record;
+ // The const on the next line is crucial.
+ Container ( const Record b) : record(b) {}
+};
+
+
+// TEST FOR CORRECT BEHAVIOR
+
+int myArray[3];
+int * intp = myArray;
+
+void use_pair (const Container & c)
+{
+ *intp++ = c.record.b;
+}
+
+extern "C" int printf (const char *,...);
+
+int main()
+{
+ use_pair (Container (1234));
+
+ if (myArray[0] != 1234)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline23.C b/gcc/testsuite/g++.old-deja/g++.other/inline23.C
new file mode 100644
index 000000000..dcb443be1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline23.C
@@ -0,0 +1,28 @@
+// { dg-do link }
+
+struct B
+{
+ virtual ~B() {}
+};
+
+struct A : public B
+{
+ ~A();
+ void foo(void);
+ void bar(void);
+};
+
+inline void A::foo(void)
+{
+ static int i;
+ i++;
+}
+
+void A::bar()
+{
+ foo();
+}
+
+int main()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline3.C b/gcc/testsuite/g++.old-deja/g++.other/inline3.C
new file mode 100644
index 000000000..a61410015
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline3.C
@@ -0,0 +1,51 @@
+// { dg-do assemble }
+// { dg-options "-O3" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+class ostream;
+
+struct S
+{
+ virtual void print(ostream&) const = 0;
+};
+
+template <class _Tp>
+class vector
+{
+public:
+ _Tp& operator[](unsigned __n) const { return *(_M_start + __n); }
+ _Tp* _M_start;
+};
+
+class T
+{
+public:
+
+ void print(ostream&) const;
+
+ vector<S*> bcList_m;
+};
+
+void T::print(ostream& o) const
+{
+ int n = 3;
+
+ for (int i = 0; i < n; ++i)
+ bcList_m[i]->print(o);
+ return;
+}
+
+ostream&
+operator<<(ostream& o, const T& bcList)
+{
+ bcList.print(o);
+ return o;
+}
+
+
+
+
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline4.C b/gcc/testsuite/g++.old-deja/g++.other/inline4.C
new file mode 100644
index 000000000..b68c7c2c7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline4.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+inline void f ()
+{
+ return;
+}
+
+inline void g ();
+
+void (*gp)() = &g;
+
+inline void g ()
+{
+ f ();
+}
+
+extern int array_size;
+
+void h ()
+{
+ int lookup_array[array_size];
+ g ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline5.C b/gcc/testsuite/g++.old-deja/g++.other/inline5.C
new file mode 100644
index 000000000..b538cdba9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline5.C
@@ -0,0 +1,30 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Matt Austern <austern@isolde.engr.sgi.com>
+
+class X;
+
+extern X* tab1;
+
+struct Y {
+ explicit Y(int);
+};
+
+void* x ();
+
+Y k (void *);
+
+inline void f() { k (x ()); }
+
+inline void* x ()
+{
+ return 0;
+}
+
+static void g() {
+ f();
+}
+
+static void h() {
+ f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline6.C b/gcc/testsuite/g++.old-deja/g++.other/inline6.C
new file mode 100644
index 000000000..04de9fce4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline6.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+};
+
+void f (S s = S ());
+
+inline void g ()
+{
+ f ();
+}
+
+void h ()
+{
+ g ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline7.C b/gcc/testsuite/g++.old-deja/g++.other/inline7.C
new file mode 100644
index 000000000..a3723cfba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline7.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+#include <list>
+
+std::list<int*> li;
+
+void f ()
+{
+ li.size ();
+}
+
+int main ()
+{
+ li.push_back (0);
+ f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline8.C b/gcc/testsuite/g++.old-deja/g++.other/inline8.C
new file mode 100644
index 000000000..a46dc382a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline8.C
@@ -0,0 +1,69 @@
+// { dg-do run }
+// { dg-options "-O1" }
+// Origin: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+#include <map>
+#include <cstdlib>
+#include <cstring>
+
+using namespace std;
+
+class NAMES_ITEM
+ {
+public:
+ char *name;
+
+ NAMES_ITEM(const NAMES_ITEM& item2);
+
+ NAMES_ITEM(const char* name2);
+
+ ~NAMES_ITEM();
+
+ bool operator==(const NAMES_ITEM& n) const;
+ };
+
+
+NAMES_ITEM::NAMES_ITEM (const NAMES_ITEM& item2)
+ {
+ size_t length=std::strlen(item2.name);
+
+ name=new char[length+1];
+ std::memcpy(name,item2.name,length+1);
+ }
+
+NAMES_ITEM::NAMES_ITEM (const char* name2)
+ {
+ size_t length=std::strlen(name2);
+
+ name=new char[length+1];
+ std::memcpy(name,name2,length+1);
+ }
+
+NAMES_ITEM::~NAMES_ITEM ()
+{
+ if (std::strcmp (name, "one") != 0)
+ abort ();
+
+ name=0;
+}
+
+bool NAMES_ITEM::operator==(const NAMES_ITEM& n) const
+{
+ return (std::strcmp(name,n.name) == 0);
+}
+
+bool operator<(const NAMES_ITEM& n1, const NAMES_ITEM& n2)
+ {
+ return (std::strcmp(n1.name,n2.name) < 0);
+ }
+
+ typedef map<NAMES_ITEM,size_t,less<NAMES_ITEM> > lookup_t;
+
+ lookup_t lookup;
+
+ NAMES_ITEM item ("one");
+main()
+ {
+ lookup.insert(pair<NAMES_ITEM,size_t>(item,0));
+ }
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline9.C b/gcc/testsuite/g++.old-deja/g++.other/inline9.C
new file mode 100644
index 000000000..9a82fcf72
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline9.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Mark Mitchell <mitchell@codesourcery.com>
+
+inline void f ()
+{
+ int n;
+ int i[n];
+}
+
+void g ()
+{
+ f ();
+}
+
+void h ()
+{
+ f ();
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/instan1.C b/gcc/testsuite/g++.old-deja/g++.other/instan1.C
new file mode 100644
index 000000000..3c294c396
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/instan1.C
@@ -0,0 +1,24 @@
+// { dg-do link }
+// { dg-options "-fno-implicit-templates" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+struct U {
+ static int j;
+};
+
+template <class T>
+struct S {
+ static const int i = 7;
+};
+
+template <class T>
+const int S<T>::i;
+
+template <class T>
+int U<T>::j = S<T>::i + 5;
+
+template int U<double>::j;
+
+int main () {
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lex1.C b/gcc/testsuite/g++.old-deja/g++.other/lex1.C
new file mode 100644
index 000000000..4e172780c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lex1.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 April 2001 <nathan@codesourcery.com>
+
+// Bug 2510. We ICEd when a bogus char was present.
+
+void foo ()
+{
+ // there is a ctrl-h on the next line
+  // { dg-error "" } stray char
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lineno1.C b/gcc/testsuite/g++.old-deja/g++.other/lineno1.C
new file mode 100644
index 000000000..810052250
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lineno1.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "-w" }
+// Submitted by Nathan Sidwell <nathan@acm.org>
+// Bug: g++ was giving the wrong line number for statics.
+
+class A
+{
+ A(); // { dg-error "" } private
+ ~A(); // { dg-error "" } private
+};
+
+static A a; // { dg-error "" } here
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lineno2.C b/gcc/testsuite/g++.old-deja/g++.other/lineno2.C
new file mode 100644
index 000000000..3735d6481
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lineno2.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Submitted by Nathan Sidwell <nathan@acm.org>
+// Bug: g++ wasn't listing candidates for a failed conversion.
+
+void f(int, double); // { dg-error "" } candidate
+void f(double, int); // { dg-error "" } candidate
+void f(int); // { dg-error "" } candidate
+
+int
+main ()
+{
+ void (*ptr)(int, int);
+
+ ptr = &f; // { dg-error "" } no match
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lineno3.C b/gcc/testsuite/g++.old-deja/g++.other/lineno3.C
new file mode 100644
index 000000000..2b3ba059f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lineno3.C
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+// Bug: g++ gets confused by the #line directive within a method.
+// Contributed by Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ void f ()
+ {
+ int i;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ int j;
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lineno4.C b/gcc/testsuite/g++.old-deja/g++.other/lineno4.C
new file mode 100644
index 000000000..ce60e2c0f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lineno4.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+#define x \
+ y
+
+int; // { dg-error "" } invalid declaration
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lineno5.C b/gcc/testsuite/g++.old-deja/g++.other/lineno5.C
new file mode 100644
index 000000000..d22733953
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lineno5.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Jul 2001 <nathan@codesourcery.com>
+
+// Origin: johanb@DoCS.UU.SE
+// Bug 3621. At the end of saved input, we'd set the lineno to
+// zero. This would confusing things no end, if there was a subsequent
+// error.
+
+namespace tmp {
+ typedef int B;
+ B b; // { dg-message "tmp::b" }
+}
+
+class A {
+ public:
+ int kaka(tmp::B = b); // { dg-error "" } no b in scope
+ // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 18 }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage1.C b/gcc/testsuite/g++.old-deja/g++.other/linkage1.C
new file mode 100644
index 000000000..556ef9716
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage1.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+typedef struct {
+ int i;
+} *p;
+
+void f (p) { } // { dg-error "with no linkage" }
+p q; // { dg-warning "with no linkage" }
+
+int main()
+{
+ extern p j; // { dg-warning "with no linkage" }
+ struct A { int j; };
+ extern A a; // { dg-warning "with no linkage" }
+ extern void f (A); // { dg-error "with no linkage" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage2.C b/gcc/testsuite/g++.old-deja/g++.other/linkage2.C
new file mode 100644
index 000000000..2385b2216
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage2.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
+extern "C"
+{
+typedef struct {int dummy[10];} *GDBM_FILE;
+extern GDBM_FILE gdbm_open();
+}
+
+typedef struct { int dummy[10]; } *FAIL_FILE;
+extern FAIL_FILE fail_open(); // { dg-error "" } non-local function
+
+typedef struct { int dummy[10]; } *SUCCESS_FILE, S;
+extern SUCCESS_FILE success_open();
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage3.C b/gcc/testsuite/g++.old-deja/g++.other/linkage3.C
new file mode 100644
index 000000000..8ddff82f5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage3.C
@@ -0,0 +1,5 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+extern "C" void f (); // { dg-error "" } previous declaration
+static void f () {} // { dg-error "" } extern redeclared static
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage4.C b/gcc/testsuite/g++.old-deja/g++.other/linkage4.C
new file mode 100644
index 000000000..7531f4516
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage4.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+static int strlen (const char*) { return 0; }
+
+template <int (*)(const char*)>
+void f () {}
+
+// Check that the strlen declaration here is given internal linkage by
+// using it as a non-type template argument, and expecting an error.
+template void f<strlen>(); // { dg-error "" } no matching template
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage5.C b/gcc/testsuite/g++.old-deja/g++.other/linkage5.C
new file mode 100644
index 000000000..7c420c116
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage5.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+static int f ();
+int f ();
+static int f ();
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage6.C b/gcc/testsuite/g++.old-deja/g++.other/linkage6.C
new file mode 100644
index 000000000..516a24267
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage6.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-fno-weak" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <typename T>
+void f ();
+
+void h () { f<int> (); }
+
+template <void (*X)()>
+void g () {}
+
+template <typename T>
+void f ()
+{
+ g<&f<T> >();
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage7.C b/gcc/testsuite/g++.old-deja/g++.other/linkage7.C
new file mode 100644
index 000000000..d1470a9ed
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage7.C
@@ -0,0 +1,14 @@
+// { dg-do link }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+namespace N {
+ extern "C" int i;
+
+ void f () {
+ i = 3;
+ }
+}
+
+int i;
+
+int main () { N::f (); }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/local-alloc1.C b/gcc/testsuite/g++.old-deja/g++.other/local-alloc1.C
new file mode 100644
index 000000000..7488f1971
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/local-alloc1.C
@@ -0,0 +1,17 @@
+// { dg-do assemble { target fpic } }
+// { dg-options "-O0 -fpic" }
+// { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+struct bar {
+ bar() {}
+ double x[3];
+};
+
+static bar y[4];
+
+void foo(int z)
+{
+ bar w;
+ y[z] = w;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/local1.C b/gcc/testsuite/g++.old-deja/g++.other/local1.C
new file mode 100644
index 000000000..a51d50be7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/local1.C
@@ -0,0 +1,13 @@
+// { dg-do link }
+
+struct Outer {
+ virtual ~Outer() {}
+};
+
+int
+main()
+{
+ { struct Inner : virtual public Outer {} inner; }
+ { struct Inner : virtual public Outer {} inner; }
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/local2.C b/gcc/testsuite/g++.old-deja/g++.other/local2.C
new file mode 100644
index 000000000..12b777ce3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/local2.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+
+void f ()
+{
+ struct Init {
+ Init () {
+ }
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/local3.C b/gcc/testsuite/g++.old-deja/g++.other/local3.C
new file mode 100644
index 000000000..3879b141d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/local3.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// Bug: g++ lies about DECL_CONTEXT, so the backend thinks B::f is not
+// function-local.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+struct A {
+ virtual void f () = 0;
+};
+
+int main()
+{
+ struct B : public A {
+ void f () { }
+ };
+
+ B b;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/local4.C b/gcc/testsuite/g++.old-deja/g++.other/local4.C
new file mode 100644
index 000000000..b5514a54b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/local4.C
@@ -0,0 +1,11 @@
+// { dg-do run }
+// Test that a local declaration of one of a global overload set works
+
+int f () { return 0; }
+int f (int);
+
+int main ()
+{
+ int f ();
+ return f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup1.C b/gcc/testsuite/g++.old-deja/g++.other/lookup1.C
new file mode 100644
index 000000000..c7f220fd6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup1.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// simple test for id from base class during class defn
+
+struct foo {
+ enum { blah = 1 };
+};
+struct bar : public foo {
+ char cache[blah];
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup10.C b/gcc/testsuite/g++.old-deja/g++.other/lookup10.C
new file mode 100644
index 000000000..a60071dab
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup10.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+struct A {
+ struct B {
+ static int i;
+ };
+ enum { a };
+};
+
+int A::B::i = a;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup11.C b/gcc/testsuite/g++.old-deja/g++.other/lookup11.C
new file mode 100644
index 000000000..d7f12ed41
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup11.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+
+namespace A {
+ int i;
+}
+using namespace A;
+namespace B {
+ int i;
+}
+using namespace B;
+
+int i;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup12.C b/gcc/testsuite/g++.old-deja/g++.other/lookup12.C
new file mode 100644
index 000000000..d283e2c29
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup12.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct B {
+ struct X {};
+};
+
+
+struct D : public B {
+ void X();
+
+ struct X x;
+
+ void f();
+};
+
+
+void D::f()
+{
+ struct X y;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup13.C b/gcc/testsuite/g++.old-deja/g++.other/lookup13.C
new file mode 100644
index 000000000..872c35ff0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup13.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int main()
+{
+ typedef double I;
+
+ struct S1 {
+ typedef char I;
+
+ struct S2;
+ };
+
+ struct S1::S2 {
+ typedef I J;
+ };
+
+ return !(sizeof (S1::S2::J) == 1);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup14.C b/gcc/testsuite/g++.old-deja/g++.other/lookup14.C
new file mode 100644
index 000000000..2d2560ee7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup14.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+union U {
+ typedef int I;
+
+ struct S {
+ void f();
+ };
+};
+
+void U::S::f() {
+ I i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup15.C b/gcc/testsuite/g++.old-deja/g++.other/lookup15.C
new file mode 100644
index 000000000..4d5ce70c2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup15.C
@@ -0,0 +1,37 @@
+// { dg-do assemble }
+// Origin: Benjamin Kosnik <bkoz@cygnus.com>
+
+class b
+{
+ int j;
+public:
+ b(int a = 6): j(a) {}
+ void imbue(int a) {++j;}
+};
+
+class d: public b
+{
+ int k;
+public:
+ d(int a = 7): b(a), k(a) {}
+ void imbue(int a) {++k;}
+};
+
+//virtual public kills, public ok
+class mostd: virtual public d
+{
+ int l;
+public:
+ mostd(int a = 9): d(a), l(a) {}
+};
+
+int main() {
+
+ d dobj;
+ dobj.imbue(5);
+
+ mostd mobj;
+ mobj.imbue(5);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup16.C b/gcc/testsuite/g++.old-deja/g++.other/lookup16.C
new file mode 100644
index 000000000..52944530d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup16.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Aug 1999 <nathan@acm.org>
+
+// Bug 3
+// typenames are not injected early enough, [basic.scope.pdecl]3.3.1/4
+// indicates this should compile.
+
+struct A {
+};
+
+struct B : A {
+ typedef A Parent;
+ struct F {
+ };
+};
+
+struct C : B {
+ typedef B Parent;
+ struct G {};
+ struct F : C::Parent::F {
+ typedef C::Parent::F Parent;
+ };
+};
+
+struct D : B {
+ typedef B Parent;
+ struct F : D::Parent::F { // finds the wrong Parent
+ typedef D::Parent::F Parent;
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup17.C b/gcc/testsuite/g++.old-deja/g++.other/lookup17.C
new file mode 100644
index 000000000..80a3b1a87
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup17.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+// Bug: t->B is resolved to the type instead of the field.
+
+struct A {
+ struct B { } *B;
+ int i, j, k, l, m;
+};
+
+struct A a;
+
+int
+main ()
+{
+ void *p = a.B;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup18.C b/gcc/testsuite/g++.old-deja/g++.other/lookup18.C
new file mode 100644
index 000000000..71124a2f0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup18.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// Test that referring to an ambiguous base in name lookup prevents
+// access to the field, even though the field is not ambiguous.
+
+
+struct A {
+ int i;
+};
+struct B: virtual A { };
+struct C: public B { };
+struct D: public B { };
+struct E: public C, public D {
+ void f ();
+};
+
+void E::f() {
+ B::i = 0; // { dg-error "" } B is ambiguous
+}
+
+void f () {
+ E e;
+ e.B::i = 0; // { dg-error "" } B is ambiguous
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup19.C b/gcc/testsuite/g++.old-deja/g++.other/lookup19.C
new file mode 100644
index 000000000..d4104f0fc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup19.C
@@ -0,0 +1,54 @@
+// { dg-do assemble }
+// Test for proper handling of type lookup for conversion operator names.
+
+// Test 1: Only at file scope
+typedef int B;
+struct A
+{
+ int B;
+ operator B *(); // { dg-error "" }
+};
+
+A::operator B * () // { dg-error "" }
+{
+ return 0;
+}
+
+// Test 2: Only at class scope
+struct C
+{
+ typedef int D;
+ operator D *();
+};
+
+int D;
+C::operator D * ()
+{
+ return 0;
+}
+
+// Test 3: Matching
+struct E
+{
+ typedef int F;
+ operator F *();
+};
+
+typedef int F;
+E::operator F * ()
+{
+ return 0;
+}
+
+// Test 4: Conflicting
+struct G
+{
+ typedef int H;
+ operator H *();
+};
+
+typedef double H;
+G::operator H * ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup2.C b/gcc/testsuite/g++.old-deja/g++.other/lookup2.C
new file mode 100644
index 000000000..567f7a43a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup2.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+struct B {
+ int i;
+};
+
+struct D: virtual public B {
+ int i;
+};
+
+struct D2 : public D {
+ void f() { i = 3; }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup20.C b/gcc/testsuite/g++.old-deja/g++.other/lookup20.C
new file mode 100644
index 000000000..ff2352159
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup20.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Bug: typename_sub2 returned the type, so we tried to look up "A" in B.
+
+struct A { struct A1 { }; };
+
+struct B {
+ typedef A Q;
+};
+
+struct C: public B::Q::A1 { };
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup21.C b/gcc/testsuite/g++.old-deja/g++.other/lookup21.C
new file mode 100644
index 000000000..3a7795de1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup21.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// Check that we don't complain about ambiguity between the same static
+// member function in different subobjects.
+
+struct A {
+ static void f() {}
+};
+
+struct B: public A { };
+struct C: public A { };
+struct D: public B, public C { };
+
+int main()
+{
+ D d;
+ d.f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup22.C b/gcc/testsuite/g++.old-deja/g++.other/lookup22.C
new file mode 100644
index 000000000..5246fab34
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup22.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: GerhardTonn@gmx.de
+
+struct super {
+ union {
+ int myName;
+ void* secondMember;
+ };
+};
+
+struct sub : super {
+ int myName() { return 1; }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup23.C b/gcc/testsuite/g++.old-deja/g++.other/lookup23.C
new file mode 100644
index 000000000..64cb9de49
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup23.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Test for proper handling of type lookup if base class has field with the
+// same name as the containing class.
+
+struct a { int a; };
+struct b : a {};
+
+b x;
+
+void foo ()
+{
+ x.a = 22;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup3.C b/gcc/testsuite/g++.old-deja/g++.other/lookup3.C
new file mode 100644
index 000000000..a2946b7b0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup3.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// Test to make sure that the use of __typeof__ in WIFEXITED works.
+
+int main ()
+{
+ int stat_loc = 0;
+ (__extension__
+ ({
+ union
+ {
+ __typeof__ (stat_loc) __in;
+ int __i;
+ } __u;
+ __u.__in = (stat_loc);
+ __u.__i;
+ })
+ );
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup4.C b/gcc/testsuite/g++.old-deja/g++.other/lookup4.C
new file mode 100644
index 000000000..8fa296892
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup4.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// Test for proper handling of references to overloaded member functions.
+
+struct A {
+ static void f (int) { }
+ void f ();
+};
+
+void (*p)(int) = &A::f;
+
+void A::f ()
+{
+ p = f;
+}
+
+int main()
+{
+ A a;
+ p = &a.f;
+ (a.f)();
+ (a.f)(42);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup5.C b/gcc/testsuite/g++.old-deja/g++.other/lookup5.C
new file mode 100644
index 000000000..65c6402f1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup5.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Simplified from bug report by Paris Smaragdis <paris@media.mit.edu>
+
+
+template <class T> class vector {};
+class foo {};
+int main() {
+ foo f;
+ f.vector(); // { dg-error "" } not a method
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup6.C b/gcc/testsuite/g++.old-deja/g++.other/lookup6.C
new file mode 100644
index 000000000..a66302b62
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup6.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+int f(int i)
+{
+ struct C {
+ int i;
+ C () : i(1) {}
+ int f() {
+ struct D {
+ int i;
+ D () : i(2) {}
+ int g() { return i; }
+ } d;
+
+ return d.g();
+ }
+ } c;
+
+ return c.f();
+}
+
+
+int main()
+{
+ if (f(0) != 2)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup7.C b/gcc/testsuite/g++.old-deja/g++.other/lookup7.C
new file mode 100644
index 000000000..53c4a3b3b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup7.C
@@ -0,0 +1,13 @@
+// { dg-do run }
+// Test for handling of type shadowing in function scope.
+
+int main()
+{
+ int A = 42;
+ struct A
+ {
+ enum { a };
+ };
+ A = A::a;
+ return A;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup8.C b/gcc/testsuite/g++.old-deja/g++.other/lookup8.C
new file mode 100644
index 000000000..61c3dd383
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup8.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+struct S {
+ int A;
+ struct A {
+ enum { a = 0 };
+ };
+
+ void f();
+};
+
+void S::f() {
+ A = A::a;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup9.C b/gcc/testsuite/g++.old-deja/g++.other/lookup9.C
new file mode 100644
index 000000000..688b379ca
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup9.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+struct S {
+ typedef long I;
+};
+
+struct D : virtual public S {
+ I i;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/loop1.C b/gcc/testsuite/g++.old-deja/g++.other/loop1.C
new file mode 100644
index 000000000..168734c54
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/loop1.C
@@ -0,0 +1,31 @@
+// { dg-do run }
+// { dg-options "-O2" }
+// Test for bad loop optimization of goto fixups.
+
+typedef bool (*ftype) ();
+
+int c, d;
+struct A {
+ A() { ++c; }
+ A(const A&) { ++c; }
+ ~A() { ++d; }
+};
+
+void f (ftype func)
+{
+ A a;
+ do {
+ if ((*func)()) return;
+ } while (true);
+}
+
+bool test ()
+{
+ return true;
+}
+
+main ()
+{
+ f (test);
+ return (c != d);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/loop2.C b/gcc/testsuite/g++.old-deja/g++.other/loop2.C
new file mode 100644
index 000000000..a9aa4a368
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/loop2.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// { dg-options "-O" }
+
+class foo {
+public:
+ operator const char*() const { return a; }
+ char *a;
+};
+
+class bar {
+public:
+ ~bar();
+ void operator++(int);
+ bool b() const;
+protected:
+ void* c() const;
+};
+
+class baz : public bar {
+public:
+ foo const &d() const { return *(foo *)bar::c(); }
+};
+
+extern int tst (const char *, const char *) throw();
+
+void die(const foo& x)
+{
+ for (baz hi; hi.b(); hi++)
+ if (tst (hi.d(), x) == 0)
+ return;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/main1.C b/gcc/testsuite/g++.old-deja/g++.other/main1.C
new file mode 100644
index 000000000..c5cfe8b9e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/main1.C
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+int main() // { dg-error "previous declaration" }
+{
+ return 0;
+}
+
+
+int main(int, const char**) // { dg-error "conflicts" }
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/main2.C b/gcc/testsuite/g++.old-deja/g++.other/main2.C
new file mode 100644
index 000000000..26013e4e7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/main2.C
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+double main () {} // { dg-error "" } main must return `int'
diff --git a/gcc/testsuite/g++.old-deja/g++.other/mangle10.C b/gcc/testsuite/g++.old-deja/g++.other/mangle10.C
new file mode 100644
index 000000000..b24fe716e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/mangle10.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+
+template<int T>
+struct A {
+ char *a;
+ A (const char* x)
+ {
+ a = (char*) x;
+ }
+};
+
+template<int U, int V, class T>
+struct B {
+ T a[V-U+1];
+ friend A<V-U+1> f (B const &x)
+ {
+ return A<V-U+1> ((char*) x.a);
+ }
+};
+
+const int a = 8;
+
+typedef B<1,a,int> C;
+struct D {
+ C x;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/mangle2.C b/gcc/testsuite/g++.old-deja/g++.other/mangle2.C
new file mode 100644
index 000000000..81cf2f3de
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/mangle2.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// Test for overloaded operators in "C" linkage
+
+extern "C" {
+typedef struct b
+{
+ int a;
+} c;
+
+extern const c z;
+
+inline bool operator!=(const c& x, const c& y)
+{
+ return x.a != y.a;
+}
+}
+
+void foo();
+
+void bar(c x)
+{
+ if (x != z)
+ foo();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/mangle3.C b/gcc/testsuite/g++.old-deja/g++.other/mangle3.C
new file mode 100644
index 000000000..3579ed86f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/mangle3.C
@@ -0,0 +1,42 @@
+// { dg-do run }
+struct foo {
+ static int bar ()
+ {
+ int i;
+ static int baz = 1;
+ {
+ static int baz = 2;
+ i = baz++;
+ }
+ {
+ struct baz {
+ static int m ()
+ {
+ static int n;
+ return n += 10;
+ }
+ };
+ baz a;
+ i += a.m ();
+ }
+ {
+ static int baz = 3;
+ i += baz;
+ baz += 30;
+ }
+ i += baz;
+ baz += 60;
+ return i;
+ }
+};
+
+int main ()
+{
+ foo x;
+
+ if (x.bar () != 16)
+ return 1;
+ if (x.bar() != 117)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/mutable1.C b/gcc/testsuite/g++.old-deja/g++.other/mutable1.C
new file mode 100644
index 000000000..0b2dd8d8e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/mutable1.C
@@ -0,0 +1,44 @@
+// { dg-do run }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Jan 1999 <nathan@acm.org>
+
+// Make sure objects with mutable members are never placed in a read only
+// section.
+
+// All these are POD structs, and hence do not need ctors
+struct A { mutable int i; };
+struct B { A a; };
+struct C { A a[1]; };
+struct D { static A const a; };
+
+// all these are static consts and hence naively suitable for a read only
+// section. But they contain a mutable, so must be in a writable section.
+static int const i = 0;
+static A const a = {0};
+static B const b = {{0}};
+static C const c = {{{0}}};
+static A const aa[] = {{0}};
+static B const bb[] = {{{0}}};
+static C const cc[] = {{{{0}}}};
+A const D::a = {0};
+
+int main()
+{
+ a.i = 05;
+ b.a.i = 05;
+ c.a[0].i = 05;
+ aa[0].i = 05;
+ bb[0].a.i = 05;
+ cc[0].a[0].i = 05;
+ D::a.i = 05;
+
+ if(!a.i) return 1;
+ if(!b.a.i) return 1;
+ if(!c.a[0].i) return 1;
+ if(!aa[0].i) return 1;
+ if(!bb[0].a.i) return 1;
+ if(!cc[0].a[0].i) return 1;
+ if(!D::a.i) return 1;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/nested1.C b/gcc/testsuite/g++.old-deja/g++.other/nested1.C
new file mode 100644
index 000000000..957ad456f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/nested1.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+
+struct C
+{
+ struct D
+ {
+ };
+};
+
+struct E
+{
+ C& c;
+ void g();
+};
+
+void E::g()
+{
+ c.D().f(); // { dg-error "" } no matching function
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/nested2.C b/gcc/testsuite/g++.old-deja/g++.other/nested2.C
new file mode 100644
index 000000000..9e2225642
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/nested2.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// by Bert Bril <bert@dgb.nl>
+
+struct M1 {
+ struct I {};
+};
+
+struct M2 {
+ struct I {};
+ struct J : virtual public M2::I,
+ virtual public M1::I {};
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/nested3.C b/gcc/testsuite/g++.old-deja/g++.other/nested3.C
new file mode 100644
index 000000000..6e43ad350
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/nested3.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: Chip Salzenberg <chip@perlsupport.com>
+
+class Foo {
+ public:
+ class Bar;
+};
+
+class Foo::Bar {
+ public:
+ Bar() {}
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/nested4.C b/gcc/testsuite/g++.old-deja/g++.other/nested4.C
new file mode 100644
index 000000000..673fa3cb9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/nested4.C
@@ -0,0 +1,33 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Aug 2000 <nathan@codesourcery.com>
+
+// bug 372 We ICE'd on the out-of-class definition of a nested class of a
+// class template.
+
+struct Bar
+{
+};
+
+template <class T>
+struct Foo
+{
+ struct Baz;
+ struct Biz;
+ struct Boz
+ : Bar
+ {
+ };
+};
+
+template <class T>
+struct Foo<T>::Biz
+{
+};
+
+template <class T>
+struct Foo<T>::Baz
+: Bar
+{
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new.C b/gcc/testsuite/g++.old-deja/g++.other/new.C
new file mode 100644
index 000000000..3c3494ef7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/new.C
@@ -0,0 +1,60 @@
+// { dg-do assemble }
+
+#include <new>
+
+inline void *
+operator new(std::size_t alloc_sz, const char *fname, unsigned lineno)
+{
+ return ::operator new (alloc_sz);
+}
+inline void *
+operator new[](std::size_t alloc_sz, const char *fname, unsigned lineno)
+{
+ return ::operator new[] (alloc_sz);
+}
+inline void
+operator delete(void *ptr, const char *fname, unsigned lineno)
+{
+}
+inline void
+operator delete[](void *ptr, const char *fname, unsigned lineno)
+{
+}
+
+class DEF {
+public:
+ DEF( DEF *parent=0, const char *name=0 );
+};
+
+class ABC
+{
+public:
+ enum stuff { ID0, ID1 };
+ ABC( stuff, DEF *parent=0, const char *name=0 );
+};
+
+class GHI : public DEF
+{
+};
+
+class LMNFrame;
+class LMN : public DEF
+{
+ friend class LMNFrame;
+ public:
+public:
+ LMN();
+private:
+ LMNFrame *draw_area;
+
+ ABC *scroll_h;
+};
+class LMNFrame : public GHI {
+};
+LMN::LMN()
+{
+ draw_area = new ("abc", 69) LMNFrame;
+
+ scroll_h = new ("def", 71) ABC(ABC::ID0, this);
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new3.C b/gcc/testsuite/g++.old-deja/g++.other/new3.C
new file mode 100644
index 000000000..843756841
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/new3.C
@@ -0,0 +1,27 @@
+// { dg-do run }
+typedef __SIZE_TYPE__ size_t;
+
+template <class T>
+struct A
+{
+ int size;
+ A ()
+ {
+ size = 20;
+ T *p;
+ p = new T[size];
+ int foo;
+ foo = 5 * size;
+ }
+};
+
+struct B
+{
+ virtual ~B() { }
+ void operator delete [] (void *ptr, size_t size) { }
+};
+
+int main ()
+{
+ A<B> *p = new A<B>;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new4.C b/gcc/testsuite/g++.old-deja/g++.other/new4.C
new file mode 100644
index 000000000..7b136dbf3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/new4.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S {
+ S();
+
+ virtual int f() {
+ new S[+f()];
+ return 0;
+ }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new5.C b/gcc/testsuite/g++.old-deja/g++.other/new5.C
new file mode 100644
index 000000000..fbb91e87f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/new5.C
@@ -0,0 +1,13 @@
+// { dg-do run }
+// Test that const-correctness is observed when using new.
+
+struct A {
+ A() { }
+ int f () { return 1; }
+ int f () const { return 0; }
+};
+
+int main ()
+{
+ return (new const A)->f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new6.C b/gcc/testsuite/g++.old-deja/g++.other/new6.C
new file mode 100644
index 000000000..3afb2b7e4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/new6.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+// Test that we properly default-initialize the new int when () is given.
+
+#include <new>
+using namespace std;
+extern "C" void *malloc (size_t);
+
+int special;
+int space = 0xdeadbeef;
+
+void *operator new (size_t size) throw (bad_alloc)
+{
+ if (special)
+ return &space;
+ return malloc (size);
+}
+
+int main ()
+{
+ special = 1;
+ int *p = new int();
+ special = 0;
+ return *p != 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new7.C b/gcc/testsuite/g++.old-deja/g++.other/new7.C
new file mode 100644
index 000000000..0c0643e62
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/new7.C
@@ -0,0 +1,40 @@
+// { dg-do run }
+// Origin: philip_martin@ntlworld.com
+
+#include <new>
+
+extern "C" void abort();
+
+bool new_flag = false;
+bool delete_flag = false;
+
+struct X {
+ X()
+ {
+ throw 1;
+ }
+ void* operator new ( std::size_t n ) throw ( std::bad_alloc )
+ {
+ new_flag = true;
+ return ::operator new( n );
+ }
+ void operator delete( void* p, std::size_t n ) throw()
+ {
+ delete_flag = true;
+ ::operator delete( p );
+ }
+};
+
+int
+main()
+{
+ try
+ {
+ X* x = new X; // gcc 3.0 fails to call operator delete when X::X throws
+ }
+ catch ( ... )
+ {
+ }
+ if ( ! new_flag || ! delete_flag )
+ ::abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/null2.C b/gcc/testsuite/g++.old-deja/g++.other/null2.C
new file mode 100644
index 000000000..3c8c50a20
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/null2.C
@@ -0,0 +1,13 @@
+// { dg-do run }
+// Based on a testcase by Eric Dumazet <Eric.Dumazet@COSMOSBAY.COM>
+
+extern "C" void abort ();
+
+const char * const foo = ""; // foo is not NULL
+
+int main() {
+ if ((foo == 0) ? 0 : foo) // so this should evaluate to `foo'
+ return 0;
+ else
+ abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/null3.C b/gcc/testsuite/g++.old-deja/g++.other/null3.C
new file mode 100644
index 000000000..6228caabd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/null3.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+
+void x()
+{
+ int* p = 1==0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/op1.C b/gcc/testsuite/g++.old-deja/g++.other/op1.C
new file mode 100644
index 000000000..61af8e17f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/op1.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S {
+ bool operator! (int, ...); // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/op2.C b/gcc/testsuite/g++.old-deja/g++.other/op2.C
new file mode 100644
index 000000000..52f390281
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/op2.C
@@ -0,0 +1,64 @@
+// { dg-do run }
+// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Nov 2000 <nathan@codesourcery.com>
+
+// Bug 91. We'd not preserve constness looking for a base classes assignment
+// operator.
+
+#include <stdio.h>
+
+int value = 0;
+
+struct A
+{
+ A() {}
+
+ A( A& arg)
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 1;}
+
+ A( const A& arg)
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 2;}
+
+ A& operator=( A& )
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 3; return *this; }
+
+ A& operator=( const A& )
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 4; return *this; }
+};
+
+struct B : A
+{
+ B () {}
+};
+
+void foo( A& )
+{
+ printf ("%s\n", __PRETTY_FUNCTION__); value = 5;
+}
+
+void foo( const A& )
+{
+ printf ("%s\n", __PRETTY_FUNCTION__); value = 6;
+}
+
+
+int main()
+{
+ const A a0;
+ value = 0; printf ("A(cA) : "); A a1(a0); if (value != 2) return 1;
+ value = 0; printf ("A(A ) : "); A a2(a1); if (value != 1) return 2;
+
+ const B b0;
+ value = 0; printf ("B(cB) : "); B b1(b0); if (value != 2) return 3;
+ value = 0; printf ("B(B ) : "); B b2(b1); if (value != 2) return 4;
+
+ value = 0; printf ("A= cA : "); a1 = a0; if (value != 4) return 5;
+ value = 0; printf ("A= A : "); a1 = a2; if (value != 3) return 6;
+ value = 0; printf ("B= cB : "); b1 = b0; if (value != 4) return 7;
+ value = 0; printf ("B= B : "); b1 = b2; if (value != 4) return 8;
+
+ value = 0; printf ("foo(cB): "); foo(b0); if (value != 6) return 9;
+ value = 0; printf ("foo(B ): "); foo(b2); if (value != 5) return 10;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/op3.C b/gcc/testsuite/g++.old-deja/g++.other/op3.C
new file mode 100644
index 000000000..33f0af6df
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/op3.C
@@ -0,0 +1,64 @@
+// { dg-do run }
+// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Nov 2000 <nathan@codesourcery.com>
+
+// Related to bug 91. We'd not preserve constness accessing a member of the
+// source type in copy ctor and assignment op.
+
+#include <stdio.h>
+
+int value = 0;
+
+struct A
+{
+ A() {}
+
+ A( A& arg)
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 1;}
+
+ A( const A& arg)
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 2;}
+
+ A& operator=( A& )
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 3; return *this; }
+
+ A& operator=( const A& )
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 4; return *this; }
+};
+
+struct B
+{
+ A a;
+ B () {}
+};
+
+void foo( A& )
+{
+ printf ("%s\n", __PRETTY_FUNCTION__); value = 5;
+}
+
+void foo( const A& )
+{
+ printf ("%s\n", __PRETTY_FUNCTION__); value = 6;
+}
+
+int main()
+{
+ const A a0;
+ value = 0; printf ("A(cA) : "); A a1(a0); if (value != 2) return 1;
+ value = 0; printf ("A(A ) : "); A a2(a1); if (value != 1) return 2;
+
+ const B b0;
+ value = 0; printf ("B(cB) : "); B b1(b0); if (value != 2) return 3;
+ value = 0; printf ("B(B ) : "); B b2(b1); if (value != 2) return 4;
+
+ value = 0; printf ("A= cA : "); a1 = a0; if (value != 4) return 5;
+ value = 0; printf ("A= A : "); a1 = a2; if (value != 3) return 6;
+ value = 0; printf ("B= cB : "); b1 = b0; if (value != 4) return 7;
+ value = 0; printf ("B= B : "); b1 = b2; if (value != 4) return 8;
+
+ value = 0; printf ("foo(cB): "); foo(b0.a); if (value != 6) return 9;
+ value = 0; printf ("foo(B ): "); foo(b2.a); if (value != 5) return 10;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/optimize1.C b/gcc/testsuite/g++.old-deja/g++.other/optimize1.C
new file mode 100644
index 000000000..b4707c5af
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/optimize1.C
@@ -0,0 +1,71 @@
+// { dg-do run }
+// { dg-options "-O2" }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 May 2001 <nathan@codesourcery.com>
+
+// Bug 2781. We forgot to copy addressability information when
+// cloning.
+
+struct B
+{
+ B(int v1);
+ void Member (int v1);
+ static void Static (int v1);
+};
+
+struct D : B
+{
+ D (int v1);
+};
+
+void xswap(int& x1) ;
+
+int xxx = 0;
+
+B::B(int v1)
+{
+ xswap(v1);
+ xxx = v1;
+}
+
+void B::Member(int v1)
+{
+ xswap(v1);
+ xxx = v1;
+}
+
+void B::Static(int v1)
+{
+ xswap(v1);
+ xxx = v1;
+}
+
+D::D(int v1)
+ : B (v1)
+{
+}
+
+void xswap (int& x1) { x1 = 2; }
+
+int main ()
+{
+ B p (1);
+
+ if (xxx != 2)
+ return 1;
+
+ D q (1);
+ if (xxx != 2)
+ return 2;
+
+ p.Member (1);
+ if (xxx != 2)
+ return 3;
+
+ p.Static (1);
+ if (xxx != 2)
+ return 4;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/optimize2.C b/gcc/testsuite/g++.old-deja/g++.other/optimize2.C
new file mode 100644
index 000000000..b34eae05e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/optimize2.C
@@ -0,0 +1,75 @@
+// { dg-do run }
+// { dg-options "-O2" }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 May 2001 <nathan@codesourcery.com>
+
+// Bug 2823. Inlineing the body of a thunk broke things. But that's
+// rarely a sensible thing to do anyway.
+
+#include <cstdio>
+#include <cstdlib>
+
+int objCount = 0;
+
+struct Thing
+{
+ int count;
+
+ Thing ();
+ Thing (Thing const &src);
+
+ ~Thing ();
+
+};
+
+Thing::Thing ()
+ :count (0)
+{
+ objCount++;
+ std::printf ("%p %s\n", (void *)this,__PRETTY_FUNCTION__);
+}
+
+Thing::Thing (Thing const &src)
+ :count (0)
+{
+ objCount++;
+ std::printf ("%p %s\n", (void *)this, __PRETTY_FUNCTION__);
+}
+
+Thing::~Thing ()
+{
+ std::printf ("%p %s\n", (void *)this, __PRETTY_FUNCTION__);
+ if (count)
+ std::abort ();
+ count--;
+ objCount--;
+}
+
+void x(Thing name)
+{
+ // destruct name here
+}
+
+class Base
+{
+ public:
+ virtual void test(const Thing& s) = 0;
+};
+
+class Impl : virtual public Base
+{
+ public:
+ virtual void test(const Thing& s)
+ {
+ x(s); // copy construct temporary
+ }
+};
+
+int main()
+{
+ Impl *impl = new Impl();
+
+ impl->test( Thing ()); // This will use a thunk
+ return objCount != 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/optimize3.C b/gcc/testsuite/g++.old-deja/g++.other/optimize3.C
new file mode 100644
index 000000000..3ec438494
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/optimize3.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+// { dg-options "-O2" }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 May 2001 <nathan@codesourcery.com>
+
+// Bug 2936. We ICE'd on tree inlining a function with an anonymous
+// union decl.
+
+inline const unsigned char *Foo (const char *string)
+{
+ union
+ {
+ const char *p1;
+ const unsigned char *p2;
+ };
+ p1 = 0;
+ p2 = 0;
+
+
+ p1 = string;
+ return p2;
+
+}
+
+const unsigned char *Baz (const char *string)
+{
+ return Foo (string);
+}
+
+int main ()
+{
+ const char *string = "s";
+ const unsigned char *result;
+
+ result = Baz (string);
+ return (static_cast <const void *> (result)
+ != static_cast <const void *> (string));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/optimize4.C b/gcc/testsuite/g++.old-deja/g++.other/optimize4.C
new file mode 100644
index 000000000..f1345e671
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/optimize4.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com>
+
+// Bug 3543. We forgot to resolve an OFFSET_REF
+
+
+struct Writeable {
+ bool blocking_mode;
+};
+
+
+struct Pipe : Writeable {
+ void ewrite();
+
+ void set_write_blocking ()
+ {
+ if (Writeable::blocking_mode);
+ }
+};
+
+void Pipe::ewrite()
+{
+ set_write_blocking();
+}
+
+void ewrite(Pipe &p)
+{
+ p.set_write_blocking();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overcnv1.C b/gcc/testsuite/g++.old-deja/g++.other/overcnv1.C
new file mode 100644
index 000000000..a161e9af1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overcnv1.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+class A {
+public:
+ void f(const char * const * );
+};
+void f(const char * const *) {}
+
+void g()
+{
+ char *ar[10];
+ A a;
+ f(ar);
+ a.f(ar);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C b/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C
new file mode 100644
index 000000000..9a5c4ca95
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// { dg-options "-Wconversion" }
+// Test that we resolve this case as mandated by the standard, but also
+// warn about it. We choose op char* not because it is a member of B --
+// the standard says that all conversion ops are treated as coming from
+// the type of the argument -- but because it is non-const.
+
+struct A {
+ operator const char *() const { return ""; }
+};
+
+struct B : public A {
+ operator char *() { return 0; }
+};
+
+int main()
+{
+ B b;
+ if ((const char *)b != 0) // { dg-warning "choosing 'B" "B" } surprising overload resolution
+ // { dg-warning "for conversion" "conv" { target *-*-* } 19 }
+ // { dg-message "note" "note" { target *-*-* } 19 }
+ return 1;
+ if ((const char *)(const B)b == 0)
+ return 2;
+ if ((const char *)(const B &)b == 0)
+ return 3;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload1.C b/gcc/testsuite/g++.old-deja/g++.other/overload1.C
new file mode 100644
index 000000000..8a833aa2a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload1.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+struct A {
+ A operator+ (int) const { return *this; }
+};
+
+A operator+ (A, float);
+
+int main ()
+{
+ A a;
+ a + 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload10.C b/gcc/testsuite/g++.old-deja/g++.other/overload10.C
new file mode 100644
index 000000000..f4652790a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload10.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+ const char *pc;
+ enum A { x } a;
+ int i;
+
+ int main()
+ {
+ return i ? *pc : a;
+ }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload11.C b/gcc/testsuite/g++.old-deja/g++.other/overload11.C
new file mode 100644
index 000000000..b994b8070
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload11.C
@@ -0,0 +1,92 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
+
+// [over.match] 13.3 tells us where overload resolution occurs.
+// [over.match.call] 13.3.1.1 says that in
+// (...( postfix-expression )...) (expression-list)
+// the postfix-expression must be the name of a function (amongst some other
+// choices). This means comma and conditional exprs cannot be placed there.
+// This clause is the only one I can find which bans
+// (cond ? fna : fnb) (arglist)
+// which would be a major headache to have to implement.
+// [over.over] 13.4 tells us when the use of a function name w/o arguments is
+// resolved to the address of a particular function. These are determined by
+// the context of the function name, and it does allow more complicated primary
+// expressions.
+
+// Using a naked function name is rather strange, we used to warn about it
+// (rather inconsistently), but subsequent changes broke the warning. Make
+// sure that doesn't happen again.
+
+
+void ovl (int); // { dg-message "ovl|candidate expects" } candidate
+void ovl (float); // { dg-message "ovl|candidate expects" } candidate
+void fn (int);
+void fna (int);
+
+int main (int argc, char **argv)
+{
+ void (*ptr) (int);
+ void (*vptr) ();
+
+ (ovl) (1); // ok
+ (&ovl) (1); // { dg-error "" } not suitable for overload resolution
+ (ovl) (); // { dg-error "" } no matching candidates
+ // { dg-message "candidate" "candidate note" { target *-*-* } 36 }
+ (&ovl) (); // { dg-error "" } not suitable for overload resolution
+
+ // 13.3.1.1 indicates that the following are errors -- the primary expression
+ // is not the name of a function.
+ (0, ovl) (1); // { dg-error "" } not suitable for overload resolution
+ (0, &ovl) (1); // { dg-error "" } not suitable for overload resolution
+ (argc ? ovl : ovl) (1); // { dg-error "" } not suitable for overload resolution
+ (argc ? &ovl : &ovl) (1); // { dg-error "" } not suitable for overload resolution
+
+ (fn) (1); // ok
+ (&fn) (1); // ok (no overload resolution)
+ (0, fn) (1); // ok (no overload resolution)
+ (0, &fn) (1); // ok (no overload resolution)
+ (argc ? fna : fn) (1); // ok (no overload resolution)
+ (argc ? &fna : &fn) (1); // ok (no overload resolution)
+
+ ptr = (ovl); // ok
+ ptr = (&ovl); // ok
+ ptr = (0, ovl); // ok { dg-error "no context" }
+ ptr = (0, &ovl); // ok { dg-error "no context" }
+ ptr = (argc ? ovl : ovl); // ok { dg-error "no context" }
+ ptr = (argc ? &ovl : &ovl);// ok { dg-error "no context" }
+
+ vptr = (ovl); // { dg-error "" } no matching candidates
+ vptr = (&ovl); // { dg-error "" } no matching candidates
+ vptr = (0, ovl); // { dg-error "" } no matching candidates
+ vptr = (0, &ovl); // { dg-error "" } no matching candidates
+ vptr = (argc ? ovl : ovl); // { dg-error "" } no matching candidates
+ vptr = (argc ? &ovl : &ovl);// { dg-error "" } no matching candidates
+
+ ptr = (fn);
+ ptr = (&fn);
+ ptr = (0, fn);
+ ptr = (0, &fn);
+ ptr = (argc ? fna : fn);
+ ptr = (argc ? &fna : &fn);
+
+ f; // { dg-error "" } not a call
+ ovl; // { dg-error "" } not suitable for overload
+ &ovl; // { dg-error "" } not suitable for overload
+ (void)f; // ok
+ (void)ovl; // { dg-error "" } not suitable for overload
+ (void)&ovl; // { dg-error "" } not suitable for overload
+ static_cast<void>(f); // ok
+ static_cast<void>(ovl); // { dg-error "" } not suitable for overload
+ static_cast<void>(&ovl); // { dg-error "" } not suitable for overload
+ ((void)1, f); // { dg-warning "" "" { xfail *-*-* } } not a call
+ ((void)1, ovl); // { dg-error "" } not suitable for overload
+ ((void)1, &ovl); // { dg-error "" } not suitable for overload
+ (void)((void)1, f); // ok
+ (void)((void)1, ovl); // { dg-error "" } not suitable for overload
+ (void)((void)1, &ovl); // { dg-error "" } not suitable for overload
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload12.C b/gcc/testsuite/g++.old-deja/g++.other/overload12.C
new file mode 100644
index 000000000..2e37f07c9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload12.C
@@ -0,0 +1,30 @@
+// { dg-do assemble }
+// Origin: Neil Booth <neilb@earthling.net> from bug #27.
+
+struct A{};
+
+struct B:A{};
+
+struct C:B{};
+
+struct CX
+{
+ C c;
+
+ operator C&(){return c;}
+};
+
+// viable functions for call below
+void f(A&);
+void f(B&);
+
+int main()
+{
+ CX cx;
+ C c;
+
+ f(c); // the standard conversion to B& is better than to A&
+
+ f(cx); // after user defined conversion to C&
+ // the standard conversion to B& is better than to A&
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload13.C b/gcc/testsuite/g++.old-deja/g++.other/overload13.C
new file mode 100644
index 000000000..54ab404af
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload13.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// Origin: Nathan Sidwell <nathan@codesourcery.com>
+
+struct A {
+ bool operator== (A const &);
+ operator bool () const;
+ operator int * () const;
+};
+
+bool foo (A &a1, A &a2)
+{
+ return a1 == a2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload14.C b/gcc/testsuite/g++.old-deja/g++.other/overload14.C
new file mode 100644
index 000000000..2a50b1bf5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload14.C
@@ -0,0 +1,33 @@
+// { dg-do run }
+// { dg-options "-Wconversion" }
+extern "C" void abort();
+
+struct A {
+ typedef double (&B);
+ typedef const double (&C);
+
+ A() { }
+
+ operator C () const;
+ operator B ();
+};
+
+static const double d = 2.0;
+static double e = 3.0;
+
+A::operator A::C () const
+{
+ abort ();
+ return d;
+}
+
+A::operator A::B ()
+{
+ return e;
+}
+
+int main ()
+{
+ (A::C) A ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload2.C b/gcc/testsuite/g++.old-deja/g++.other/overload2.C
new file mode 100644
index 000000000..88fe0a218
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload2.C
@@ -0,0 +1,24 @@
+// { dg-do link }
+
+template <class T>
+class ConstArray {
+};
+
+template <class T1, class T2>
+void operator+(const ConstArray<T1>&, const ConstArray<T2>&)
+{
+}
+
+template <class T1, class T2>
+void operator+(const ConstArray<T1>&, T2);
+
+template <class T1, class T2>
+void operator+(T1, const ConstArray<T2>&);
+
+const ConstArray<int> cai() { return ConstArray<int>(); }
+const ConstArray<double> cad() { return ConstArray<double>(); }
+
+int main()
+{
+ cai () + cad ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload3.C b/gcc/testsuite/g++.old-deja/g++.other/overload3.C
new file mode 100644
index 000000000..cf5ceeba1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload3.C
@@ -0,0 +1,16 @@
+// { dg-do link }
+
+void f(const int *);
+void f(int *) {}
+
+void f2(const volatile int *);
+void f2(volatile int *) {}
+
+int i;
+
+int main()
+{
+ f(&i);
+ f2(&i);
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload4.C b/gcc/testsuite/g++.old-deja/g++.other/overload4.C
new file mode 100644
index 000000000..a81fd2db9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload4.C
@@ -0,0 +1,10 @@
+// { dg-do link }
+
+void f(int* const volatile * const * const*);
+void f(int* const * const * const*) {}
+
+int main()
+{
+ int*** ip;
+ f(&ip);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload5.C b/gcc/testsuite/g++.old-deja/g++.other/overload5.C
new file mode 100644
index 000000000..929876737
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload5.C
@@ -0,0 +1,22 @@
+// { dg-do link }
+
+struct S {};
+
+struct T : public S {};
+
+struct U : public T {};
+
+void f(int T::*) {}
+void f(int U::*);
+
+void g(void (T::*)(int)) {}
+void g(void (U::*)(int));
+
+int main()
+{
+ int S::*ip;
+ void (S::*fp)(int);
+
+ f(ip);
+ g(fp);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload6.C b/gcc/testsuite/g++.old-deja/g++.other/overload6.C
new file mode 100644
index 000000000..fda22838b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload6.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+extern "C" void abort();
+
+struct S1
+{
+ int f() { return 0; }
+ int f() const { return 1; }
+};
+
+struct S2 : public S1
+{
+};
+
+int main()
+{
+ S2 s2;
+ if (s2.f() != 0)
+ abort ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload7.C b/gcc/testsuite/g++.old-deja/g++.other/overload7.C
new file mode 100644
index 000000000..c028d5ea1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload7.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+// Check that object call works when there are multiple conversion ops
+// returning the same type.
+
+typedef int (*pfn)();
+
+int zero () { return 0; }
+int one () { return 1; }
+int two () { return 2; }
+
+struct A {
+ A() { }
+ operator pfn () { return one; }
+ operator pfn () const { return zero; }
+ operator pfn () volatile { return two; }
+};
+
+int
+main ()
+{
+ const A a;
+ return a();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload8.C b/gcc/testsuite/g++.old-deja/g++.other/overload8.C
new file mode 100644
index 000000000..4615bd848
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload8.C
@@ -0,0 +1,23 @@
+// { dg-do run }
+class a {
+public:
+ int f() { return 0; }
+ int f() const { return 1; }
+};
+
+class b : public a {
+};
+
+int main()
+{
+ int (b::* ptr1)() = &b::f;
+ int (b::* ptr2)() const = &b::f;
+
+ b ao;
+
+ if ((ao.*ptr1)() != 0)
+ return 1;
+ if ((ao.*ptr2)() != 1)
+ return 1;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload9.C b/gcc/testsuite/g++.old-deja/g++.other/overload9.C
new file mode 100644
index 000000000..59457e18f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload9.C
@@ -0,0 +1,32 @@
+// { dg-do run }
+struct T { ~T() {} };
+
+int g ()
+{
+ foo:
+ T t;
+ int f(int);
+ bar:
+ T t2;
+ int f(double);
+ return f(3);
+}
+
+
+int f(int)
+{
+ return 0;
+}
+
+
+int f(double)
+{
+ return 1;
+}
+
+
+int main()
+{
+ return g();
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/override1.C b/gcc/testsuite/g++.old-deja/g++.other/override1.C
new file mode 100644
index 000000000..62d55a72f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/override1.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// Origin: Frank Pilhofer <fp@fpx.de>
+
+struct A {
+virtual void f ();
+};
+
+struct B : virtual public A {
+void f ();
+};
+
+struct C : virtual public A {
+void f ();
+};
+
+struct D : virtual public B, virtual public C {
+void f ();
+};
+
+struct Di : virtual public B, virtual public C, virtual public D {};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/override2.C b/gcc/testsuite/g++.old-deja/g++.other/override2.C
new file mode 100644
index 000000000..01ff84c69
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/override2.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Jason Merrill 14 Jun 2001 <jason@redhat.com>
+
+// Test for diagnosis of missing final overrider.
+
+struct A { virtual void f (); };
+struct B1: virtual A { virtual void f (); };
+struct B2: virtual A { virtual void f (); };
+struct C: public B1, public B2 {}; // { dg-error "" } no final overrider
diff --git a/gcc/testsuite/g++.old-deja/g++.other/parse1.C b/gcc/testsuite/g++.old-deja/g++.other/parse1.C
new file mode 100644
index 000000000..8c46f7f0c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/parse1.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Test that we save declspecs before a class defn properly.
+
+static volatile union {
+ void f() { }
+} u;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/parse2.C b/gcc/testsuite/g++.old-deja/g++.other/parse2.C
new file mode 100644
index 000000000..330b05fb0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/parse2.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Nov 2000 <nathan@codesourcery.com>
+
+// Bug 531: We ICEd trying to give a parse error.
+
+struct X
+{
+ bool operator (const X &) const; // { dg-error "" } parse error
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/perf1.C b/gcc/testsuite/g++.old-deja/g++.other/perf1.C
new file mode 100644
index 000000000..d75542751
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/perf1.C
@@ -0,0 +1,78 @@
+// { dg-do assemble }
+
+// Test of severe performance regression from 2.95. This code generates
+// a heavily self-referential tree which caused the inliner to take
+// O(3**N) time to scan it for function calls.
+// Reported by Kelley Cook <kelley.cook@home.com>. PR c++/1687.
+
+bool in0 ;
+bool in1 ;
+bool in2 ;
+bool in3 ;
+bool in4 ;
+bool in5 ;
+bool in6 ;
+bool in7 ;
+bool in8 ;
+bool in9 ;
+bool in10;
+bool in11;
+bool in12;
+bool in13;
+bool in14;
+bool in15;
+bool in16;
+bool in17;
+bool in18;
+bool in19;
+bool in20;
+bool in21;
+bool in22;
+bool in23;
+bool in24;
+bool in25;
+bool in26;
+bool in27;
+bool in28;
+bool in29;
+bool in30;
+bool in31;
+unsigned long output;
+
+void mux(void)
+{
+ output =
+ (in0 ? 0x00000001 : 0) |
+ (in1 ? 0x00000002 : 0) |
+ (in2 ? 0x00000004 : 0) |
+ (in3 ? 0x00000008 : 0) |
+ (in4 ? 0x00000010 : 0) |
+ (in5 ? 0x00000020 : 0) |
+ (in6 ? 0x00000040 : 0) |
+ (in7 ? 0x00000080 : 0) |
+ (in8 ? 0x00000100 : 0) |
+ (in9 ? 0x00000200 : 0) |
+ (in10 ? 0x00000400 : 0) |
+ (in11 ? 0x00000800 : 0) |
+ (in12 ? 0x00001000 : 0) |
+ (in13 ? 0x00002000 : 0) |
+ (in14 ? 0x00004000 : 0) |
+ (in15 ? 0x00008000 : 0) |
+ (in16 ? 0x00010000 : 0) |
+ (in17 ? 0x00020000 : 0) |
+ (in18 ? 0x00040000 : 0) |
+ (in19 ? 0x00080000 : 0) |
+ (in20 ? 0x00100000 : 0) |
+ (in21 ? 0x00200000 : 0) |
+ (in22 ? 0x00400000 : 0) |
+ (in23 ? 0x00800000 : 0) |
+ (in24 ? 0x01000000 : 0) |
+ (in25 ? 0x02000000 : 0) |
+ (in26 ? 0x04000000 : 0) |
+ (in27 ? 0x08000000 : 0) |
+ (in28 ? 0x10000000 : 0) |
+ (in29 ? 0x20000000 : 0) |
+ (in30 ? 0x40000000 : 0) |
+ (in31 ? 0x80000000 : 0) ;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf1.C b/gcc/testsuite/g++.old-deja/g++.other/pmf1.C
new file mode 100644
index 000000000..685688e5a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pmf1.C
@@ -0,0 +1,9 @@
+// { dg-do run }
+struct foo {};
+typedef long unsigned int & (foo::*pmf)(void);
+void fn (...) {}
+int main ()
+{
+ pmf y = 0;
+ fn (y);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf2.C b/gcc/testsuite/g++.old-deja/g++.other/pmf2.C
new file mode 100644
index 000000000..e28a77022
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pmf2.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+// submitted by David C Binderman <dcb@pncl.co.uk>
+
+struct S
+{
+ void f();
+};
+
+void (S ::* pmf) ();
+
+S * pf;
+
+void
+f()
+{
+ pmf = & pf->f; // { dg-error "" } not a valid pmf expression
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf3.C b/gcc/testsuite/g++.old-deja/g++.other/pmf3.C
new file mode 100644
index 000000000..11e648ed8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pmf3.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// Submitted by Nathan Sidwell <nathan@acm.org>
+// Bug: g++ was crashing after giving errors.
+
+template<class T>
+ void connect_to_method( // { dg-message "connect_to_method|no known conversion" }
+ T *receiver,
+ void (T::*method)())
+ {}
+
+class Gtk_Base
+{
+public:
+ void expose();
+ void show();
+ void show(int);
+ Gtk_Base();
+};
+
+
+Gtk_Base::Gtk_Base()
+{
+ connect_to_method(this,&show); // { dg-error "no match" } invalid pmf expression
+ // { dg-message "candidate" "candidate note" { target *-*-* } 23 }
+ connect_to_method(this,&expose); // { dg-error "pointer to member" } invalid pmf expression
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf4.C b/gcc/testsuite/g++.old-deja/g++.other/pmf4.C
new file mode 100644
index 000000000..cefb3616c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pmf4.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+// Bug: g++ doesn't compensate for finding a virtual function in a
+// non-primary vtable when generating PMFs.
+// Submitted by Jason Merrill <jason@cygnus.com>
+
+struct A {
+ virtual ~A() {}
+};
+
+struct B {
+ virtual void f () = 0;
+};
+
+struct C : public A, public B {
+ void f ();
+};
+
+void (C::* B_f)() = &B::f; // this works
+void (C::* C_f)() = &C::f; // this breaks
+
+C* p;
+
+void C::f ()
+{
+ p = this;
+}
+
+int main()
+{
+ C c;
+
+ (c.*B_f)();
+ if (p != &c)
+ return 1;
+
+ (c.*C_f)();
+ if (p != &c)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf5.C b/gcc/testsuite/g++.old-deja/g++.other/pmf5.C
new file mode 100644
index 000000000..73fcedae0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pmf5.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+// Bug: g++ expanded b->member() multiple times, causing the optimizer to
+// decide that things weren't related and optimize 'die' into an infinite
+// loop.
+
+struct A {
+ virtual ~A() { }
+ void f (bool) { }
+};
+
+typedef void (A::*pmf_void)();
+typedef void (A::*pmf_bool)(bool);
+
+struct B {
+ ~B() {}
+ pmf_void member() const { return mbr; }
+ pmf_void mbr;
+};
+
+A *a;
+B *b;
+
+void die (bool param) {
+ pmf_bool pmf = (pmf_bool)(b->member());
+ (a->*pmf)(param);
+}
+
+int main ()
+{
+ A a2;
+ B b2;
+
+ b2.mbr = reinterpret_cast<pmf_void>(&A::f);
+
+ a = &a2;
+ b = &b2;
+
+ die (true);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf6.C b/gcc/testsuite/g++.old-deja/g++.other/pmf6.C
new file mode 100644
index 000000000..4dea63146
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pmf6.C
@@ -0,0 +1,27 @@
+// { dg-do run }
+// Test that we only call f once and that pointers to different subobjects
+// compare as different.
+
+struct A { void f() { } };
+struct B: public A { };
+struct C: public A { };
+struct D : public B, public C { };
+
+typedef void (B::*bp)();
+typedef void (C::*cp)();
+typedef void (D::*dp)();
+
+dp d1;
+
+int call;
+
+dp f () { ++call; return d1; }
+
+int main()
+{
+ bp b = &A::f;
+ cp c = &A::f;
+ d1 = b;
+ dp d2 = c;
+ return (f() == d2 || call != 1);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf7.C b/gcc/testsuite/g++.old-deja/g++.other/pmf7.C
new file mode 100644
index 000000000..1968a7997
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pmf7.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// Test for proper diagnostics on trying to take the address of a non-static
+// member function.
+
+struct A {
+ void f ();
+ void f (int);
+ void g ();
+};
+
+int main ()
+{
+ A a;
+ &a.f; // { dg-error "" } overloaded
+ &a.g; // { dg-error "" } can't write a pmf like this
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pod1.C b/gcc/testsuite/g++.old-deja/g++.other/pod1.C
new file mode 100644
index 000000000..b70892683
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pod1.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Feb 2001 <nathan@codesourcery.com>
+
+// DR 148. Now allows pointer to members in POD struct.
+
+struct X
+{
+ int X::*m;
+ int (X::*f) ();
+};
+
+void Foo (int, ...);
+
+void Baz ()
+{
+ X x;
+
+ Foo (1, x);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/printf1.C b/gcc/testsuite/g++.old-deja/g++.other/printf1.C
new file mode 100644
index 000000000..65fda3fbd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/printf1.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-Wall" }
+
+struct a
+{
+ void x(char *f,...) __attribute__((format(printf,2,3)));
+};
+
+int main()
+{
+ a A;
+ A.x("%d"); // { dg-warning "" } too few arguments for format
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem1.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem1.C
new file mode 100644
index 000000000..ec73e6221
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem1.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+class x
+{
+public:
+ virtual int is_constant();
+};
+
+void foo()
+{
+ x* y;
+ if (y->is_constant) // { dg-error "" } assuming &
+ {
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem10.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem10.C
new file mode 100644
index 000000000..f6f97d9c0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem10.C
@@ -0,0 +1,11 @@
+// { dg-do run }
+// Test that we properly convert a constant ptm to bool.
+
+class A { };
+
+int main()
+{
+ int A::*const p = 0;
+ if (p)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem2.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem2.C
new file mode 100644
index 000000000..88c393210
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem2.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+class cow {
+public:
+ void moo (char *);
+};
+
+void f()
+{
+ cow* c;
+
+ void (cow::*fp0)(char*) = &cow::moo; // OK
+ void (cow::*fp1)(int) = &cow::moo; // { dg-error "" } conversion
+ int (cow::*fp2)(char*) = &cow::moo; // { dg-error "" } conversion
+ int (cow::*fp3)(char*, void*) = fp2; // { dg-error "" } conversion
+ int (cow::*fp4)(double) = (int (cow::*)(double)) fp2; // OK
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem3.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem3.C
new file mode 100644
index 000000000..09ae9db0a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem3.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+class c {
+ void (c::*x)();
+public:
+ void f() { this->x(); } // { dg-error "" } pointer-to-member
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem4.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem4.C
new file mode 100644
index 000000000..6df10a99f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem4.C
@@ -0,0 +1,13 @@
+// { dg-do run }
+// Test to make sure g++ can handle target types that aren't identical
+// with pointers to members.
+
+struct A { int i; };
+struct B : public A { };
+
+int main ()
+{
+ int A::*p = &A::i;
+ const int B::*q = &A::i;
+ return p != q;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem5.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem5.C
new file mode 100644
index 000000000..e64f84d26
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem5.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Bug: g++ doesn't see that A is a vbase of C.
+// Submitted by Jason Merrill <jason@cygnus.com>
+
+struct A {
+ int i;
+ void f ();
+};
+
+struct B: public A { };
+struct C: public virtual B { };
+
+void g ()
+{
+ int C::*p = &A::i; // { dg-error "" } conversion from vbase
+ void (C::*fp)() = &A::f; // { dg-error "" } conversion from vbase
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C
new file mode 100644
index 000000000..7e1a99286
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+// Copyright (c) 2000, 2001 Free Software Foundation.
+// Distilled from a bug report by Eric Ford <eford@princeton.edu>
+
+extern double *y;
+extern double *x;
+extern int nPoints;
+
+void SetInitCond(void)
+{
+ int i;
+ for(i = 2; i < nPoints; ++i)
+ y[i] = y[nPoints] .* (x[i]-x[1]) / (x[nPoints]-x[1]); // { dg-error "" } .*
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C
new file mode 100644
index 000000000..b04f7e265
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C
@@ -0,0 +1,47 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2000 <nathan@codesourcery.com>
+
+// A pointer to member can only be formed by `&T::m', however, other forms
+// are ok for pointer to static member. Thus the error can only be determined
+// after overload resolution.
+
+struct A
+{
+ static int ns (short);
+ static int ns (float);
+ int ns (int);
+ int ns (double);
+ int single (int);
+ static int sole (short);
+ void foo ();
+};
+void A::foo ()
+{
+ int (A::*ptr1) (int) = &A::ns;
+ int (A::*ptr2) (int) = A::ns; // { dg-error "pointer to member" "err" }
+ // { dg-message "pointer to member" "note" { target *-*-* } 23 }
+ int (A::*ptr3) (int) = &ns; // { dg-error "pointer to member" "err" }
+ int (A::*ptr4) (int) = ns; // { dg-error "pointer to member" "err" }
+
+ int (*ptr5) (short) = &A::ns;
+ int (*ptr6) (short) = A::ns;
+ int (*ptr7) (short) = &ns;
+ int (*ptr8) (short) = ns;
+
+ int (A::*ptr11) (int) = &A::single;
+ int (A::*ptr12) (int) = A::single; // { dg-error "match" }
+ int (A::*ptr13) (int) = &single; // { dg-error "pointer to member" }
+ int (A::*ptr14) (int) = single; // { dg-error "match" }
+
+ int (A::*ptr20) (int) = &(A::ns); // { dg-error "pointer to member" }
+ int (A::*ptr21) (int) = &(A::single); // { dg-error "pointer to member" }
+
+ int (*ptr31) (short) = &A::sole;
+ int (*ptr32) (short) = A::sole;
+ int (*ptr33) (short) = &sole;
+ int (*ptr34) (short) = sole;
+ int (*ptr41) (short) = &(A::sole);
+ int (*ptr43) (short) = &(sole);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem8.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem8.C
new file mode 100644
index 000000000..aff6ffac0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem8.C
@@ -0,0 +1,75 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Nov 2000 <nathan@codesourcery.com>
+
+// bug 827. We died issuing warnings about dangerous pointer to member
+// conversions.
+
+struct bar
+{
+ int barm;
+ static void a();
+};
+struct filler1 {int fm;};
+struct filler2 {int fm;};
+struct filler3 {int fm;};
+struct filler4 {int fm;};
+
+struct baz : filler1, bar, filler2
+{
+ int bazm;
+};
+
+struct foo : filler3, virtual baz, filler4
+{
+ static void a();
+ void b() {}
+ int m;
+};
+
+typedef void (bar::*barfPtr)();
+typedef void (foo::*foofPtr)();
+typedef int bar::*barmPtr;
+typedef int foo::*foomPtr;
+
+int main ()
+{
+ foofPtr fp = &foo::b;
+ barfPtr bp = (barfPtr)fp; // { dg-error "pointer to member" }
+ foofPtr fp2 = (foofPtr)bp; // { dg-error "pointer to member" }
+
+ if (fp2 != fp)
+ return 1;
+
+ foo fobj;
+ fobj.filler1::fm = 1;
+ fobj.filler2::fm = 2;
+ fobj.filler3::fm = 3;
+ fobj.filler4::fm = 4;
+ fobj.bazm = 5;
+ fobj.barm = 6;
+ fobj.m = 78;
+
+ foomPtr fmp = &foo::m;
+ barmPtr bmp = (barmPtr)fmp; // { dg-error "pointer to member" }
+ foomPtr fmp2 = (foomPtr)bmp; // { dg-error "pointer to member" }
+ bar *bptr = &fobj;
+
+ if (fmp != fmp2)
+ return 2;
+
+ if (bptr->*bmp != 78)
+ return 3;
+
+ bp = reinterpret_cast <barfPtr> (fp);
+ fp2 = reinterpret_cast <foofPtr> (bp);
+ if (fp2 != fp)
+ return 4;
+
+ bmp = reinterpret_cast <barmPtr> (fmp);
+ fmp2 = reinterpret_cast <foomPtr> (bmp);
+ if (fmp != fmp2)
+ return 5;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem9.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem9.C
new file mode 100644
index 000000000..67d4f280e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem9.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+// Test that const-correctness is observed when using pointers-to-members.
+
+struct A {
+ int f () { return 1; }
+ int f () const { return 0; }
+};
+
+struct B {
+ A a;
+ B() { }
+};
+
+int main ()
+{
+ A B::*bm = &B::a;
+ const B b;
+ return (b.*bm).f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/qual1.C b/gcc/testsuite/g++.old-deja/g++.other/qual1.C
new file mode 100644
index 000000000..b6eba42dd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/qual1.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// { dg-options "-O" }
+// Origin: Benjamin Pflugmann <philemon@spin.de>
+
+// DR 295 allows qualification via typedef
+
+typedef const char *(func_type)();
+
+class C
+{
+public:
+ func_type *Function;
+ // The following is DR 295 dependent
+ const func_type* function(void) { return Function; }
+ volatile func_type* functionv(void);
+} action;
+
+void work(const char *source)
+{
+ work( action.function()() );
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/realloc.C b/gcc/testsuite/g++.old-deja/g++.other/realloc.C
new file mode 100644
index 000000000..3e50aa804
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/realloc.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+extern "C" void realloc();
+
+class bug {
+public:
+ void realloc(int foo,int bar);
+};
+
+void f() {
+ bug c;
+ c.realloc(50,50);
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/redecl1.C b/gcc/testsuite/g++.old-deja/g++.other/redecl1.C
new file mode 100644
index 000000000..bd6382ee0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/redecl1.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+struct X{
+ void i();
+ void i(int); // { dg-error "" }
+ int i; // { dg-error "" } conflict
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/redecl2.C b/gcc/testsuite/g++.old-deja/g++.other/redecl2.C
new file mode 100644
index 000000000..0d6ccf669
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/redecl2.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+struct S {
+ S(int); // { dg-error "with" }
+ S(int); // { dg-error "overloaded" } already declared
+
+ ~S();// { dg-error "with" }
+ ~S(); // { dg-error "overloaded" } already declared
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/redecl3.C b/gcc/testsuite/g++.old-deja/g++.other/redecl3.C
new file mode 100644
index 000000000..96940d545
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/redecl3.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// Bug: g++ thought this was a redeclaration of a local variable.
+
+int i;
+int main ()
+{
+ extern int i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/redecl4.C b/gcc/testsuite/g++.old-deja/g++.other/redecl4.C
new file mode 100644
index 000000000..e3355dafc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/redecl4.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+int main() {
+ struct A {
+ void f(); // { dg-error "with" } already declared
+ void f(); // { dg-error "overloaded" } already declared
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ref1.C b/gcc/testsuite/g++.old-deja/g++.other/ref1.C
new file mode 100644
index 000000000..df4ff470d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ref1.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+
+int f();
+
+void g()
+{
+ const int& i = f(); // OK
+ int& j = f(); // { dg-error "" } initialization of non-const reference
+ const volatile int& k = f(); // { dg-error "" } initialization of volatile ref
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ref2.C b/gcc/testsuite/g++.old-deja/g++.other/ref2.C
new file mode 100644
index 000000000..45c0b764d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ref2.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+ struct A {
+ int operator * ();
+ };
+ struct B : public A { };
+ int operator * (B &);
+
+ int main ()
+ {
+ B b;
+ B& br = b;
+ *br;
+ }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ref3.C b/gcc/testsuite/g++.old-deja/g++.other/ref3.C
new file mode 100644
index 000000000..3a5853c23
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ref3.C
@@ -0,0 +1,31 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct B1
+{
+ int i;
+};
+
+struct B2
+{
+ int j;
+};
+
+struct D: public B1, B2
+{
+};
+
+bool f (B2& b)
+{
+ return b.j == 7;
+}
+
+int main ()
+{
+ D d;
+ d.i = 2;
+ d.j = 7;
+ if (!f (d))
+ return 1;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ref4.C b/gcc/testsuite/g++.old-deja/g++.other/ref4.C
new file mode 100644
index 000000000..5eb97b988
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ref4.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 2117. A conversion op to reference type created a temporary, even
+// when bound to another reference.
+
+struct Abstract
+{
+ virtual void Foo () = 0;
+};
+
+struct Proxy
+{
+ operator Abstract & ();
+ Abstract &Convert ();
+};
+
+void Baz (Abstract &);
+
+void Foo ()
+{
+ Proxy proxy;
+
+ Baz (proxy);
+ Baz (proxy.Convert ());
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/refinit1.C b/gcc/testsuite/g++.old-deja/g++.other/refinit1.C
new file mode 100644
index 000000000..e120078e5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/refinit1.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Test that we don't allow multiple user-defined conversions in reference
+// initialization.
+
+struct B { };
+
+struct A {
+ A (const B&);
+};
+
+struct C {
+ operator B ();
+};
+
+C c;
+
+const A& ref (c); // { dg-error "" } requires two UDCs
diff --git a/gcc/testsuite/g++.old-deja/g++.other/refinit2.C b/gcc/testsuite/g++.old-deja/g++.other/refinit2.C
new file mode 100644
index 000000000..ab84542d0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/refinit2.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Aug 2000 <nathan@codesourcery.com>
+
+// bug 381. We gave slightly different diagnostics, when binding an rvalue to
+// a non-const reference, depending on the precise type to the rvalue.
+
+namespace A {
+template <class T> void f(T) {}
+}
+void (* &h)(int) = A::f<int>; // { dg-error "" } rvalue to non-const
+void (*const volatile &i)(int) = A::f<int>; // { dg-error "" } rvalue to volatile
+void (*const &j)(int) = A::f<int>;
+
+int &k = 1; // { dg-error "" } rvalue to non-const
+int &const volatile l = 1; // { dg-error "" } rvalue to volatile
+int const &m = 1;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/regstack.C b/gcc/testsuite/g++.old-deja/g++.other/regstack.C
new file mode 100644
index 000000000..5b8334733
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/regstack.C
@@ -0,0 +1,31 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-options "-O2" }
+
+inline double foo (double x)
+{
+ register double r;
+ asm volatile ("fsqrt" : "=t" (r) : "0" (x));
+ return r;
+}
+
+struct X
+{
+ ~X() {}
+};
+
+int b;
+
+double bar (X x)
+{
+ if (b)
+ return 1.0;
+ return 36.0 * foo (36.0);
+}
+
+int main ()
+{
+ X x;
+ if (bar (x) != 216.0)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/reload1.C b/gcc/testsuite/g++.old-deja/g++.other/reload1.C
new file mode 100644
index 000000000..635895586
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/reload1.C
@@ -0,0 +1,47 @@
+// { dg-do run }
+extern "C" void abort ();
+
+struct A {
+ unsigned long long u;
+} *a;
+
+struct B {
+ unsigned long long v;
+ unsigned long long w ()
+ {
+ return a->u - v;
+ }
+} b;
+
+struct C {
+ static unsigned long long x;
+ static void y (unsigned long long z);
+};
+
+unsigned long long C::x = 0;
+
+int main ()
+{
+ a = new A;
+ b.v = 333418;
+ a->u = 1132270;
+ C::x = 0;
+ C::y (799016);
+}
+
+void foo (unsigned long long a, unsigned long long b, unsigned long long c)
+{
+}
+
+void C::y (unsigned long long z)
+{
+ unsigned long long c = b.w () - x;
+ if (z < b.w ())
+ {
+ if ((long long) c < 0)
+ {
+ foo (b.w (), a->u, b.v);
+ abort ();
+ }
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/return1.C b/gcc/testsuite/g++.old-deja/g++.other/return1.C
new file mode 100644
index 000000000..61bc3b129
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/return1.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// Special g++ Option:
+// Origin: holmen@mail.nu
+
+struct C {
+ int f() {return 0;}
+};
+
+struct D {
+ C a[1];
+ C* g();
+};
+
+C* D::g() {
+ int i = 0;
+ while (i < 1 && a[i].f() != 1) {}
+ return undefined_variable; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/rtti1.C b/gcc/testsuite/g++.old-deja/g++.other/rtti1.C
new file mode 100644
index 000000000..a49695b5c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/rtti1.C
@@ -0,0 +1,122 @@
+// { dg-do run }
+// { dg-options "-frtti" }
+// test of rtti of non-class types
+
+#include <typeinfo>
+
+extern "C" {
+ int printf(const char *, ...);
+ void exit(int);
+}
+
+int i;
+short s;
+char c;
+long l;
+
+unsigned int ui;
+unsigned short us;
+unsigned char uc;
+unsigned long ul;
+
+float f;
+double d;
+
+int& ri = i;
+const volatile int cvi = 10;
+volatile const int vci = 20;
+const int ci = 100;
+
+int *pi;
+int ai[10];
+
+enum color { red, blue, green, yellow};
+
+int (*fp)();
+int (*gp)();
+int (*hp)(int);
+
+class XX {
+public:
+ int xxi;
+ float xxf;
+ int xxf1 () { return 0; };
+ int xxf2 (int k) { return 0; };
+};
+
+class YY {
+public:
+ int yyi;
+ double yyd;
+ int yyf1 (float f) { return 0; };
+ double yyf2 () {return yyd;};
+};
+
+int XX::*ptmd1;
+int XX::*ptmd2;
+float XX::*ptmd3;
+int YY::*ptmd4;
+
+int (XX::*ptmf1) ();
+int (XX::*ptmf2) ();
+int (XX::*ptmf3) (int);
+int (YY::*ptmf4) ();
+
+int func1 ()
+{ return 0;}
+
+int func2 ()
+{ return 1;}
+
+int func3 (int i)
+{ return i;}
+
+short func4 ()
+{ return 99;}
+
+void error (int i)
+{
+ exit(i);
+}
+
+int main ()
+{
+ if (typeid(i) != typeid(int)) error(1);
+ if (typeid(s) != typeid(short)) error(2);
+ if (typeid(c) != typeid(char)) error(3);
+ if (typeid(l) != typeid(long)) error(4);
+ if (typeid(ui) != typeid(unsigned int)) error(5);
+ if (typeid(us) != typeid(unsigned short)) error(6);
+ if (typeid(uc) != typeid(unsigned char)) error(7);
+ if (typeid(ul) != typeid(unsigned long)) error(8);
+ if (typeid(f) != typeid(float)) error(9);
+ if (typeid(d) != typeid(double)) error(10);
+
+ if (typeid(*pi) != typeid(int)) error(51);
+ if (typeid(pi) == typeid(ai)) error(52);
+ if (typeid(ri) != typeid(i)) error(53);
+ if (typeid(cvi) != typeid(vci)) error (54);
+ if (typeid(vci) != typeid(i)) error(55);
+ if (typeid(ci) != typeid(cvi)) error (56);
+ if (typeid(ci) != typeid(const int)) error(57);
+
+ if (typeid(func1) != typeid(func2)) error (81);
+ if (typeid(func2) == typeid(func3)) error (82);
+ if (typeid(func1) == typeid(func4)) error (83);
+ if (typeid(func3) == typeid(func4)) error (84);
+
+ if (typeid(red) != typeid(color)) error (101);
+ if (typeid(green) != typeid(blue)) error (102);
+
+ if (typeid(fp) != typeid(gp)) error (103);
+ if (typeid(gp) == typeid(hp)) error (104);
+
+ if (typeid(ptmd1) != typeid(ptmd2)) error (105);
+ if (typeid(ptmd1) == typeid(ptmd3)) error (106);
+ if (typeid(ptmd2) == typeid(ptmd4)) error (107);
+
+ if (typeid(ptmf1) != typeid(ptmf2)) error (108);
+ if (typeid(ptmf2) == typeid(ptmf3)) error (109);
+ if (typeid(ptmf1) == typeid(ptmf4)) error (110);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/rtti2.C b/gcc/testsuite/g++.old-deja/g++.other/rtti2.C
new file mode 100644
index 000000000..4cc1319c9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/rtti2.C
@@ -0,0 +1,89 @@
+// { dg-do run }
+// { dg-options "-frtti" }
+// test of rtti of single inheritance and multiple inheritance classes
+
+#include <typeinfo>
+
+extern "C" {
+ int printf(const char *, ...);
+ void exit(int);
+}
+
+class X {
+ public:
+ int xi;
+};
+
+class Y : public X {
+ short ys;
+};
+
+class Z : public Y {
+ int zi;
+};
+
+Z z;
+Y y;
+Y *yp = &z;
+X *xp = &z;
+Z *zp = &z;
+
+class A {
+ public:
+ int Ai;
+};
+
+class B {
+ public:
+ int Bi;
+};
+
+class D : public A, public B {
+ int Di;
+};
+
+/*
+class E : public D, public B {
+ int Ei;
+};
+*/
+class E {
+ int Ei;
+};
+
+class F : public E, public D {
+ int Fi;
+};
+
+D d;
+A *ap = &d;
+B *bp = &d;
+F f;
+A *aap = &f;
+D *dp = &f;
+B *bbp = dp;
+
+void *vp = zp;
+
+void error (int i)
+{
+ exit(i);
+}
+
+int main ()
+{
+ if (typeid(z) != typeid(Z)) error(1);
+ if (typeid(*yp) == typeid(Z)) error(2);
+ if (typeid(*yp) == typeid(*zp)) error(3);
+ if (typeid(xp) == typeid(yp)) error(4);
+
+ xp = (X *)&y;
+ if (typeid(*xp) == typeid(*yp)) error(5);
+ if (typeid(*xp) == typeid(Y)) error(6);
+
+ if (typeid(*ap) == typeid(*bp)) error (31);
+ if (typeid(*ap) == typeid(D)) error(32);
+
+ if (typeid(*aap) == typeid(*bbp)) error(33);
+ if (typeid(*dp) == typeid(*aap)) error(34);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/rtti3.C b/gcc/testsuite/g++.old-deja/g++.other/rtti3.C
new file mode 100644
index 000000000..760cc7592
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/rtti3.C
@@ -0,0 +1,97 @@
+// { dg-do run }
+// { dg-options "-frtti" }
+// test of rtti of single inheritance and multiple inheritance with
+// virtual functions
+
+#include <typeinfo>
+
+extern "C" {
+ int printf(const char *, ...);
+ void exit(int);
+}
+
+class X {
+ public:
+ int xi;
+ virtual int f() {return 0;};
+};
+
+class Y : public X {
+ short ys;
+};
+
+class Z : public Y {
+ int zi;
+};
+
+Z z;
+Y y;
+Y *yp = &z;
+X *xp = &z;
+Z *zp = &z;
+
+class A {
+ public:
+ int Ai;
+ virtual int a() {return 0;};
+};
+
+class B {
+ public:
+ int Bi;
+ virtual int g() {return 0;};
+};
+
+class D : public A, public B {
+ int Di;
+};
+
+/*
+class E : public D, public B {
+ int Ei;
+};
+*/
+class E {
+ int Ei;
+};
+
+class F : public E, public D {
+ int Fi;
+};
+
+D d;
+A *ap = &d;
+B *bp = &d;
+D *dp = &d;
+F f;
+A *aap = &f;
+B *bbp = &f;
+
+void *vp = zp;
+
+void error (int i)
+{
+ exit(i);
+}
+
+int main ()
+{
+ if (typeid(z) != typeid(Z)) error(1);
+ if (typeid(*yp) != typeid(Z)) error(2);
+ if (typeid(*yp) != typeid(*zp)) error(3);
+ if (typeid(xp) == typeid(yp)) error(4);
+
+ xp = (X *)&y;
+ if (typeid(*xp) == typeid(*yp)) error(5);
+ if (typeid(*xp) != typeid(Y)) error(6);
+
+ if (typeid(*ap) != typeid(*bp)) error (31);
+ if (typeid(*ap) != typeid(D)) error(32);
+ vp = dp;
+ vp = dynamic_cast<void*> ((B *)vp);
+ if (dp != (D *)vp) error(35);
+
+ dp = (D *)&f;
+ if (typeid(*aap) != typeid(*bbp)) error(37);
+ if (typeid(*dp) != typeid(*aap)) error(38);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/rtti4.C b/gcc/testsuite/g++.old-deja/g++.other/rtti4.C
new file mode 100644
index 000000000..b9cb67292
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/rtti4.C
@@ -0,0 +1,87 @@
+// { dg-do run }
+// { dg-options "-frtti -w" }
+// test of rtti of single inheritance and multiple inheritance with
+// virtual inheritance
+
+#include <typeinfo>
+
+extern "C" {
+ int printf(const char *, ...);
+ void exit(int);
+}
+
+class X {
+ public:
+ int xi;
+ virtual int f() {};
+};
+
+class Y : public virtual X {
+ short ys;
+};
+
+class Z : public virtual Y {
+ int zi;
+};
+
+Z z;
+Y y;
+Y *yp = &z;
+X *xp = &z;
+Z *zp = &z;
+
+class A {
+public:
+ int Ai;
+ virtual int a() {};
+};
+
+class B {
+public:
+ int Bi;
+ virtual int g() {};
+};
+
+class D : public virtual A, private B {
+ int Di;
+};
+
+class E : public virtual D, public B {
+ int Ei;
+};
+
+class F : public E, public virtual D {
+ int Fi;
+};
+
+D d;
+A *ap = &d;
+B *bp = (B *)&d;
+F f;
+A *aap = &f;
+D *dp = &f;
+B *bbp = (B *)dp;
+
+void *vp = zp;
+
+void error (int i)
+{
+ exit(i);
+}
+
+int main ()
+{
+ if (typeid(z) != typeid(Z)) error(1);
+ if (typeid(*yp) != typeid(Z)) error(2);
+ if (typeid(*yp) != typeid(*zp)) error(3);
+ if (typeid(xp) == typeid(yp)) error(4);
+
+ xp = (X *)&y;
+ if (typeid(*xp) == typeid(*yp)) error(5);
+ if (typeid(*xp) != typeid(Y)) error(6);
+
+ if (typeid(*ap) != typeid(*bp)) error (31);
+ if (typeid(*ap) != typeid(D)) error(32);
+ if (typeid(*aap) != typeid(*bbp)) error(33);
+ if (typeid(*dp) != typeid(*aap)) error(34);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/rtti5.C b/gcc/testsuite/g++.old-deja/g++.other/rtti5.C
new file mode 100644
index 000000000..a8ab88555
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/rtti5.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-fno-rtti" }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 9 Apr 1999 <nathan@acm.org>
+// derrived from bug report from Alexander Zvyagin <zvyagin@mx.ihep.su>
+
+// check we don't die with disabled rtti
+
+
+int main(void) {
+ int i;
+ typeid(i); // { dg-error "" } rtti disabled
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/rttid2.C b/gcc/testsuite/g++.old-deja/g++.other/rttid2.C
new file mode 100644
index 000000000..06746506f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/rttid2.C
@@ -0,0 +1,101 @@
+// { dg-do run }
+// { dg-options "-frtti" }
+// test of rtti of single inheritance and multiple inheritance classes
+// dynamic casting
+
+#include <typeinfo>
+
+extern "C" {
+ int printf(const char *, ...);
+ void exit(int);
+}
+
+class X {
+ public:
+ int xi;
+};
+
+class Y : public X {
+ short ys;
+};
+
+class Z : public Y {
+ int zi;
+};
+
+Z z;
+Y y;
+Y *yp = &z;
+X *xp = &z;
+Z *zp = &z;
+
+class A {
+ public:
+ int Ai;
+};
+
+class B {
+ public:
+ int Bi;
+};
+
+class D : public A, public B {
+ int Di;
+};
+
+/*
+class E : public D, public B {
+ int Ei;
+};
+*/
+class E {
+ int Ei;
+};
+
+class F : public E, public D {
+ int Fi;
+};
+
+D d;
+A *ap = &d;
+B *bp = &d;
+F f;
+F *fp = &f;
+A *aap = &f;
+D *dp = &f;
+B *bbp = dp;
+
+void *vp = zp;
+
+/*
+void error (int i)
+{
+ printf("FAIL\n");
+ exit(i);
+}
+*/
+
+void error (int i)
+{
+ exit(i);
+}
+
+int main ()
+{
+
+ vp = (void *)0;
+
+ vp = dynamic_cast<Y *> (&z);
+ if (vp == 0) error(11);
+
+ vp = dynamic_cast<X *> (yp);
+ if (vp == 0) error(12);
+
+ vp = dynamic_cast<D *> (dp);
+ if (vp != (void *)dp) error(21);
+
+ vp = dynamic_cast<B *> (fp);
+ if (vp != (void *)bbp) error(22);
+
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/rttid3.C b/gcc/testsuite/g++.old-deja/g++.other/rttid3.C
new file mode 100644
index 000000000..0e3b97443
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/rttid3.C
@@ -0,0 +1,116 @@
+// { dg-do run }
+// { dg-options "-frtti" }
+// test of rtti of single inheritance and multiple inheritance with
+// virtual functions
+// dynamic casting
+
+#include <typeinfo>
+
+extern "C" {
+ int printf(const char *, ...);
+ void exit(int);
+}
+
+class X {
+ public:
+ int xi;
+ virtual int f() {return 0;};
+};
+
+class Y : public X {
+ short ys;
+};
+
+class Z : public Y {
+ int zi;
+};
+
+Z z;
+Y y;
+Y *yp = &z;
+X *xp = &z;
+Z *zp = &z;
+
+class A {
+ public:
+ int Ai;
+ virtual int a() {return 0;};
+};
+
+class B {
+ public:
+ int Bi;
+ virtual int g() {return 0;};
+};
+
+class D : public A, public B {
+ int Di;
+};
+
+/*
+class E : public D, public B {
+ int Ei;
+};
+*/
+class E {
+ int Ei;
+};
+
+class F : public E, public D {
+ int Fi;
+};
+
+D d;
+A *ap = &d;
+B *bp = &d;
+D *dp = &d;
+F f;
+F *fp = &f;
+A *aap = &f;
+B *bbp = &f;
+
+void *vp = zp;
+
+/*
+void error (int i)
+{
+ printf("FAIL\n");
+ exit(i);
+}
+*/
+
+void error (int i)
+{
+ exit(i);
+}
+
+int main ()
+{
+ vp = (void *)0;
+
+ vp = dynamic_cast<Y *> (&z);
+ if (vp == 0) error(11);
+
+ vp = dynamic_cast<Z *> (yp);
+ if (vp == 0) error(11);
+
+ vp = dynamic_cast<X *> (yp);
+ if (vp == 0) error(12);
+
+ vp = dynamic_cast<D *> (dp);
+ if (vp != (void *)dp) error(21);
+
+ vp = dynamic_cast<B *> (dp);
+ if (vp == (void *)dp) error(21);
+
+ vp = dynamic_cast<B *> (fp);
+ if (vp != (void *)bbp) error(22);
+
+ vp = dynamic_cast<void *> (aap);
+ if (vp != (void *)fp) error(23);
+
+ vp = dynamic_cast<B *> (aap);
+ if (vp != (void *)bbp) error(24);
+
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/rttid4.C b/gcc/testsuite/g++.old-deja/g++.other/rttid4.C
new file mode 100644
index 000000000..91c426290
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/rttid4.C
@@ -0,0 +1,112 @@
+// { dg-do run }
+// { dg-options "-w" }
+// test of rtti of single inheritance and multiple inheritance with
+// virtual inheritance
+// dynamic casting
+
+#include <typeinfo>
+
+extern "C" {
+ int printf(const char *, ...);
+ void exit(int);
+}
+
+class X {
+ public:
+ int xi;
+ virtual int f() {};
+};
+
+class Y : public virtual X {
+ short ys;
+};
+
+class Z : public virtual Y {
+ int zi;
+};
+
+Z z;
+Y y;
+Y *yp = &z;
+X *xp = &z;
+Z *zp = &z;
+
+class A {
+public:
+ int Ai;
+ virtual int a() {};
+};
+
+class B {
+public:
+ int Bi;
+ virtual int g() {};
+};
+
+class D : public virtual A, private B {
+ int Di;
+};
+
+class E : public virtual D, public B {
+ int Ei;
+};
+
+class F : public E, public virtual D {
+ int Fi;
+};
+
+D d;
+A *ap = &d;
+B *bp = (B *)&d;
+F f;
+F *fp = &f;
+A *aap = &f;
+D *dp = &f;
+E *ep = &f;
+B *bbp = (B *)dp;
+
+void *vp = zp;
+
+/*
+void error (int i)
+{
+ printf("FAIL\n");
+ exit(i);
+}
+*/
+
+void error (int i)
+{
+ exit(i);
+}
+
+int main ()
+{
+ vp = (void *)0;
+
+ vp = dynamic_cast<Y *> (&z);
+ if (vp == 0) error(11);
+
+ vp = dynamic_cast<Z *> (yp);
+ if (vp == 0) error(11);
+
+ vp = dynamic_cast<X *> (yp);
+ if (vp == 0) error(12);
+
+ vp = dynamic_cast<D *> (dp);
+ if (vp != (void *)dp) error(21);
+
+ // Ill-formed: dynamic_cast to private or ambiguous base
+ // vp = dynamic_cast<B *> (dp);
+ // if (vp == (void *)dp) error(21);
+
+ // vp = dynamic_cast<B *> (fp);
+ // if (vp == (void *)bbp) error(22);
+
+ vp = dynamic_cast<void *> (aap);
+ if (vp != (void *)fp) error(23);
+
+ vp = dynamic_cast<B *> (aap);
+ if (vp == (void *)bbp) error(24);
+
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sc1.C b/gcc/testsuite/g++.old-deja/g++.other/sc1.C
new file mode 100644
index 000000000..054a57a6c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sc1.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+void f() {
+ int *i = 0;
+ const int *c = 0;
+
+ static_cast <const int *>(i);
+ static_cast <int *>(c); // { dg-error "" } casts away constness
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/scope1.C b/gcc/testsuite/g++.old-deja/g++.other/scope1.C
new file mode 100644
index 000000000..0b349f2b2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/scope1.C
@@ -0,0 +1,13 @@
+// { dg-do run }
+// Testcase for proper scoping of local externs.
+
+int x = 1;
+
+int main()
+{
+ int x = 2;
+ {
+ extern int x;
+ return (x != 1);
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/shadow1.C b/gcc/testsuite/g++.old-deja/g++.other/shadow1.C
new file mode 100644
index 000000000..3b67e7775
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/shadow1.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Bug: g++ thinks that the i in g() shadows the parm from f()
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+void f (int i)
+{
+ struct A {
+ void g () {
+ int i;
+ }
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C b/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C
new file mode 100644
index 000000000..fa9e37b37
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C
@@ -0,0 +1,14 @@
+// { dg-do run }
+// { dg-options "-O2" }
+
+#include <iostream>
+
+std::ostream& foo (const char *x, std::ostream &y)
+{
+ return y << "" << x;
+}
+
+int main ()
+{
+ foo ("", std::cout);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sibcall2.C b/gcc/testsuite/g++.old-deja/g++.other/sibcall2.C
new file mode 100644
index 000000000..818fa231c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sibcall2.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// { dg-options "-O2 -foptimize-sibling-calls -fno-exceptions" }
+
+struct X
+{
+ const char *c() const { return b; };
+ char *b;
+};
+extern "C" int f (const char *);
+struct A
+{
+ X x;
+ void y();
+};
+void A::y()
+{
+ const char *const a[] = { x.c() };
+ f (a[0]);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/signed.C b/gcc/testsuite/g++.old-deja/g++.other/signed.C
new file mode 100644
index 000000000..2c95f3db4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/signed.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Mar 1999 <nathan@acm.org>
+
+// Determine that function style casts are groked
+
+void fn()
+{
+ +char(5);
+ +short(5);
+ +int(5);
+ +long(5);
+ +signed(5);
+ +unsigned(5);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/singleton.C b/gcc/testsuite/g++.old-deja/g++.other/singleton.C
new file mode 100644
index 000000000..2a27ca3cd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/singleton.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+// This tests two things:
+// 1. there is an annoying warning.
+// singleton.C:26: warning: `class singleton' only defines private constructors and has no friends
+// egcs fails to see that there is a public static accessor function.
+// 2. the program crashes, because apparently the static variable s in
+// singleton::instance() is considered constructed although the ctor
+// exited via an exception. (crash changed to nonzero return here)
+
+class singleton {
+public:
+ static singleton& instance() {
+ static singleton s;
+ return s;
+ }
+ int check() {return initialized;}
+
+private:
+ singleton() : initialized(1) {
+ if ( counter++ == 0 ) throw "just for the heck of it";
+ initialized = 2;
+ }
+ singleton( const singleton& rhs );
+ void operator=( const singleton& rhs );
+ int initialized;
+ static int counter;
+};
+
+int singleton::counter;
+
+int main()
+{
+ while (1) {
+ try {
+ return singleton::instance().check()-2;
+ } catch (...) { }
+ }
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof1.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof1.C
new file mode 100644
index 000000000..b774a04ff
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sizeof1.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+struct X {
+ int f ();
+ int f (int);
+};
+
+void f(int i)
+{
+ i = sizeof(X::f); // { dg-error "" } cannot take sizeof a member function
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof2.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof2.C
new file mode 100644
index 000000000..cb3c9bb72
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sizeof2.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ int j;
+ int i[2]; // { dg-error "" "" { xfail *-*-* } } non-static data member
+};
+
+void f ()
+{
+ sizeof (S::j);
+ sizeof (S::i[0]); // { dg-error "" "" { xfail *-*-* } } used here
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C
new file mode 100644
index 000000000..bceb7317a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
+
+// C++ does not decay lvalues into rvalues until as late as possible. This
+// means things like the rhs of a comma operator mustn't decay. This will make
+// a difference if it is an array or function.
+
+extern "C" void abort();
+
+int main (int argc, char **argv)
+{
+ int ary[10];
+ int ary1[10];
+
+ if (sizeof (0,ary) != sizeof (ary))
+ abort ();
+ if (sizeof (argc ? ary : ary1) != sizeof (ary))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof4.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof4.C
new file mode 100644
index 000000000..325d3d003
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sizeof4.C
@@ -0,0 +1,41 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
+
+// C++ does not decay lvalues into rvalues until as late as possible. This
+// means things like the rhs of a comma operator mustn't decay. This will make
+// a difference if it is an array or function.
+
+struct S;
+struct T {int m;};
+extern S s; // an incomplete
+extern S arys[20]; // an incomplete array
+extern T aryt[]; // an incomplete array;
+
+void fn () {}
+
+int main (int argc, char **argv)
+{
+ sizeof (s); // { dg-error "" } incomplete
+ sizeof (0, s); // { dg-error "" } incomplete
+ sizeof (argc ? s : s); // { dg-error "" } incomplete
+
+ sizeof (arys); // { dg-error "" } incomplete
+ sizeof (0, arys); // { dg-error "" } incomplete
+ sizeof (argc ? arys : arys); // { dg-error "" } incomplete
+
+ sizeof (aryt); // { dg-error "" } incomplete
+ sizeof (0, aryt); // { dg-error "" } incomplete
+ sizeof (argc ? aryt : aryt); // { dg-error "" } incomplete
+
+ sizeof (fn); // { dg-error "" } cannot take size of function
+ sizeof (0, fn); // { dg-error "" } cannot take size of function
+ sizeof (argc ? fn : fn); // { dg-error "" } cannot take size of function
+
+ sizeof (&fn); // ok
+ sizeof (0, &fn); // ok
+ sizeof (argc ? &fn : &fn); // ok
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof5.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof5.C
new file mode 100644
index 000000000..ae076205b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sizeof5.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 23 Feb 2000 <nathan@codesourcery.com>
+// Derived from a bug report by Marko Maekelae <Marko.Makela@HUT.FI>
+
+
+struct A;
+void foo ()
+{
+ sizeof ( void ()); // { dg-error "" } ISO forbids
+ sizeof ( void (A::*) ());
+ sizeof ( void (A::*) () const);
+
+ sizeof (void (*) () const); // { dg-error "" } invalid quals
+ sizeof ( void () const); // { dg-error "" } ISO forbids, ERROR - invalid quals
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static1.C b/gcc/testsuite/g++.old-deja/g++.other/static1.C
new file mode 100644
index 000000000..2b0425264
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static1.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+extern "C" void abort();
+
+struct S
+{
+ static const int i = 3;
+};
+
+const int S::i = 2; // { dg-error "" } duplicate initialization
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static10.C b/gcc/testsuite/g++.old-deja/g++.other/static10.C
new file mode 100644
index 000000000..16b152453
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static10.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// { dg-options "-w" }
+// Origin: Ulrich Drepper <drepper@cygnus.com>
+
+struct st
+{
+ int a;
+};
+
+int
+foo (int a)
+{
+ static const st i = { 0 };
+
+ if (i.a == a)
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static11.C b/gcc/testsuite/g++.old-deja/g++.other/static11.C
new file mode 100644
index 000000000..a3c5bc024
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static11.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Origin: Raja R Harinath <harinath@cs.umn.edu>
+
+enum ReservedName {
+ rIGNORE,
+ rINCLUDE
+};
+
+void maybeStatusKeyword()
+{
+ static const ReservedName statusKeywords[] = { rINCLUDE, rIGNORE };
+ for (int i = 0; i < 2; i++) {
+ ReservedName r = statusKeywords[i];
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static12.C b/gcc/testsuite/g++.old-deja/g++.other/static12.C
new file mode 100644
index 000000000..7c3948947
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static12.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@redhat.com>
+
+int main ()
+{
+ static const int n = 10;
+ static const int *p = &n;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static13.C b/gcc/testsuite/g++.old-deja/g++.other/static13.C
new file mode 100644
index 000000000..fa45e8ae4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static13.C
@@ -0,0 +1,19 @@
+// { dg-do link }
+// Origin: scott snyder <snyder@fnal.gov>
+
+struct Cleaner
+{
+ ~Cleaner() {}
+};
+
+template <class T>
+void bar ()
+{
+ static Cleaner cleanup;
+}
+
+
+inline
+void foo() { bar<int>(); }
+
+int main () {}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static14.C b/gcc/testsuite/g++.old-deja/g++.other/static14.C
new file mode 100644
index 000000000..32f8b3be4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static14.C
@@ -0,0 +1,19 @@
+// { dg-do link }
+// Origin: scott snyder <snyder@fnal.gov>
+
+struct basic_string
+{
+ ~basic_string();
+};
+
+struct Side
+{
+ void name()
+ {
+ static basic_string sname;
+ }
+};
+
+int main ()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static15.C b/gcc/testsuite/g++.old-deja/g++.other/static15.C
new file mode 100644
index 000000000..ecf477f68
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static15.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+// Special g++ Option: -fdata-sections
+
+void f()
+{
+ static int ctors[3] = { 0, 0, 0 };
+
+ ctors[2] = 7;
+}
+
+int main ()
+{
+ f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static16.C b/gcc/testsuite/g++.old-deja/g++.other/static16.C
new file mode 100644
index 000000000..6425814d0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static16.C
@@ -0,0 +1,25 @@
+// { dg-do run }
+// Test that we properly evaluate the object parameter when accessing static
+// members.
+
+struct A {
+ static void f () {}
+ static int i;
+};
+
+int A::i;
+
+int c = 0;
+
+A g ()
+{
+ ++c;
+ return A();
+}
+
+int main ()
+{
+ g().f();
+ g().i = 42;
+ return (c != 2);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static2.C b/gcc/testsuite/g++.old-deja/g++.other/static2.C
new file mode 100644
index 000000000..b68699cf3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static2.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// Based on a test case by Koos Vriezen <koos@polder.ubc.kun.nl>
+
+struct foo {
+ static void (*mystatic) ();
+};
+
+void bar(foo& t) {
+ t.mystatic ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static20.C b/gcc/testsuite/g++.old-deja/g++.other/static20.C
new file mode 100644
index 000000000..17741049d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static20.C
@@ -0,0 +1,13 @@
+// { dg-do link }
+struct foo
+{
+ foo() {}
+ ~foo() {}
+ void func() { static foo x; }
+};
+
+int main()
+{
+ foo f;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static3.C b/gcc/testsuite/g++.old-deja/g++.other/static3.C
new file mode 100644
index 000000000..efa094d11
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static3.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+
+class S
+{
+ ~S();
+public:
+ friend void f();
+};
+
+
+S::~S()
+{
+ static S s;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static4.C b/gcc/testsuite/g++.old-deja/g++.other/static4.C
new file mode 100644
index 000000000..2b7b1faef
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static4.C
@@ -0,0 +1,10 @@
+// { dg-do run }
+// { dg-options "-O" }
+// Origin: Andrew Pollard <andrew@odie.demon.co.uk>
+
+struct A {
+ A(int, int);
+};
+A::A(int, int) {}
+static A _A(0, 0);
+int main() { return(0); }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static5.C b/gcc/testsuite/g++.old-deja/g++.other/static5.C
new file mode 100644
index 000000000..b4032bed2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static5.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ ~S();
+};
+
+inline void f()
+{
+ static S s;
+ atexit (0); // { dg-error "" } implicit declaration
+}
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static6.C b/gcc/testsuite/g++.old-deja/g++.other/static6.C
new file mode 100644
index 000000000..1705c5ced
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static6.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+void f (int i)
+{
+ static int a[] = { i };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static7.C b/gcc/testsuite/g++.old-deja/g++.other/static7.C
new file mode 100644
index 000000000..548485b82
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static7.C
@@ -0,0 +1,10 @@
+// { dg-do run }
+// Origin: Jason Merrill <jason@cygnus.com>
+
+int j = 42;
+
+int main ()
+{
+ static int i = j;
+ return (i != 42);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static9.C b/gcc/testsuite/g++.old-deja/g++.other/static9.C
new file mode 100644
index 000000000..c37128820
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static9.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Origin: Ulrich Drepper <drepper@cygnus.com>
+
+struct st
+{
+ int a, b, c, d;
+};
+
+void g ()
+{
+ static const st i = { 0,1,2,3 };
+}
+
+void h ()
+{
+ static const st i = { 0,1,2,3 };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/std1.C b/gcc/testsuite/g++.old-deja/g++.other/std1.C
new file mode 100644
index 000000000..eacf539d4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/std1.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+extern "C" int memcmp (const void * __s1,
+ const void * __s2,
+ __SIZE_TYPE__ __n) throw ();
+
+namespace std {
+void f () {
+ memcmp (0, 0, 0);
+}
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/stmtexpr1.C b/gcc/testsuite/g++.old-deja/g++.other/stmtexpr1.C
new file mode 100644
index 000000000..3623865fd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/stmtexpr1.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// { dg-options "-O" }
+// Origin: Thomas Kunert <kunert@physik.tu-dresden.de>
+
+#include <ctype.h>
+
+bool f( char c )
+{
+ return tolower( c );
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/stmtexpr2.C b/gcc/testsuite/g++.old-deja/g++.other/stmtexpr2.C
new file mode 100644
index 000000000..cbe6aabfe
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/stmtexpr2.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+// { dg-options "-O2" }
+// Origin: Jakub Jelinek <jakub@redhat.com>
+
+void bar(int);
+void foo(int x)
+{
+ bar(({ int y; y = x; }));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C b/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C
new file mode 100644
index 000000000..72d30eba2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C
@@ -0,0 +1,89 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-require-effective-target fpic }
+// { dg-options "-mtune=i686 -O2 -fpic" }
+class G {};
+
+struct N {
+ N *a;
+};
+
+struct V {
+ typedef N *W;
+ W *m, *n;
+ int s() const { return int(n - m); }
+ const W &operator[](int x) const { return *(m + x); }
+};
+
+struct H;
+
+struct J {
+ N *c;
+ H *d;
+ J(N *x, H *y) : c(x), d(y) {}
+};
+
+struct K {
+ const N *c;
+ const H *d;
+ K(const N *x, const H *y) : c(x), d(y) {}
+ K(const J &x) : c(x.c), d(x.d) {}
+};
+
+struct H {
+ V e;
+ int f;
+
+ J u()
+ {
+ for (int x = 0; x < e.s(); ++x)
+ if (e[x])
+ return J(e[x], this);
+ return v();
+ }
+ J v() { return J((N*)64, this); }
+};
+
+struct I {
+ H d;
+ J u() { return d.u(); }
+ J v() { return d.v(); }
+};
+
+struct bar {
+ virtual ~bar() {}
+};
+
+struct E {
+ K g;
+ E(K x) : g(x) {}
+};
+
+struct foo : public bar {
+ K h;
+ E i;
+ foo(const K x, const E &y) : h(x), i(y) {}
+};
+
+struct A {
+ I *l;
+ foo *baz() const;
+};
+
+foo *A::baz() const
+{
+ return new foo(l->u(), E(l->v()));
+}
+
+A x;
+I i;
+foo *f;
+
+int main ()
+{
+ x.l = &i;
+ f = x.baz();
+ if (f->h.c != f->i.g.c || f->h.d != f->i.g.d)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C b/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C
new file mode 100644
index 000000000..99e0943b3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C
@@ -0,0 +1,88 @@
+// { dg-do run { target i?86-*-* x86_64-*-*} }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-mtune=i686 -O2" }
+class G {};
+
+struct N {
+ N *a;
+};
+
+struct V {
+ typedef N *W;
+ W *m, *n;
+ int s() const { return int(n - m); }
+ const W &operator[](int x) const { return *(m + x); }
+};
+
+struct H;
+
+struct J {
+ N *c;
+ H *d;
+ J(N *x, H *y) : c(x), d(y) {}
+};
+
+struct K {
+ const N *c;
+ const H *d;
+ K(const N *x, const H *y) : c(x), d(y) {}
+ K(const J &x) : c(x.c), d(x.d) {}
+};
+
+struct H {
+ V e;
+ int f;
+
+ J u()
+ {
+ for (int x = 0; x < e.s(); ++x)
+ if (e[x])
+ return J(e[x], this);
+ return v();
+ }
+ J v() { return J((N*)64, this); }
+};
+
+struct I {
+ H d;
+ J u() { return d.u(); }
+ J v() { return d.v(); }
+};
+
+struct bar {
+ virtual ~bar() {}
+};
+
+struct E {
+ K g;
+ E(K x) : g(x) {}
+};
+
+struct foo : public bar {
+ K h;
+ E i;
+ foo(const K x, const E &y) : h(x), i(y) {}
+};
+
+struct A {
+ I *l;
+ foo *baz() const;
+};
+
+foo *A::baz() const
+{
+ return new foo(l->u(), E(l->v()));
+}
+
+A x;
+I i;
+foo *f;
+
+int main ()
+{
+ x.l = &i;
+ f = x.baz();
+ if (f->h.c != f->i.g.c || f->h.d != f->i.g.d)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/string1.C b/gcc/testsuite/g++.old-deja/g++.other/string1.C
new file mode 100644
index 000000000..503533a03
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/string1.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// Origin: mrs@wrs.com (Mike Stump)
+
+class Wrapper {
+public:
+ static const char msgPtr[];
+ static const char *JunkFunc() {
+ return &msgPtr[0];
+ }
+};
+
+const char Wrapper::msgPtr[] = "Hello world.";
+
+int main() {
+ const char *p1 = &Wrapper::msgPtr[0];
+ const char *p2 = Wrapper::JunkFunc();
+
+ if (p1 != p2)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/string2.C b/gcc/testsuite/g++.old-deja/g++.other/string2.C
new file mode 100644
index 000000000..bf0699a1d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/string2.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Mar 2000 <nathan@codesourcery.com>
+
+// A char const array should never be confused for a string literal.
+
+int main ()
+{
+ static const char ary[] = "wibble";
+ void const *ptr = 0;
+
+ ptr = ary;
+ if (ptr == "wibble")
+ return 1;
+ if (ptr != ary)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/struct1.C b/gcc/testsuite/g++.old-deja/g++.other/struct1.C
new file mode 100644
index 000000000..699d524b9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/struct1.C
@@ -0,0 +1,42 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 3 Jun 1999 <nathan@acm.org>
+
+// Duplicate definitions are wrong, we should just cough
+// politely, but we used to die horribly.
+
+class Y // { dg-error "" } previous definition
+{
+};
+class Y // { dg-error "" } redefinition
+{
+};
+
+template<class T> class X // { dg-error "" } previous definition
+{
+};
+template<class T> class X // { dg-error "" } redefinition
+{
+};
+
+template<class T> class X<T *> // { dg-error "" } previous definition
+{
+};
+template<class T> class X<T *> // { dg-error "" } redefinition
+{
+};
+
+template<> class X<int> // { dg-error "" } previous definition
+{
+};
+template<> class X<int> // { dg-error "" } redefinition
+{
+};
+
+template<> class X<int *> // { dg-error "" } previous definition
+{
+};
+template<> class X<int *> // { dg-error "" } redefinition
+{
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/syntax1.C b/gcc/testsuite/g++.old-deja/g++.other/syntax1.C
new file mode 100644
index 000000000..f1d3a8654
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/syntax1.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// { dg-options "-fsyntax-only" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+class AAA{
+public:
+ virtual void fff();
+};
+
+void AAA::fff() {}
+
+AAA aaa;
+
+main ()
+{
+ aaa.fff();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/syntax2.C b/gcc/testsuite/g++.old-deja/g++.other/syntax2.C
new file mode 100644
index 000000000..159f28f89
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/syntax2.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+// { dg-options "-fsyntax-only" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct B
+{
+ double d;
+
+ virtual void f ();
+};
+
+struct C: virtual public B
+{
+ char c;
+};
+
+struct D: virtual public B
+{
+ int i;
+ virtual void f ();
+};
+
+struct E : public C, public D
+{
+};
+
+E e;
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/syntax3.C b/gcc/testsuite/g++.old-deja/g++.other/syntax3.C
new file mode 100644
index 000000000..5ea7d38bf
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/syntax3.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 June 2000 <nathan@codesourcery.com>
+
+// Origin GNATS bug report 262 from Jeremy Sanders <jss@ast.cam.ac.uk>
+// and several others. With templates, it's very easy to say something
+// erroneous like
+// template class X::X<whatever>
+// The culprit
+// ... class X::X ...
+// caused us to ICE as we got confused about pushing and popping scopes.
+
+class X
+{
+ public:
+ X();
+};
+
+class X::X () {} // { dg-error "" } parse error
+X::X () {}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/syntax4.C b/gcc/testsuite/g++.old-deja/g++.other/syntax4.C
new file mode 100644
index 000000000..7aed1f5b1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/syntax4.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 June 2000 <nathan@codesourcery.com>
+
+// Origin GNATS bug report 262 from Jeremy Sanders <jss@ast.cam.ac.uk>
+// and several others. With templates, it's very easy to say something
+// erroneous like
+// template class X::X<whatever>
+// The culprit
+// ... class X::X ...
+// caused us to ICE as we got confused about pushing and popping scopes.
+
+class X {
+ X ();
+};
+
+class Y {
+ public:
+ typedef ::X W; // { dg-error "" } previous declaration
+ class Z;
+};
+
+class Y::Z {};
+class Y::W () {} // { dg-error "" } parse error
+Y::W::X () {}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/syshdr1.C b/gcc/testsuite/g++.old-deja/g++.other/syshdr1.C
new file mode 100644
index 000000000..89a7fbf73
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/syshdr1.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+# 1 "foo" 3
+void f () {}
+extern "C" void foo(int);
+extern "C" void foo(int) throw();
diff --git a/gcc/testsuite/g++.old-deja/g++.other/temporary1.C b/gcc/testsuite/g++.old-deja/g++.other/temporary1.C
new file mode 100644
index 000000000..b1c8cd651
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/temporary1.C
@@ -0,0 +1,41 @@
+// { dg-do run }
+extern "C" int printf (const char *, ...);
+
+int c, d;
+class Foo
+{
+public:
+ Foo() { printf("Foo() 0x%08lx\n", (__SIZE_TYPE__)this); ++c; }
+ Foo(Foo const &) { printf("Foo(Foo const &) 0x%08lx\n", (__SIZE_TYPE__)this); }
+ ~Foo() { printf("~Foo() 0x%08lx\n", (__SIZE_TYPE__)this); ++d; }
+};
+
+// Bar creates constructs a temporary Foo() as a default
+class Bar
+{
+public:
+ Bar(Foo const & = Foo()) { printf("Bar(Foo const &) 0x%08lx\n", (__SIZE_TYPE__)this); }
+};
+
+void fakeRef(Bar *)
+{
+}
+
+int main()
+{
+ // Create array of Bar. Will use default argument on constructor.
+ // The old compiler will loop constructing Bar. Each loop will
+ // construct a temporary Foo() but will not destruct the Foo().
+ // The Foo() temporary is destructed only once after the loop
+ // completes. This could lead to a memory leak if the constructor
+ // of Foo() allocates memory.
+ Bar bar[2];
+
+ fakeRef(bar);
+
+ printf("Done\n");
+
+ if (c == d && c == 2)
+ return 0;
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/thunk1.C b/gcc/testsuite/g++.old-deja/g++.other/thunk1.C
new file mode 100644
index 000000000..35243f529
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/thunk1.C
@@ -0,0 +1,36 @@
+// { dg-do run }
+extern "C" void abort();
+
+int ic;
+
+struct X
+{
+ X() { ++ic; }
+ X( const X & ) { ++ic; }
+ ~X() { if (--ic < 0) abort(); }
+};
+
+struct V
+{
+ virtual ~V() {}
+};
+
+struct A : public virtual V
+{
+};
+
+struct B : public virtual V
+{
+ virtual void foo( X ) = 0;
+};
+
+struct D : public A, public virtual B
+{
+ virtual void foo( X ) {}
+};
+
+int main()
+{
+ B *b = new D;
+ b->foo( X() );
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/type.C b/gcc/testsuite/g++.old-deja/g++.other/type.C
new file mode 100644
index 000000000..3c36c47ad
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/type.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+typedef unsigned short ushort;
+class foo {
+public:
+ static ushort a;
+};
+extern "C" {
+typedef unsigned short ushort;
+}
+ushort foo::a;
+static int baz()
+{
+ return foo::a;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typeck1.C b/gcc/testsuite/g++.old-deja/g++.other/typeck1.C
new file mode 100644
index 000000000..574fd7e28
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typeck1.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+extern int a[][]; // { dg-error "" } invalid multidimensional array
+extern int b[7][]; // { dg-error "" } invalid multidimensional array
+extern int c[][7]; // OK
+
+extern int (*i)[]; // { dg-error "" } previous declaration
+extern int (*i)[7]; // { dg-error "" } conflicting types for `i'
+
+extern int m[];
+extern int m[7]; // OK
+
+void f(int (*j)[3])
+{
+ extern int (*k)[];
+ f(k); // { dg-error "" } passing wrong type
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef1.C b/gcc/testsuite/g++.old-deja/g++.other/typedef1.C
new file mode 100644
index 000000000..38d77e1c6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef1.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+
+typedef const struct {
+ int x;
+} Test;
+
+static void foo(Test);
+
+static void foo(Test t)
+{
+ t.x = 0; // { dg-error "" } assignment of read-only member
+ return;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef2.C b/gcc/testsuite/g++.old-deja/g++.other/typedef2.C
new file mode 100644
index 000000000..8c451304e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef2.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+struct S{
+
+ static const int i;
+ static const int j;
+};
+
+typedef S T;
+const int T::i = 4;
+const int T::j = 4;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef3.C b/gcc/testsuite/g++.old-deja/g++.other/typedef3.C
new file mode 100644
index 000000000..99076b4e6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef3.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+template<class T>
+struct X{
+ T v;
+ X(){}
+ virtual ~X(){}
+ virtual inline T f(T x){return x;}
+};
+
+void f()
+{
+ typedef int H;
+ X<H> y;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef4.C b/gcc/testsuite/g++.old-deja/g++.other/typedef4.C
new file mode 100644
index 000000000..02aa4a674
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef4.C
@@ -0,0 +1,9 @@
+// { dg-do assemble }
+
+struct A {
+ void f ();
+};
+
+typedef A foo;
+
+void foo::f() { }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef5.C b/gcc/testsuite/g++.old-deja/g++.other/typedef5.C
new file mode 100644
index 000000000..f9e71479c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef5.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+
+typedef int t;
+typedef t* u;
+typedef u v;
+typedef v* (*w)(t);
+typedef int t;
+typedef t* u;
+typedef u v;
+typedef v* (*w)(t const); // this is ok
+typedef v* (*w)(t); // { dg-error "" } covers message `previously declared here'
+typedef v* (*const w)(t); // { dg-error "" } invalid redeclaration
+typedef v const* (*w)(t); // { dg-error "" } invalid redeclaration
+typedef v* const (*w)(t); // { dg-error "" } invalid redeclaration
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef6.C b/gcc/testsuite/g++.old-deja/g++.other/typedef6.C
new file mode 100644
index 000000000..29e9f92f9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef6.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// Submitted by Jason Merrill <jason@cygnus.com>.
+// Bug: g++ fails to see through the T typedef in the C ctor.
+
+struct A {
+ A (int) { }
+};
+
+typedef A T;
+
+struct B: public virtual T {
+ B (): T(1) { }
+};
+
+struct C: public B {
+ C (): T(1) { }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef7.C b/gcc/testsuite/g++.old-deja/g++.other/typedef7.C
new file mode 100644
index 000000000..42cf4f1c5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef7.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+typedef int I;
+typedef int I;
+
+// DR56 makes clear that duplicate typedefs in class scopes are
+// invalid.
+
+struct A {
+ typedef int I; // { dg-error "" }
+ typedef int I; // { dg-error "" }
+};
+
+template <class T>
+struct S {
+ typedef int I; // { dg-error "" }
+ typedef int I; // { dg-error "" }
+};
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef8.C b/gcc/testsuite/g++.old-deja/g++.other/typedef8.C
new file mode 100644
index 000000000..2d3507acc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef8.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Aug 2000 <nathan@codesourcery.com>
+
+// bug 39. We'd generated bogus errors when using a typedef of a nested class.
+
+struct X1
+{
+ typedef struct {
+ } MyStruct1;
+ typedef struct M2 {
+ } MyStruct2;
+};
+
+X1::MyStruct1 foo()
+{
+X1::MyStruct1 m1;
+return m1;
+}
+
+X1::MyStruct2 baz()
+{
+X1::MyStruct2 m1;
+return m1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typeid1.C b/gcc/testsuite/g++.old-deja/g++.other/typeid1.C
new file mode 100644
index 000000000..abe4f9df4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typeid1.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: sk@gluit.de
+
+#include <typeinfo>
+
+int main ()
+{
+ typeid(char*);
+
+ int len = 1;
+ char carr[len];
+ typeid(typeof(carr)); // { dg-error "" } type has variable size
+ typeid(carr); // { dg-error "" } type has variable size
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C b/gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C
new file mode 100644
index 000000000..0674988c5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+#include <typeinfo>
+
+struct S {
+ S (const char*);
+};
+
+void f(S s);
+void f(std::type_info);
+
+void g()
+{
+ f("abc");
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typename1.C b/gcc/testsuite/g++.old-deja/g++.other/typename1.C
new file mode 100644
index 000000000..4bf3de39f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typename1.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// { dg-options "-pedantic -Wno-deprecated" }
+// This code snippet should be rejected with -pedantic
+// Based on a test case by Louidor Erez <s3824888@techst02.technion.ac.il>
+
+
+template<class T>
+class Vector {
+public:
+ typedef T* iterator;
+};
+
+template<class T>
+void f()
+{
+ Vector<T>::iterator i = 0; // { dg-error "typename" } missing typename
+} // { dg-error "expected" "" { target *-*-* } 16 }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typename2.C b/gcc/testsuite/g++.old-deja/g++.other/typename2.C
new file mode 100644
index 000000000..7c87c5b09
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typename2.C
@@ -0,0 +1,7 @@
+// { dg-do assemble }
+
+template<typename T>
+void f()
+{
+ typename T::u; // { dg-error "" } declare anything
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C b/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C
new file mode 100644
index 000000000..6b2999cb9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C
@@ -0,0 +1,46 @@
+// { dg-do run }
+// { dg-options "-O2" }
+
+#include <iostream>
+#include <complex>
+
+using namespace std;
+
+class A {
+protected:
+ int a;
+ complex<double> *b;
+public:
+ A(int n);
+ inline complex<double>& operator[] (int x);
+};
+
+A::A(int n)
+{
+ a = n;
+ b = new complex<double>[a];
+ for (int i=0; i<a; i++) b[i] = complex<double>(0.0,0.0);
+}
+
+inline complex<double>& A::operator[](int x)
+{
+ if (x < 0 || x >= a)
+ cout << "x error" << endl;
+ return b[x];
+}
+
+void foo ()
+{
+ int n = 5;
+ A *o = new A(n);
+ A *p = new A(n);
+ for (int i = 0; i < n; i++) {
+ cout << i << endl;
+ (*o)[i] *= complex<double>((*p)[i].real(), (*p)[i].imag());
+ }
+}
+
+int main()
+{
+ foo();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/union1.C b/gcc/testsuite/g++.old-deja/g++.other/union1.C
new file mode 100644
index 000000000..37424a1f4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/union1.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+class A
+{
+ private:
+ int myInt;
+
+ public:
+ A& operator = (int right) {myInt = right; return *this;}
+};
+
+union B
+{
+ char f1;
+ A f2; // { dg-bogus "" } non-copy assignment op is OK
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/union2.C b/gcc/testsuite/g++.old-deja/g++.other/union2.C
new file mode 100644
index 000000000..5c2d7dcac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/union2.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+// Bug: g++ crashed on empty initializers for unions.
+// Bug: gcc and g++ didn't zero unions with empty initializers.
+// Submitted by J"orn Rennecke <amylaar@cygnus.co.uk>
+
+extern "C" void exit (int);
+
+typedef union u
+{
+ union u *up;
+ void *vp;
+} u;
+
+static u v = {};
+
+void bar (u);
+void baz (u);
+
+void foo()
+{
+ u w = {};
+ u x = { &v };
+ baz (x);
+ bar (w);
+}
+
+void baz (u w) { }
+
+void bar (u w)
+{
+ if (w.up)
+ exit (1);
+}
+
+int main ()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/union3.C b/gcc/testsuite/g++.old-deja/g++.other/union3.C
new file mode 100644
index 000000000..67903b761
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/union3.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct A
+{
+ union
+ {
+ int i;
+ };
+ int j;
+
+ A ();
+};
+
+A::A ()
+ : i (1), j (i = 0)
+{
+}
+
+int main ()
+{
+ A a;
+ return a.i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/union4.C b/gcc/testsuite/g++.old-deja/g++.other/union4.C
new file mode 100644
index 000000000..26f12e953
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/union4.C
@@ -0,0 +1,33 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+union A
+{
+ int i;
+ int j;
+
+ A () : i (3), j (2) {} // { dg-error "" } multiple initializations
+};
+
+union B
+{
+ int i;
+ union {
+ int j;
+ };
+
+ B () : i (3), j (2) {} // { dg-error "" } multiple initializations
+};
+
+union C
+{
+ union {
+ struct {
+ int i;
+ int j;
+ };
+ };
+
+ C () : i (3), j (2) {}
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using1.C b/gcc/testsuite/g++.old-deja/g++.other/using1.C
new file mode 100644
index 000000000..d734576ac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using1.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+class D2;
+
+class B {
+private:
+ int a; // { dg-error "" } B::a is private
+protected:
+ int b;
+
+ friend class D2;
+};
+
+class D : public B { // { dg-error "" } within this context
+public:
+ using B::a;
+ using B::b;
+};
+
+class D2 : public B { // { dg-error "" } conflicting access specifications
+public:
+ using B::a;
+ using B::b;
+
+private:
+ using B::b;
+};
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using2.C b/gcc/testsuite/g++.old-deja/g++.other/using2.C
new file mode 100644
index 000000000..92c65eb0b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using2.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+struct X{
+ void f();
+};
+
+struct Y:X{
+ void f(int);
+ void f();
+ using X::f;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using3.C b/gcc/testsuite/g++.old-deja/g++.other/using3.C
new file mode 100644
index 000000000..f30ecbc3d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using3.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+struct A{
+ A();
+};
+
+typedef struct {
+ A i;
+} S;
+
+struct B: S{
+ using S::S; // { dg-error "" } no such field
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using4.C b/gcc/testsuite/g++.old-deja/g++.other/using4.C
new file mode 100644
index 000000000..9d6e27e04
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using4.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+
+// Based on a testcase by Martin Bachtold <martinb@coyotesystems.com>
+
+struct foo {
+ void m();
+};
+
+struct bar : foo {
+ using foo::m;
+ void m(int);
+};
+
+void f() {
+ bar b;
+ b.m();
+ b.m(1);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using5.C b/gcc/testsuite/g++.old-deja/g++.other/using5.C
new file mode 100644
index 000000000..672530199
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using5.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+
+// Based on bug report by Klaus-Georg Adams
+// <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
+
+struct bar {
+ typedef bar t;
+};
+
+struct foo : bar {
+ using bar::t;
+ t field;
+ t meth();
+ void baz(t arg);
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using6.C b/gcc/testsuite/g++.old-deja/g++.other/using6.C
new file mode 100644
index 000000000..272c35dff
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using6.C
@@ -0,0 +1,30 @@
+// { dg-do run }
+// Test of class-scope using-declaration for functions.
+
+#define assert(COND) if (!(COND)) return 1
+
+struct A {
+ int f(int) { return 1; }
+ int f(char) { return 2; }
+};
+
+struct B {
+ int f(double) { return 3; }
+};
+
+struct C : public A, public B {
+ using A::f;
+ using B::f;
+ int f(char) { return 4; }
+ int f(C) { return 5; }
+};
+
+int main ()
+{
+ C c;
+
+ assert (c.f(1) == 1);
+ assert (c.f('a') == 4);
+ assert (c.f(2.0) == 3);
+ assert (c.f(c) == 5);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using7.C b/gcc/testsuite/g++.old-deja/g++.other/using7.C
new file mode 100644
index 000000000..07cf68b0a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using7.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+
+class A {
+protected:
+ static void f() {}
+};
+
+class B : A {
+public:
+ using A::f;
+ void g() {
+ f();
+ A::f();
+ }
+ struct C {
+ void g() {
+ f();
+ A::f();
+ }
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using8.C b/gcc/testsuite/g++.old-deja/g++.other/using8.C
new file mode 100644
index 000000000..2700bb27c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using8.C
@@ -0,0 +1,43 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com>
+
+// We rejected using decls bringing in functions from a base which would hide a
+// nested class of the same name, but only if we had no functions by that name
+// already. Also, we failed to find that using declaration during lookup. Also
+// we failed to reject using declarations which matched the constructor name.
+
+struct A
+{
+ int f ();
+ void D ();
+};
+
+struct A2 {
+ typedef int f;
+};
+
+struct B : A
+{
+ using A::f;
+ struct f {};
+};
+
+struct C : A
+{
+ using A::f;
+ int f (int);
+ struct f {};
+};
+
+void foo (B *bp, C* cp)
+{
+ bp->f ();
+ cp->f ();
+}
+
+struct D : A
+{
+ using A::D; // { dg-error "" } names constructor
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using9.C b/gcc/testsuite/g++.old-deja/g++.other/using9.C
new file mode 100644
index 000000000..0e34156d8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using9.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 75. using declarations cannot introduce functions which ambiguate
+// those in the current namespace, BUT here we're reaccessing the current
+// namespace -- the function is not being 'introduced'.
+
+extern int a();
+struct x {};
+
+using ::x;
+using ::a;
+
+extern "C" void foo (); // { dg-error "previous declaration" }
+
+namespace {
+ extern "C" int foo (); // { dg-error "C.*linkage" }
+ using ::foo; // { dg-error "" } already in use
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vaarg1.C b/gcc/testsuite/g++.old-deja/g++.other/vaarg1.C
new file mode 100644
index 000000000..bcc9df389
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vaarg1.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+#include <stdarg.h>
+#include <stdio.h>
+
+void f (int i, ...)
+{
+ va_list ap;
+
+ va_start (ap, i);
+ vprintf ("test", ap);
+ va_end (ap);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vaarg2.C b/gcc/testsuite/g++.old-deja/g++.other/vaarg2.C
new file mode 100644
index 000000000..278f5376f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vaarg2.C
@@ -0,0 +1,64 @@
+// { dg-do run }
+// { dg-options "-Wno-abi" { target arm_eabi } }
+// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 4 Oct 1999 <nathan@acm.org>
+
+// Make sure we can deal with POD aggregate in va_args
+
+#include <stdarg.h>
+extern "C" void abort ();
+
+struct X {int m;};
+struct Y {int a; int b; int c; int d; int e; int f;};
+
+void fn1(va_list args)
+{
+ int i = va_arg (args, int);
+ X x = va_arg (args, X);
+ Y y = va_arg (args, Y);
+ if (i != 1)
+ abort ();
+ if (x.m != 1)
+ abort ();
+ if (y.a != 1 || y.b != 2 || y.c != 3 || y.d != 4 ||
+ y.e != 5 || y.f != 6)
+ abort ();
+}
+
+void fn2(va_list args)
+{
+ const int &i = va_arg (args, int);
+ const X &x = va_arg (args, X);
+ const Y &y = va_arg (args, Y);
+ if (i != 1)
+ abort ();
+ if (x.m != 1)
+ abort ();
+ if (y.a != 1 || y.b != 2 || y.c != 3 || y.d != 4 ||
+ y.e != 5 || y.f != 6)
+ abort ();
+}
+
+void
+dispatch (int t, ...)
+{
+ va_list args;
+
+ va_start (args, t);
+ fn1 (args);
+ va_end (args);
+
+ va_start (args, t);
+ fn2 (args);
+ va_end (args);
+}
+
+int main ()
+{
+ X x = {1};
+ Y y = {1, 2, 3, 4, 5, 6};
+
+ dispatch (0, 1, x, y);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C b/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C
new file mode 100644
index 000000000..3408a1811
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C
@@ -0,0 +1,32 @@
+// { dg-do assemble }
+// { dg-options "-Wno-abi" { target arm_eabi } }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 4 Oct 1999 <nathan@acm.org>
+
+// Make sure we diagnose bad uses of va_arg
+
+#include <stdarg.h>
+
+struct X {int m;};
+struct Y { Y(const Y&); };
+struct Z; // { dg-error "forward decl" }
+void fn1(va_list args)
+{
+ int i = va_arg (args, int);
+ Y x = va_arg (args, Y); // { dg-error "cannot receive" }
+ Y y = va_arg (args, struct Y); // { dg-error "cannot receive" }
+ int &r = va_arg (args, int &); // { dg-error "cannot receive" }
+
+ Z z1 = va_arg (args, Z); // { dg-error "incomplete" }
+ const Z &z2 = va_arg (args, Z); // { dg-error "incomplete" }
+
+ va_arg (args, char); // { dg-warning "promote" }
+ // { dg-message "should pass" "pass" { target *-*-* } 24 }
+ // { dg-message "abort" "abort" { target *-*-* } 24 }
+ va_arg (args, int []); // { dg-error "array with unspecified bounds" } promote
+ va_arg (args, int ()); // { dg-warning "promoted" } promote
+ // { dg-message "abort" "abort" { target *-*-* } 28 }
+ va_arg (args, bool); // { dg-warning "promote" "promote" }
+ // { dg-message "abort" "abort" { target *-*-* } 30 }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vaarg4.C b/gcc/testsuite/g++.old-deja/g++.other/vaarg4.C
new file mode 100644
index 000000000..9ea165bda
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vaarg4.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// { dg-options "-Wno-abi" { target arm_eabi } }
+
+// Bug 845. We were treating __builtin_va_arg as a unary expr, not a primary,
+// and hence getting parse errors.
+
+typedef __builtin_va_list __gnuc_va_list;
+typedef __gnuc_va_list va_list;
+
+struct X { int y; };
+
+void func(va_list va)
+{
+ char* a = __builtin_va_arg(va, char**)[0];
+ int b = __builtin_va_arg(va, X*)->y;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vbase1.C b/gcc/testsuite/g++.old-deja/g++.other/vbase1.C
new file mode 100644
index 000000000..4392784f9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vbase1.C
@@ -0,0 +1,52 @@
+// { dg-do run }
+// { dg-options "-w" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int result;
+
+struct A {
+ A ();
+
+ int i;
+};
+
+A* ap;
+
+A::A ()
+{
+ ap = this;
+}
+
+struct B : virtual public A
+{
+ B ();
+ ~B ();
+
+ int j;
+};
+
+B::B () {
+ if ((A*) this != ap)
+ result = 1;
+}
+
+B::~B () {
+ if ((A*) this != ap)
+ result = 1;
+}
+
+struct C : public B {
+};
+
+struct D : public C, public B
+{
+};
+
+int main ()
+{
+ {
+ D d;
+ }
+
+ return result;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vbase2.C b/gcc/testsuite/g++.old-deja/g++.other/vbase2.C
new file mode 100644
index 000000000..812b54764
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vbase2.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int i;
+
+struct A
+{
+ ~A ();
+};
+
+A::~A () {
+ i = 1;
+}
+
+struct B : virtual public A {
+};
+
+struct C {
+ C ();
+
+ B b;
+};
+
+C::C () {
+ throw 3;
+}
+
+int main ()
+{
+ try {
+ C c;
+ } catch (...) {
+ }
+
+ if (i != 1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vbase3.C b/gcc/testsuite/g++.old-deja/g++.other/vbase3.C
new file mode 100644
index 000000000..2cdc8050a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vbase3.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: scott snyder <snyder@fnal.gov>
+
+class d0_Collection_Base {};
+
+template <class T>
+class d0_List
+ : virtual public d0_Collection_Base
+{
+public:
+ d0_List ();
+
+ template <class Input_Iterator>
+ d0_List (Input_Iterator first, Input_Iterator last)
+ ;
+};
+
+void tlist ()
+{
+ const d0_List<int> l4 (1, 2);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vbase4.C b/gcc/testsuite/g++.old-deja/g++.other/vbase4.C
new file mode 100644
index 000000000..178f4b7eb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vbase4.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 10 Jan 2001 <nathan@codesourcery.com>
+// Origin snyder@fnal.gov
+
+// Bug 933. Secondary vtables weren't correctly located for non-primary
+// virtual bases. Causing us to ICE.
+
+class d0_Object
+{
+public:
+virtual ~d0_Object ();
+};
+
+
+class M10 : virtual public d0_Object {};
+class M4 : virtual public M10 {};
+
+class M9
+: public M4, virtual public M10
+{
+public:
+M9 ();
+};
+
+M9::M9 () {}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vbase5.C b/gcc/testsuite/g++.old-deja/g++.other/vbase5.C
new file mode 100644
index 000000000..10c2f3131
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vbase5.C
@@ -0,0 +1,203 @@
+// { dg-do run }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 19 Jan 2001 <nathan@codesourcery.com>
+
+// Bug 1701. building a vbase path was not using the shortest number of
+// vbases. Normally that's just a pessimization, unfortunately during
+// constructoring it leads to uninitialized reads.
+
+extern "C" int printf (...);
+
+int fail = 0;
+
+/*{{{ struct Base*/
+struct Base
+{
+ unsigned m;
+ static Base *addr;
+
+ Base ();
+ virtual ~Base ();
+};
+/*}}}*/
+Base *Base::addr;
+/*{{{ Base::Base ()*/
+Base::Base ()
+{
+ printf ("Base (%u) ctor %x\n", sizeof (Base), this);
+ if (fail) ;
+ else if (addr)
+ fail = 1;
+ else
+ addr = this;
+}
+/*}}}*/
+/*{{{ Base::~Base ()*/
+Base::~Base ()
+{
+ printf ("Base dtor %x\n", this);
+ if (fail)
+ ;
+ else if (this != addr)
+ fail = 2;
+ else
+ addr = 0;
+}
+/*}}}*/
+
+/*{{{ struct M10 : virtual Base*/
+struct M10 : virtual Base
+{
+ int m;
+ static M10 *addr;
+
+ M10 ();
+ virtual ~M10 ();
+};
+/*}}}*/
+M10 *M10::addr;
+/*{{{ M10::M10 ()*/
+M10::M10 ()
+{
+ printf ("M10 (%u) ctor %x\n", sizeof (M10), this);
+ if (fail) ;
+ else if (addr)
+ fail = 3;
+ else
+ addr = this;
+}
+/*}}}*/
+/*{{{ M10::~M10 ()*/
+M10::~M10 ()
+{
+ printf ("M10 dtor %x\n", this);
+ if (fail)
+ ;
+ else if (this != addr)
+ fail = 4;
+ else
+ addr = 0;
+}
+/*}}}*/
+
+/*{{{ struct M4 : virtual Base, virtual M10*/
+struct M4 : virtual Base, virtual M10
+{
+ int m;
+ static M4 *addr;
+
+ M4 ();
+ virtual ~M4 ();
+};
+/*}}}*/
+M4 *M4::addr;
+/*{{{ M4::M4 ()*/
+M4::M4 ()
+{
+ printf ("M4 (%u) ctor %x\n", sizeof (M4), this);
+ if (fail) ;
+ else if (addr)
+ fail = 5;
+ else
+ addr = this;
+}
+/*}}}*/
+/*{{{ M4::~M4 ()*/
+M4::~M4 ()
+{
+ printf ("M4 dtor %x\n", this);
+ if (fail)
+ ;
+ else if (this != addr)
+ fail = 6;
+ else
+ addr = 0;
+}
+/*}}}*/
+
+/*{{{ struct M5 : M4*/
+struct M5 : M4
+{
+ int m;
+ static M5 *addr;
+
+ M5 ();
+ virtual ~M5 ();
+};
+/*}}}*/
+M5 *M5::addr;
+/*{{{ M5::M5 ()*/
+M5::M5 ()
+{
+ printf ("M5 (%u) ctor %x\n", sizeof (M5), this);
+ if (fail) ;
+ else if (addr)
+ fail = 7;
+ else
+ addr = this;
+}
+/*}}}*/
+/*{{{ M5::~M5 ()*/
+M5::~M5 ()
+{
+ printf ("M5 dtor %x\n", this);
+ if (fail)
+ ;
+ else if (this != addr)
+ fail = 8;
+ else
+ addr = 0;
+}
+/*}}}*/
+
+/*{{{ struct M9 : M5, virtual M10*/
+struct M9 : M5, virtual M10
+{
+ int m;
+ static M9 *addr;
+
+ M9 ();
+ virtual ~M9 ();
+};
+/*}}}*/
+M9 *M9::addr;
+/*{{{ M9::M9 ()*/
+M9::M9 ()
+{
+ printf ("M9 (%u), ctor %x\n", sizeof (M9), this);
+ if (fail) ;
+ else if (addr)
+ fail = 9;
+ else
+ addr = this;
+}
+/*}}}*/
+/*{{{ M9::~M9 ()*/
+M9::~M9 ()
+{
+ printf ("M9 dtor %x\n", this);
+ if (fail)
+ ;
+ else if (this != addr)
+ fail = 10;
+ else
+ addr = 0;
+}
+/*}}}*/
+
+int main ()
+{
+ M9 *m9;
+ Base *r;
+
+ m9 = new M9 ();
+ r = m9;
+ if (fail)
+ return fail;
+ void *top = dynamic_cast <void *> (r);
+ if (top != m9)
+ return 20;
+ r->~Base ();
+
+ return fail;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual10.C b/gcc/testsuite/g++.old-deja/g++.other/virtual10.C
new file mode 100644
index 000000000..ba3dea700
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual10.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com>
+
+// We failed to spot a static member which overrode a virtual
+
+struct A
+{
+ virtual int foo (char);
+ static int foo ();
+ virtual int foo (int); // { dg-error "" } this function
+ static int foo (float);
+ virtual int foo (double);
+};
+
+struct B : A
+{
+ static int foo (int); // { dg-error "" } cannot override
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual11.C b/gcc/testsuite/g++.old-deja/g++.other/virtual11.C
new file mode 100644
index 000000000..8b46dc754
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual11.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com>
+
+// We failed to check virtual functions hidden by using declarations.
+
+struct A
+{
+ virtual int foo ();
+};
+
+struct B
+{
+ virtual void foo (); // { dg-error "" } of this function
+};
+
+struct C : A , B
+{
+};
+
+struct D : C
+{
+ void foo (short);
+ using A::foo;
+};
+
+struct E : D
+{
+ virtual int foo (); // { dg-error "" } invalid override
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual2.C b/gcc/testsuite/g++.old-deja/g++.other/virtual2.C
new file mode 100644
index 000000000..c93b89f44
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual2.C
@@ -0,0 +1,20 @@
+// { dg-do run }
+struct B
+{
+ virtual int f() volatile
+ { return 0; }
+};
+
+
+struct D : public B
+{
+ virtual int f()
+ { return 1; }
+};
+
+int main()
+{
+ volatile D d;
+ volatile B& b = d;
+ return b.f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual3.C b/gcc/testsuite/g++.old-deja/g++.other/virtual3.C
new file mode 100644
index 000000000..c62af5444
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual3.C
@@ -0,0 +1,25 @@
+// { dg-do run }
+struct B
+{
+ virtual int f() volatile
+ { return 1; }
+};
+
+struct D : public B
+{
+ int f()
+ { return 0; }
+};
+
+struct D2 : public D
+{
+ int f()
+ { return 2; }
+};
+
+int main()
+{
+ D2 d2;
+ D& d = d2;
+ return d.f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual4.C b/gcc/testsuite/g++.old-deja/g++.other/virtual4.C
new file mode 100644
index 000000000..6933755ab
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual4.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+
+class A {
+public:
+ virtual int foo() = 0; // { dg-error "" } original definition
+};
+
+class B {
+public:
+ virtual double foo() = 0;
+};
+
+class C
+ : public A, public B
+{
+public:
+ virtual double foo() { return 2; } // { dg-error "" } conflicting return type
+};
+
+class D
+ : public B, public A
+{
+public:
+ virtual double foo() { return 2; } // { dg-error "" } conflicting return type
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual5.C b/gcc/testsuite/g++.old-deja/g++.other/virtual5.C
new file mode 100644
index 000000000..e163e9e41
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual5.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-w" }
+// Origin: Derived from code by Andris Pavenis <andris@stargate.astr.lu.lv>
+
+class vector {};
+
+class V
+{
+};
+
+class A : public vector
+{
+};
+
+class B : public A, virtual V, public vector
+{
+ B() {}
+};
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual6.C b/gcc/testsuite/g++.old-deja/g++.other/virtual6.C
new file mode 100644
index 000000000..37a1797fb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual6.C
@@ -0,0 +1,14 @@
+// { dg-do assemble }
+// { dg-options "-Woverloaded-virtual" }
+// Bug: g++ checks certain non-virtual functions to see if they override
+// virtual functions.
+// Submitted by Jason Merrill <jason@cygnus.com>
+
+struct A {
+ virtual void f (int);
+};
+
+struct B: public A {
+ static void f ();
+ void f (int);
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual7.C b/gcc/testsuite/g++.old-deja/g++.other/virtual7.C
new file mode 100644
index 000000000..20845eced
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual7.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// { dg-options "-fno-rtti" }
+// Origin: Anthony Green <green@cygnus.com>
+
+class _JvObjectPrefix
+{
+protected:
+ virtual void finalize (void) = 0;
+};
+
+class Object : public _JvObjectPrefix
+{
+protected:
+ virtual void finalize (void);
+};
+
+Object x;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual8.C b/gcc/testsuite/g++.old-deja/g++.other/virtual8.C
new file mode 100644
index 000000000..f1ec9ada6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual8.C
@@ -0,0 +1,32 @@
+// { dg-do run }
+extern "C" int printf (const char*, ...);
+
+struct A
+{
+ virtual void f () {
+ printf ("%x\n", this);
+ }
+};
+
+struct B : public A
+{
+};
+
+struct C : public A
+{
+};
+
+struct D : virtual public B, public C
+{
+};
+
+int main ()
+{
+ D d;
+
+ A* a1 = (A*) (B*) &d;
+ A* a2 = (A*) (C*) &d;
+
+ a1->f ();
+ a2->f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual9.C b/gcc/testsuite/g++.old-deja/g++.other/virtual9.C
new file mode 100644
index 000000000..c10eef69f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/virtual9.C
@@ -0,0 +1,46 @@
+// { dg-do run }
+// Source: Neil Booth, from PR #111.
+
+class A
+{
+public :
+ int i;
+};
+
+class B : virtual public A
+{
+};
+
+class C : virtual public A
+{
+};
+
+class D : public B, public C
+{
+public :
+ int f(void);
+ int g(void);
+};
+
+int D::f(void)
+{
+ return B::i;
+}
+
+int D::g(void)
+{
+ return this->B::i;
+}
+
+D d;
+extern "C" void abort (void);
+
+int main(void)
+{
+ d.C::i=325;
+
+ if (d.f() != d.B::i || d.f() != d.g())
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/volatile1.C b/gcc/testsuite/g++.old-deja/g++.other/volatile1.C
new file mode 100644
index 000000000..ca28ec8e4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/volatile1.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Test that failed lvalue-to-rvalue conversion of vf doesn't crash the
+// compiler.
+
+class f_class // { dg-message "note" "candidates" }
+{ };
+
+volatile f_class
+ret_v_f_class()
+{
+ f_class t;
+ return t;
+}
+
+int main(void)
+{
+ volatile f_class vf;
+ 0 ? ret_v_f_class() : vf; // { dg-error "match" } can't copy volatile lvalue
+ // { dg-message "candidate" "candidate note" { target *-*-* } 18 }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vtbl1.C b/gcc/testsuite/g++.old-deja/g++.other/vtbl1.C
new file mode 100644
index 000000000..a8157f43f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vtbl1.C
@@ -0,0 +1,15 @@
+// { dg-do link }
+// Origin: DJ Delorie <dj@delorie.com>
+
+class X {
+public:
+ int i;
+ X() { i = 0; }
+ ~X();
+ virtual int foo() { return i; }
+ virtual void bar();
+};
+
+int main()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vtbl2.C b/gcc/testsuite/g++.old-deja/g++.other/vtbl2.C
new file mode 100644
index 000000000..5c7721e42
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vtbl2.C
@@ -0,0 +1,77 @@
+// { dg-do run }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 8 Feb 2000 <nathan@acm.org>
+
+// vtable construction reorganisation broke this
+
+// execution test
+
+#include <stdio.h>
+
+static int fail = 0;
+
+void bad (char const *name)
+{
+ printf ("Bad %s\n", name);
+ fail = 1;
+}
+void ok (char const *name)
+{
+ printf ("Ok %s\n", name);
+}
+
+struct Core
+{
+ virtual ~Core ();
+ virtual void Wibble () {bad (__PRETTY_FUNCTION__);}
+ virtual void Wobble () {bad (__PRETTY_FUNCTION__);}
+ virtual void Bogus () {bad (__PRETTY_FUNCTION__);}
+};
+struct Side
+{
+ virtual ~Side ();
+ virtual void Arfle () {bad (__PRETTY_FUNCTION__);}
+ virtual void Barfle () {bad (__PRETTY_FUNCTION__);}
+ virtual void Gloop () {bad (__PRETTY_FUNCTION__);}
+ virtual void Glorp () {bad (__PRETTY_FUNCTION__);}
+ virtual void Glump () {bad (__PRETTY_FUNCTION__);}
+ virtual void Bogus () {bad (__PRETTY_FUNCTION__);}
+};
+struct Base : Core
+{
+ virtual ~Base ();
+ virtual void Bink () {bad (__PRETTY_FUNCTION__);}
+ virtual void Bonk () {bad (__PRETTY_FUNCTION__);}
+ virtual void Bogus () {bad (__PRETTY_FUNCTION__);}
+};
+struct Multi : Base, Side
+{
+ virtual ~Multi ();
+ virtual void Stomped () {ok (__PRETTY_FUNCTION__);}
+ virtual void Bunk () {bad (__PRETTY_FUNCTION__);}
+ virtual void Bogus () {bad (__PRETTY_FUNCTION__);}
+};
+struct Trail : Multi
+{
+ virtual ~Trail ();
+};
+Core::~Core () {}
+Side::~Side () {}
+Base::~Base () {}
+Multi::~Multi () {}
+Trail::~Trail () {}
+
+void foo (Multi *ptr)
+{
+ ptr->Stomped ();
+}
+
+int main ()
+{
+ Multi m;
+ Trail t;
+
+ foo (&m);
+ foo (&t);
+ return fail != 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn01.C b/gcc/testsuite/g++.old-deja/g++.other/warn01.C
new file mode 100644
index 000000000..3f569421f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn01.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "-W -Wall" }
+
+typedef unsigned long size_t;
+extern void* malloc (size_t);
+extern void free (void*);
+extern void* realloc (void*, size_t);
+
+struct vtable {
+ void* (* _malloc) (size_t);
+ void (* _free) (void*);
+ void* (* _realloc) (void*, size_t);
+};
+
+struct vtable mtable = { malloc, free }; // { dg-warning "" } _realloc
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn3.C b/gcc/testsuite/g++.old-deja/g++.other/warn3.C
new file mode 100644
index 000000000..3080f93b9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn3.C
@@ -0,0 +1,55 @@
+// { dg-do assemble }
+// { dg-options "-Wctor-dtor-privacy" }
+
+class A {
+};
+
+
+class B { // { dg-warning "" } only private constructors
+public:
+ void f();
+
+private:
+ B ();
+ B (const B&);
+};
+
+
+class C { // { dg-warning "" } only private destructors
+public:
+ void f();
+
+private:
+ ~C ();
+};
+
+
+class D { // { dg-warning "" } all member functions are private
+private:
+ void f();
+};
+
+
+template <class T>
+class X { // { dg-warning "" } only private destructors
+private:
+ ~X ();
+};
+
+template class X<int>;
+template class X<double>;
+
+
+template <class T>
+class Y { // { dg-warning "" } only private constructors
+private:
+ Y ();
+ Y (const Y&);
+};
+
+
+template <class T>
+class Z { // { dg-warning "" } all member functions are private
+private:
+ void f();
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn4.C b/gcc/testsuite/g++.old-deja/g++.other/warn4.C
new file mode 100644
index 000000000..7973c75d0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn4.C
@@ -0,0 +1,68 @@
+// { dg-do assemble }
+// { dg-options "-Wsign-conversion" }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
+
+// make sure we only warn on assigning a negative (signed) value
+// to an unsigned type, and don't warn just if the unsigned value
+// happens to have the top bit set.
+
+typedef unsigned U;
+
+void fn (unsigned);
+
+void fu ()
+{
+ unsigned s1 = -1u;
+ unsigned s2(-1u);
+ unsigned volatile s3 = -1u;
+ unsigned const s4 = -1u;
+ unsigned const &s5(-1u);
+ s1 = -1u;
+ fn (-1u);
+}
+
+void fU ()
+{
+ U s1 = -1u;
+ U s2(-1u);
+ U volatile s3 = -1u;
+ U const s4 = -1u;
+ U const &s5(-1u);
+ s1 = -1u;
+ fn (-1u);
+}
+
+void fs ()
+{
+ unsigned s1 = -1; // { dg-warning "" } initialization
+ unsigned s2(-1); // { dg-warning "" } initialization
+ unsigned volatile s3 = -1;// { dg-warning "" } initialization
+ unsigned const s4 = -1; // { dg-warning "" } initialization
+ unsigned const &s5(-1); // { dg-warning "" } initialization
+ s1 = -1; // { dg-warning "" } assignment
+ fn (-1); // { dg-warning "" } passing
+}
+
+void fss ()
+{
+ unsigned s1 = -(-1);
+ unsigned s2(-(-1));
+ unsigned volatile s3 = -(-1);
+ unsigned const s4 = -(-1);
+ unsigned const &s5(-(-1));
+ s1 = -(-1);
+ fn (-(-1));
+}
+
+void fsz ()
+{
+ unsigned s1 = -0;
+ unsigned s2(-0);
+ unsigned volatile s3 = -0;
+ unsigned const s4 = -0;
+ unsigned const &s5(-0);
+ s1 = -0;
+ fn (-0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn5.C b/gcc/testsuite/g++.old-deja/g++.other/warn5.C
new file mode 100644
index 000000000..84fa3e426
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn5.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// { dg-options "-W " }
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Febs 2001 <nathan@codesourcery.com>
+
+// Bug 1765. We gave bogus warning on default initializer.
+
+struct X
+{
+ int i;
+};
+
+X *foo ()
+{
+ return new X (); // gets bogus warning
+}
+
+X x = {}; // { dg-warning "" } missing initializer
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn6.C b/gcc/testsuite/g++.old-deja/g++.other/warn6.C
new file mode 100644
index 000000000..4325df74b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn6.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// { dg-options "-W -Wall" }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Mar 2001 <nathan@codesourcery.com>
+
+// Bug 2139. We gave an erronous warning about an unused parm on a
+// synthesized function
+
+struct A
+{
+ virtual ~A ();
+};
+void foo (A const &a)
+{
+ A a1 = a;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn7.C b/gcc/testsuite/g++.old-deja/g++.other/warn7.C
new file mode 100644
index 000000000..c7684d18c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn7.C
@@ -0,0 +1,45 @@
+// { dg-do assemble }
+// { dg-options "-W -Wall" }
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 April 2001 <nathan@codesourcery.com>
+
+// Bug 2356. Unused parameter information introduced in a ctor
+// definition was not propagated to clones, leading to missed or
+// unwarranted unused parameter warnings, possibly given twice.
+
+struct X
+{
+ X(int i);
+ void foo (int i);
+
+};
+void foo (int i);
+
+X::X(int)
+{
+}
+void X::foo (int)
+{
+}
+void foo (int)
+{
+}
+
+struct Y
+{
+ Y(int);
+ void bar (int);
+
+};
+void bar (int);
+
+Y::Y(int i) // { dg-warning "unused parameter" }
+{
+}
+void Y::bar (int i) // { dg-warning "unused parameter" }
+{
+}
+void bar (int i) // { dg-warning "unused parameter" }
+{
+}