From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; 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. --- gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C | 44 +++++++ gcc/testsuite/g++.old-deja/g++.robertl/README | 25 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb10.C | 30 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb102.C | 35 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb103.C | 11 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb104.C | 30 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb105.C | 13 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb106.C | 36 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb107.C | 20 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb108.C | 21 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb109.C | 75 ++++++++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb11.C | 29 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb110.C | 26 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb111.C | 7 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb112.C | 11 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb113.C | 6 + gcc/testsuite/g++.old-deja/g++.robertl/eb114.C | 30 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb115.C | 10 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb116.C | 24 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb119.C | 12 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb12.C | 32 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb120.C | 23 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb121.C | 21 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb122.C | 10 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb123.C | 10 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb124.C | 5 + gcc/testsuite/g++.old-deja/g++.robertl/eb125.C | 22 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb126.C | 30 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb127.C | 61 ++++++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb128.C | 12 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb129.C | 23 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb129a.C | 22 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb13.C | 16 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb130.C | 11 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb131.C | 22 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb132.C | 28 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C | 16 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C | 16 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb133c.C | 17 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb14.C | 40 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb15.C | 28 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb16.C | 14 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb17.C | 59 +++++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb18.C | 8 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb19.C | 16 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb2.C | 17 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb20.C | 33 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb21.C | 25 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb22.C | 29 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb23.C | 20 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb24.C | 23 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb26.C | 31 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb27.C | 42 +++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb28.C | 20 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb29.C | 19 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb3.C | 11 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb30.C | 16 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb31.C | 20 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb32.C | 12 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb33.C | 12 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb34.C | 19 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb35.C | 38 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb36.C | 19 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb37.C | 26 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb38.C | 37 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb39.C | 18 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb4.C | 50 ++++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb41.C | 14 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb43.C | 44 +++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb44.C | 39 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb45.C | 6 + gcc/testsuite/g++.old-deja/g++.robertl/eb46.C | 31 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb48.C | 10 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb49.C | 48 ++++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb5.C | 13 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb50.C | 17 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb51.C | 36 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb52.C | 37 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb54.C | 10 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb55.C | 12 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb56.C | 10 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb57.C | 7 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb58.C | 15 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb59.C | 31 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb6.C | 14 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb60.C | 18 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb61.C | 8 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb62.C | 7 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb63.C | 17 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb64.C | 25 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb65.C | 25 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb66.C | 27 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb67.C | 6 + gcc/testsuite/g++.old-deja/g++.robertl/eb69.C | 23 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb7.C | 16 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb70.C | 17 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb71.C | 37 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb73.C | 15 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb74.C | 33 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb75.C | 19 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb76.C | 18 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb77.C | 33 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb79.C | 33 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb8.C | 14 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb80.C | 7 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb81.C | 42 +++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb82.C | 13 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb83.C | 18 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb84.C | 18 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb86.C | 7 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb87.C | 7 ++ gcc/testsuite/g++.old-deja/g++.robertl/eb88.C | 16 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb9.C | 22 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb90.C | 22 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb91.C | 86 +++++++++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb92.C | 2 + gcc/testsuite/g++.old-deja/g++.robertl/eb93.C | 31 +++++ gcc/testsuite/g++.old-deja/g++.robertl/eb94.C | 16 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb95.C | 18 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb97.C | 25 ++++ gcc/testsuite/g++.old-deja/g++.robertl/eb98.C | 19 +++ gcc/testsuite/g++.old-deja/g++.robertl/eb99.C | 135 +++++++++++++++++++++ .../g++.old-deja/g++.robertl/ebnull-cast.C | 19 +++ .../g++.old-deja/g++.robertl/ebnull-oldcast.C | 18 +++ gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C | 18 +++ .../g++.old-deja/g++.robertl/eh990323-1.C | 77 ++++++++++++ .../g++.old-deja/g++.robertl/eh990323-2.C | 103 ++++++++++++++++ .../g++.old-deja/g++.robertl/eh990323-3.C | 30 +++++ .../g++.old-deja/g++.robertl/eh990323-4.C | 104 ++++++++++++++++ .../g++.old-deja/g++.robertl/eh990323-5.C | 68 +++++++++++ .../g++.old-deja/g++.robertl/ice990323-1.C | 9 ++ .../g++.old-deja/g++.robertl/ice990323-2.C | 88 ++++++++++++++ .../g++.old-deja/g++.robertl/ice990323-3.C | 15 +++ .../g++.old-deja/g++.robertl/ice990323-4.C | 13 ++ .../g++.old-deja/g++.robertl/ice990323-5.C | 12 ++ 135 files changed, 3457 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/README create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb10.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb102.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb103.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb104.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb105.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb106.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb107.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb108.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb109.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb11.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb110.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb111.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb112.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb113.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb114.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb115.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb116.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb119.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb12.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb120.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb121.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb122.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb123.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb124.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb125.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb126.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb127.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb128.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb129.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb129a.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb13.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb130.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb131.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb132.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb133c.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb14.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb15.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb16.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb17.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb18.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb19.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb2.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb20.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb21.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb22.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb23.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb24.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb26.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb27.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb28.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb29.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb3.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb30.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb31.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb32.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb33.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb34.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb35.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb36.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb37.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb38.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb39.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb4.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb41.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb43.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb44.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb45.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb46.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb48.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb49.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb5.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb50.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb51.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb52.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb54.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb55.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb56.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb57.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb58.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb59.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb6.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb60.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb61.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb62.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb63.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb64.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb65.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb66.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb67.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb69.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb7.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb70.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb71.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb73.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb74.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb75.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb76.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb77.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb79.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb8.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb80.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb81.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb82.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb83.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb84.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb86.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb87.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb88.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb9.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb90.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb91.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb92.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb93.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb94.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb95.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb97.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb98.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eb99.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/ebnull-cast.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/ebnull-oldcast.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eh990323-1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eh990323-2.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eh990323-3.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eh990323-4.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/eh990323-5.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/ice990323-2.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/ice990323-3.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/ice990323-4.C create mode 100644 gcc/testsuite/g++.old-deja/g++.robertl/ice990323-5.C (limited to 'gcc/testsuite/g++.old-deja/g++.robertl') diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C b/gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C new file mode 100644 index 000000000..860080ea9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C @@ -0,0 +1,44 @@ +// { dg-do run } +// { dg-options "-g" } +// Internal compiler error on egcs 1.0.1 i586-pc-linux-gnulibc1. +// From: Max Lawson +// Message-Id: <9803091022.AA07520@drfmc.ceng.cea.fr> + + +typedef __SIZE_TYPE__ size_t; + +struct dummy { }; + +struct arrrrrgh { }; + +template +struct whyyyyyyy { }; + +template +struct grrrrrrrr { }; + +template +class no_future +{ +public: + + template + no_future(const grrrrrrrr*,S>& man ) { } + + ~no_future( ) { } + +private: + + no_future(const no_future&); + no_future& operator=(const no_future&); +}; + +int main( ) +{ + grrrrrrrr*> man; + + no_future here(man); + + return 0; +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/README b/gcc/testsuite/g++.old-deja/g++.robertl/README new file mode 100644 index 000000000..220d57d3d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/README @@ -0,0 +1,25 @@ +This directory contains a hodgepodge of problem reports that appeared on +the egcs-bugs or egcs mailing lists. Just like the reports themselves, +they tend to be poorly understood and poorly organized. However, we +drop them into the testsuite on the premise that internal compiler errors +are always bad - no matter how bogus the source. + +If you really understand C++ (and you know who you are) if you find +entries in this area that are bogus, feel free to just fix them or nuke +them. You don't need my permission. + +Many of the first entries in this area were done in "block mode" by +whipping through many months of archives. In hindsight, some important +information was lost, but being picky on over 8,000 messages is a sure +way to never get out of the gate. + +We'll do better now. + +Robert Lipe + + +Copyright (C) 1998 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb10.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb10.C new file mode 100644 index 000000000..ba9c6db7d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb10.C @@ -0,0 +1,30 @@ +// { dg-do assemble } +template +class _fixed_size_allocator +{ + private: + + struct something { }; + static something * asdf; + + public: + + static void delete_object (); +}; + + +template +class object_allocator +{ + private: + + typedef _fixed_size_allocator allocator; + + public: + + static void deallocate (T * p) + { + allocator::delete_object (reinterpret_cast (p)); + } +}; + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C new file mode 100644 index 000000000..c82fd56d9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C @@ -0,0 +1,35 @@ +// { dg-do run } +// Error: intenral compiler error on 1998/05/28 snapshot. +#include +#include + +void evilRises (void **ptr) +{ + int *pi; + + pi = new int; + + *pi = 0; + + *ptr = (void *)pi; +} + +int main (int argc, char *argv[]) +{ +#ifdef WORKAROUND + union foo +#else + union +#endif + { + int a; + int b; + int c; + } *fred, barney; + + evilRises((void **)&fred); + + barney = *fred; + + return EXIT_SUCCESS; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb103.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb103.C new file mode 100644 index 000000000..c272d9403 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb103.C @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Error: Internal compiler error in 2.7.2 & EGCS 1.0.0 + +template +inline unsigned f (unsigned* ptr); +template +inline unsigned f (unsigned* ptr) // { dg-error "function template partial specialization" } +{ + return 1; +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb104.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb104.C new file mode 100644 index 000000000..d399a5f84 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb104.C @@ -0,0 +1,30 @@ +// { dg-do run } +#include + +class SomeClass_t { +public: + SomeClass_t () : x (11) {} +protected: + float x; +}; + +class DynamicOnly_t { +public: + static DynamicOnly_t* create (const char* name = "UNDEF", + const SomeClass_t& somec = *(new SomeClass_t +())) { + return new DynamicOnly_t (name, somec); + } + DynamicOnly_t (const char* name, const SomeClass_t& somec) : + m_somec (somec) { + strncpy (m_Name, name, sizeof (m_Name)); + } +private: + SomeClass_t m_somec; + char m_Name[255]; +}; + +int main (int argc, char* argv[]) { + DynamicOnly_t* ptr = DynamicOnly_t::create (); + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb105.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb105.C new file mode 100644 index 000000000..400b15b95 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb105.C @@ -0,0 +1,13 @@ +// { dg-do assemble } +template< class T > +void sort( T* t, int n ) + { + struct +/*line5*/ { + int operator()(T i, T j) + { + return (i < j) ? -1 : ((j < i) ? 1 : 0) ; + } + } c ; + sort(t, n, c, 0) ; + } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C new file mode 100644 index 000000000..b341cff55 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C @@ -0,0 +1,36 @@ +// { dg-do assemble { target native } } +// { dg-options "-O2 -fPIC " } +struct T +{ + const char* f1; + int f2; +}; + +void f(T*); +int g(); + +extern char a1[]; + +inline int m(int a, int b) {return b < a ? 2 : 1;} + +void +h() +{ + T a[10]; + int i(0); + + bool c; + if (c) + { + a[i++].f1 = "asf"; + f(a); + i = 0; + } + + a[i].f1 = &a1[1]; + a[i].f2 = m(1, g()); + i++; + + a[i].f1 = "zxv"; + a[i].f2 = 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb107.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb107.C new file mode 100644 index 000000000..3e90a9cc1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb107.C @@ -0,0 +1,20 @@ +// { dg-do assemble } +template +struct X +{ + virtual void f(int) const; +}; + +template +struct Y: public X +{ + virtual void f(int) const; +}; + +template +void Y::f(int) const +{ +} + +template <> +void Y::f(int) const; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb108.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb108.C new file mode 100644 index 000000000..3f19c2ad7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb108.C @@ -0,0 +1,21 @@ +// { dg-do assemble } +class X +{ + public: + virtual void f() const = 0; +}; + +template +class Y: public X +{ + public: + virtual void f() const; +}; + +template +void Y::f() const +{ +} + +template <> +void Y::f() const; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C new file mode 100644 index 000000000..f34907626 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C @@ -0,0 +1,75 @@ +// { dg-do assemble } +#include +#include +#include +#include + +using namespace std; + +// empty parameter class with a minimal set of operations +// if there are no weights for edges necessary +struct Empty +{ + public: + Empty(int=0) {} + bool operator<(const Empty&) const { return true;} +}; +inline ostream& operator<<(ostream& os, const Empty&) { return os;} +inline istream& operator>>(istream& is, Empty& ) { return is;} + + +template +class Graph // { dg-message "note" } candidates +{ + public: + // public type interface + typedef std::map Successor; + typedef std::pair vertex; + typedef std::vector GraphType; + typedef typename GraphType::iterator iterator; + typedef typename GraphType::const_iterator const_iterator; + + // a lot of stuff deleted .... + + private: + bool directed; + GraphType C; // container + ostream* pOut; +}; + +// all graph-methods delet +template +ostream& operator<<(ostream& os, Graph& G) +{ + // display of vertices with successors + for(int i = 0; i < G.size(); ++i) // { dg-error "no member" } no size function + { + os << G[i].first << " <"; // { dg-error "no match" } no index operator + + // The compiler does not like this line!!!!!! + typename Graph::Successor::iterator + startN = G[i].second.begin(), // { dg-error "no match" } no index operator + endN = G[i].second.end(); // { dg-error "no match" } no index operator + + while(startN != endN) + { + os << G[(*startN).first].first << ' ' // { dg-error "no match" } no index operator + << (*startN).second << ' '; + ++startN; + } + os << ">\n"; + } + return os; +} + +int main() +{ + // no edge weighting, therefore type Empty: + Graph V(true); // { dg-error "no match" } no bool constructor + // { dg-message "candidate" "candidate note" { target *-*-* } 68 } + // ReadGraph(V, "gra1.dat"); + + // display of vertices with successors + cout << V; + +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C new file mode 100644 index 000000000..e5f29a157 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C @@ -0,0 +1,29 @@ +// { dg-do assemble } + +template +struct meta_max { + enum { max = (N1 > N2) ? N1 : N2 }; +}; + +struct X { + enum { + a = 0, + n = 0 + }; +}; + +template +struct Y { + + enum { + a = T1::a + T2::a, + + // NB: if the next line is changed to + // n = (T1::n > T2::n) ? T1::n : T2::n + // the problem goes away. + + n = meta_max::max + }; +}; + +int z = Y::a; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb110.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb110.C new file mode 100644 index 000000000..96b085f9b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb110.C @@ -0,0 +1,26 @@ +// { dg-do assemble } +class X +{ + public: + virtual void f() const = 0; +}; + +template +class Y: public X +{ + public: + virtual void f() const; +}; + +template +void Y::f() const +{ +} + +template <> +void Y::f() const; + +template <> +void Y::f() const +{ +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb111.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb111.C new file mode 100644 index 000000000..c671de459 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb111.C @@ -0,0 +1,7 @@ +// { dg-do run } + int main() { + for(int i=1; i < 9; i++); + for(int i=1; i < 9; i++); + + return 0; + } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb112.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb112.C new file mode 100644 index 000000000..69ee83c7d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb112.C @@ -0,0 +1,11 @@ +// { dg-do assemble } +template inline STRUCT * +setback(MEMBER *bp, MEMBER STRUCT::*offset) +{ + // The implementation of this function may be platform dependend + if(!bp) return 0; // NULL pointers remain NULL + union { int i; MEMBER STRUCT::*of; } u; // Switch types. Casting won't work. + u.of = offset; + return (STRUCT *) ((int) bp - u.i); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C new file mode 100644 index 000000000..9c7ca6bfa --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C @@ -0,0 +1,6 @@ +// { dg-do assemble } +#include + +class X : public std::streambuf +{ +} ; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb114.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb114.C new file mode 100644 index 000000000..265d16c5e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb114.C @@ -0,0 +1,30 @@ +// { dg-do run } +#include + +class SomeClass_t { +public: + SomeClass_t () : x (11) {} +protected: + float x; +}; + +class DynamicOnly_t { +public: + static DynamicOnly_t* create (const char* name = "UNDEF", + const SomeClass_t& somec = *(new SomeClass_t +())) { + return new DynamicOnly_t (name, somec); + } + DynamicOnly_t (const char* name, const SomeClass_t& somec) : + m_somec (somec) { + strncpy (m_Name, name, sizeof (m_Name)); + } +private: + SomeClass_t m_somec; + char m_Name[255]; +}; + +int main (int argc, char* argv[]) { + DynamicOnly_t* ptr = DynamicOnly_t::create (); //* + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C new file mode 100644 index 000000000..e7065b269 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C @@ -0,0 +1,10 @@ +// { dg-do run } +// { dg-options "-O" } + +#include +#include + +int main() { + int *i1, *i2; + std::cerr << (typeid(i1)==typeid(i2)) << std::endl; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb116.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb116.C new file mode 100644 index 000000000..be5973a52 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb116.C @@ -0,0 +1,24 @@ +// { dg-do run } +template +class b +{ +private: + char a(int x) + { + union { + int i; + char c; + } val; + val.i = x; + return val.c; + } + +public: + b() { + } +}; + +int main() { + b n; + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb119.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb119.C new file mode 100644 index 000000000..329393aea --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb119.C @@ -0,0 +1,12 @@ +// { dg-do assemble } +template +void f() // { dg-message "note" } +{ +} + +int main() +{ + f(); // { dg-error "" } .* + // { dg-message "candidate" "candidate note" { target *-*-* } 9 } +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb12.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb12.C new file mode 100644 index 000000000..9b34944b7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb12.C @@ -0,0 +1,32 @@ +// { dg-do assemble } +// Error: Internal Compiler Error in 2.7.2. & egcs 1.0.0 + +#ifndef NO_META_MAX +template +struct meta_max { + enum { max = (N1 > N2) ? N1 : N2 }; +}; +#endif + +struct X { + enum { + a = 0, + n = 0 + }; +}; + +template +struct Y { + + enum { + a = T1::a + T2::a, + + // NB: if the next line is changed to + // n = (T1::n > T2::n) ? T1::n : T2::n + // the problem goes away. + + n = meta_max::max + }; +}; + +int z = Y::a; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb120.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb120.C new file mode 100644 index 000000000..b261802b9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb120.C @@ -0,0 +1,23 @@ +// { dg-do run } +template +double integrate(double a, double b, int numSamplePoints) +{ + // PRECONDITION(numSamplePoints > 1); + double delta = (b-a) / (numSamplePoints-1); + double sum = 0.; + for (int i=0; i < numSamplePoints; ++i) + sum += functionToIntegrate(a + i*delta); + return sum * (b-a) / numSamplePoints; +} + +inline double myFunction(double x) +{ + return 1 / (1 + x); +} + +// Example use +int main() { +double z = integrate(0.0, 1.0, 50); + return 0 ; +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C new file mode 100644 index 000000000..e01d74788 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C @@ -0,0 +1,21 @@ +// { dg-do assemble } +class A { +private: + int i1_; +public: + void f(int const i1 = 1); // { dg-error "previous specification" } +}; + +void +A::f(int const i1 = 1) // { dg-error "default argument given" } +{ + i1_ = i1; +} + +int +main() +{ + A a; + a.f(); + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb122.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb122.C new file mode 100644 index 000000000..f52017194 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb122.C @@ -0,0 +1,10 @@ +// { dg-do assemble } +// { dg-options "" } +// Disable -ansi -pedantic-errors because of GNU extension +template +class bar { +public: + void baz() { (({ while( foo::baz() );})); } +}; +template +void baz() { (({ while( foo::baz() );})); } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb123.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb123.C new file mode 100644 index 000000000..cb4505f7e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb123.C @@ -0,0 +1,10 @@ +// { dg-do assemble } +// { dg-options "-O2 -W " } +#include "stdio.h" + +void writeNote() throw( int ) +{ + printf( "hello world\n" ); + try { } + catch( int ){ throw; } +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb124.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb124.C new file mode 100644 index 000000000..0be035ae8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb124.C @@ -0,0 +1,5 @@ +// { dg-do assemble } +#include +class X : public std::runtime_error { + X (); +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C new file mode 100644 index 000000000..f2352c222 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C @@ -0,0 +1,22 @@ +// { dg-do assemble } + +struct test_box + { + void print(void); + }; + +void test (test_box *); // { dg-error "" } illegal code + +class test_square + { + friend void test (test_box *); // { dg-error "" } does not match + } // { dg-error "after class definition" } + + + +template void test(BOX *the_box) + {x // { dg-error "not declared in this scope" } + the_box->print(); // { dg-error "before" } + } + +template void test<> (test_box *); diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb126.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb126.C new file mode 100644 index 000000000..c6c66c387 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb126.C @@ -0,0 +1,30 @@ +// { dg-do run } +#include + +class SomeClass_t { +public: + SomeClass_t () : x (11) {} +protected: + float x; +}; + +class DynamicOnly_t { +public: + static DynamicOnly_t* create (const char* name = "UNDEF", + const SomeClass_t& somec = *(new SomeClass_t +())) { + return new DynamicOnly_t (name, somec); + } + DynamicOnly_t (const char* name, const SomeClass_t& somec) : + m_somec (somec) { + strncpy (m_Name, name, sizeof (m_Name)); + } +private: + SomeClass_t m_somec; + char m_Name[255]; +}; + +int main (int argc, char* argv[]) { + DynamicOnly_t* ptr = DynamicOnly_t::create (); + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb127.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb127.C new file mode 100644 index 000000000..d8d28b36a --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb127.C @@ -0,0 +1,61 @@ +// { dg-do assemble } +// Gets ICE 40. + +#include +#include +#include + +using namespace std; + +class ODEsolver +{ + private: + void eulerODE(vector& y, double& t, double& dt); + void midpointODE(vector& y, double& t, double& dt); + + protected: + void (ODEsolver::*useMethod)(vector&, double&, double&); + void init(); + + public: + ODEsolver(); + void timeloop(vector& y, double ts, double te, double dt); +}; + + +ODEsolver::ODEsolver() +{ + init(); +} + + +void ODEsolver::eulerODE(vector& y, double& t, double& dt) +{ + y[0] = dt * 2.; +} + +void ODEsolver::midpointODE(vector& y, double& t, double& dt) +{ + y[0] = dt * 3.; +} + + + +void ODEsolver::init() +{ + ODEsolver::useMethod = &ODEsolver::midpointODE; +} + +void ODEsolver::timeloop(vector& y, double ts, double te, double dt) +{ + (ODEsolver::useMethod)(y,ts,dt); // { dg-error "" } should use this->* +} + +int main (int nargs, char** args) +{ + ODEsolver solver; + vector y(2); double t_start=5.; double t_end=7.; double dt=2.; + solver.timeloop(y,t_start,t_end,dt); + cout << y[0] << endl; + return(0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb128.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb128.C new file mode 100644 index 000000000..d3d48e18a --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb128.C @@ -0,0 +1,12 @@ +// { dg-do assemble } +template +struct A { + typedef T* iterator; // { dg-error "" } pointer to reference +public: + A(){} +}; + +void f() +{ + A a; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb129.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb129.C new file mode 100644 index 000000000..83fb86bb9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb129.C @@ -0,0 +1,23 @@ +// { dg-do assemble } +// Gives ICE on EGCS release branch as of 98/06/08 on i686-pc-linux-gnulibc1) +// From: Klaus-Georg Adams +// Message-Id: <199806081358.PAA02505@achibm5.chemie.uni-karlsruhe.de> +#include +#include +#include +#include +using namespace std; +int main() +{ + list l; + l.push_back(1); + l.push_back(2); + + list::iterator it = + find_if( l.begin(), l.end(), + // This is a typo, it should be bind2nd, but an + // ICE is not a very helpful diagnostic! + binder2nd( equal_to(), 2 ) ); // { dg-error "" } + assert( *(it) == 2 ); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb129a.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb129a.C new file mode 100644 index 000000000..bba5ff067 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb129a.C @@ -0,0 +1,22 @@ +// { dg-do assemble } +// Gives ICE on EGCS release branch as of 98/06/08 on i686-pc-linux-gnulibc1) +// From: Klaus-Georg Adams +// Message-Id: <199806081358.PAA02505@achibm5.chemie.uni-karlsruhe.de> +#include +#include +#include +#include +int main() +{ + std::list l; + l.push_back(1); + l.push_back(2); + + std::list::iterator it = + std::find_if( l.begin(), l.end(), + // This is a typo, it should be bind2nd, but an + // ICE is not a very helpful diagnostic! + std::binder2nd( std::equal_to(), 2 ) ); // { dg-error "" } + assert( *(it) == 2 ); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb13.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb13.C new file mode 100644 index 000000000..40c454aae --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb13.C @@ -0,0 +1,16 @@ +// { dg-do assemble } +template +class Array { +public: + typedef T T_numtype; +}; + +template +void f(T_array, typename T_array::T_numtype) +{ +} + +void g() +{ + f(Array(), float()); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C new file mode 100644 index 000000000..20175cd9d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C @@ -0,0 +1,11 @@ +// { dg-do assemble } +// { dg-options "-Wall -Wno-deprecated" } +// Gives spurious warnings when compiled with -Wall +// EGCS 06/08/98 i686-pc-linux-gnulibc1 +// Message-Id: <199806081358.PAA02505@achibm5.chemie.uni-karlsruhe.de> +// From: Klaus-Georg Adams + + +#include +__gnu_cxx::hash_set foo; + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C new file mode 100644 index 000000000..67445308c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C @@ -0,0 +1,22 @@ +// { dg-do assemble } +// From: Klaus-Georg Adams +// Reported against EGCS snaps 98/06/18. + +struct a { + a(); + void junk( float ); + void junk( double ); + + void bar( double ); + void bar( float ); + + void foo( void (a::*member)(float) ); // { dg-message "void a::foo|no known conversion" } +}; + +a::a() +{ + foo( &junk ); // { dg-error "match" } junk is an unqualified-id. + // { dg-message "candidate" "candidate note" { target *-*-* } 18 } + foo( &bar ); // { dg-error "match" } bar is an unqualified-id. + // { dg-message "candidate" "candidate note" { target *-*-* } 20 } +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C new file mode 100644 index 000000000..e5992aa66 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C @@ -0,0 +1,28 @@ +// { dg-do assemble } +// { dg-options "-O -Wall -fgcse" } +// From: Klaus-Georg Adams +// Reported against EGCS snaps 98/06/28. +// +// Compilation of this program with the flags g++ -Wall -O -fgcse +// or -O2 produces spurious warnings in the standard +// header . +// +// They vanish if the declaration of a::b is taken out. + +#include + +std::string foo(); +struct a { + void bar(); + enum b { c, d }; + b theb; + std::string baz; +}; + +void +a::bar() +{ + baz += foo() + foo(); + baz += foo() + foo() + "foo"; +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C new file mode 100644 index 000000000..eb6c72d20 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C @@ -0,0 +1,16 @@ +// { dg-do assemble } +// Gives ICE 109 +// From: Klaus-Georg Adams +// Reported against EGCS snaps 98/06/28. + +int main() +{ + try { + } + catch (std::bad_alloc) { // { dg-error "" } parse error + return 1; + } + return 0; +} + + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C new file mode 100644 index 000000000..544544b71 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C @@ -0,0 +1,16 @@ +// { dg-do assemble } +// Gives ICE 109 +// From: Klaus-Georg Adams +// Reported against EGCS snaps 98/06/28. + +using namespace std; // { dg-error "" "" { xfail *-*-* } } + +int main() +{ + try { + } + catch (bad_alloc) { // { dg-error "" } + return 1; + } + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb133c.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb133c.C new file mode 100644 index 000000000..86acdc6bf --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb133c.C @@ -0,0 +1,17 @@ +// { dg-do assemble } +// Gives ICE 109 +// From: Klaus-Georg Adams +// Reported against EGCS snaps 98/06/28. + +namespace std { } +using namespace std; + +int main() +{ + try { + } + catch (bad_alloc) { // { dg-error "" } + return 1; + } + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb14.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb14.C new file mode 100644 index 000000000..0218a7eaa --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb14.C @@ -0,0 +1,40 @@ +// { dg-do run } + +extern "C" void abort (); + +template +struct I { +}; + +template +struct A { + + int r; + + template + void operator()(T1, T2) + { r = 0; } + + template + void operator()(I, I) + { r = 1; } +}; + +int main() +{ + A x; + I<0> a; + I<1> b; + + x(a,b); + if (x.r != 1) + abort(); + + x(float(), double()); + if (x.r != 0) + abort(); + + return 0; +} + + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C new file mode 100644 index 000000000..1cb9fd15c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C @@ -0,0 +1,28 @@ +// { dg-do assemble } +#include +#include + +struct A { + A() { + std::cerr<<"A constructing\n"; + throw 1; + } + void *operator new(size_t sz) { + std::cerr<<"A allocated\n"; + return ::operator new(sz); + } + void operator delete (void *p) { + std::cerr<<"A deleted\n"; + ::operator delete (p); + } +}; + +int main() { + try { + new A(); + } catch (...) { + } +} + + + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb16.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb16.C new file mode 100644 index 000000000..533b13449 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb16.C @@ -0,0 +1,14 @@ +// { dg-do assemble } +template +struct A { + typedef T T1; +}; + +template +struct B : T::T1 { // insert `typename' before T::T1 +}; + +struct C { }; + +B > z; + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C new file mode 100644 index 000000000..4163399fb --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C @@ -0,0 +1,59 @@ +// { dg-do run } +#include + +class A { +public: + virtual void print(); + virtual A * clone(); +}; + +struct Pad { + virtual void f () {} +}; + +class B : public Pad, virtual public A { +public: + void print(); + B * clone(); +}; + +void A::print() +{ + printf("A\n"); +} + +void B::print() +{ + printf("B\n"); +} + + +A * A::clone() +{ + return this; +} + +B * B::clone() +{ + return this; +} + + +int main() +{ + A * a = new B; + B * b = dynamic_cast(a); + + printf("%p\n",b); // (*2*) + b->print(); + + a = b; + printf("%p\n",a); + a->print(); + + a = a->clone(); + printf("%p\n",a); + a->print(); // (*1*) + + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb18.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb18.C new file mode 100644 index 000000000..8f0a82937 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb18.C @@ -0,0 +1,8 @@ +// { dg-do assemble } +class C { }; + +void foo() +{ + C c; + void * v = static_cast(c); // { dg-error "" } illegal cast +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb19.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb19.C new file mode 100644 index 000000000..60f4aa1d6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb19.C @@ -0,0 +1,16 @@ +// { dg-do assemble } + +#define CRASH 1 +#ifdef CRASH +#define VIRTUAL virtual +#else +#define VIRTUAL +#endif + +class A {}; +class B : public VIRTUAL A {}; +template class C : public /*virtual*/ Imp {}; +// define CRASH and uncomment here ^^^^^^^^^^^ +// and the crash goes away!!!! + +template class C; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb2.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb2.C new file mode 100644 index 000000000..e40afbec2 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb2.C @@ -0,0 +1,17 @@ +// { dg-do assemble } +typedef __SIZE_TYPE__ size_t; +inline void *operator new(size_t, void *place) throw() { return place; } + +struct A +{ + A(); + ~A(); +}; + +void testfunc( void ) +{ + A* mybuf; + A v[1]; + + new (mybuf) A(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb20.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb20.C new file mode 100644 index 000000000..c15d4afcb --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb20.C @@ -0,0 +1,33 @@ +// { dg-do assemble } +// Error: ICE on 2.7.2.3 and EGCS 1.0.0. + +template +struct meta_max { + enum { max = (N1 > N2) ? N1 : N2 }; +}; + +struct X { + enum { + a = 0, + n = 0 + }; +}; + +template +struct Y { + + enum { + a = T1::a + T2::a + T3::a, + n = meta_max::max, T3::n>::max + }; +}; + +template +struct Z { + enum { + a = T::a, + n = T::n + }; +}; + +Z > z; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C new file mode 100644 index 000000000..a061fc016 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C @@ -0,0 +1,25 @@ +// { dg-do run } +#include + +#include + +using namespace std; + +/*----------------------------------------*/ + +struct connection_t { + connection_t() {} +}; + +std::vector connections; + +/*----------------------------------------*/ + +int +main() { + ostringstream str; + + connections.insert(connections.end(), connection_t()); + + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C new file mode 100644 index 000000000..a78ea4108 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C @@ -0,0 +1,29 @@ +// { dg-do assemble } +// Ambiguous conversion, three candidates: +// builtin == (int, int), and the two user-defined operators +// Each one requires a user-defined ICS where another uses builtin conversions, +// so none is the best viable function. + +class MyInt +{ +public: + MyInt(int = 0) {} + operator int() const {return 2;} +}; + +bool operator==(const MyInt& a, const int& b) // { dg-message "operator==" } candidate +{ + return (int)a == b; +} + +bool operator==(const MyInt& a, const MyInt& b) // { dg-message "operator==" } candidate +{ + return (int)a == (int)b; +} + +bool f() +{ + return 3 == MyInt(); // { dg-error "ambiguous" "err" } + // { dg-message "operator==" "match candidate text" { target *-*-* } 26 } + // { dg-message "candidates" "note" { target *-*-* } 26 } +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb23.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb23.C new file mode 100644 index 000000000..920f4587b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb23.C @@ -0,0 +1,20 @@ +// { dg-do assemble } +class foo { +protected: + void __duplicate (); + +}; + +class bar : public virtual foo { +protected: + void __duplicate() { + foo::__duplicate (); + } +}; + +class oops : public virtual bar { +protected: + void __duplicate() { + foo::__duplicate (); + } +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C new file mode 100644 index 000000000..5e2a3ee45 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C @@ -0,0 +1,23 @@ +// { dg-do assemble } +#include + +template < class T > +class X +{ + protected: + + union { + int x; + double y; + }; +}; + +template < class T > +class Y : public X +{ + public: + + using X::x; + + void f () { std::cout << this->x << std::endl; } +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb26.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb26.C new file mode 100644 index 000000000..b43f21a7f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb26.C @@ -0,0 +1,31 @@ +// { dg-do run } +// +// egcs-2.90.06 +// cannot declare friend of enclosing class using its scope, works fine +// without scope or for definition of foo::bar::f +// + +class foo +{ +public: + static int f(); + class bar { + friend int foo::f(); +// friend int f(); + static int x; + public: + static int f() {return foo::f();} + }; +}; + +int foo::bar::x; + +int foo::f() { + return bar::x; +} + +int +main () +{ + return foo::bar::f (); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C new file mode 100644 index 000000000..204a143d6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C @@ -0,0 +1,42 @@ +// { dg-do assemble } +// { dg-options "-Wno-deprecated" } +/* bug.cc */ +/* simple program to demonstrate the bug with named return values in gcc +*/ +/* (w) 4.9.97 by Kurt Garloff */ +// 8/28/1998 - This dies in add_conversions from dfs_walk, null CLASSTYPE_METHOD_VEC +// for the test record_type. This is marked as an expected failure for now, +// until we actually fix it. + +#include + +template class test; +template test operator + (const test& a, const test& b); + +// A simple numerical class +template +class test +{ + T elem; + public: + test () { elem = 0; }; + test (const T& a) { elem = a; }; + test& operator += (const test& a) { elem += a.elem; return *this; }; + friend test operator + <> (const test&, const test&); + friend std::ostream& operator << (std::ostream& os, const test& a) + { return os << a.elem; }; +}; + +// named return value version +template +test operator + (const test& a, const test& b) return c(a);// { dg-error "" } named return value +{ c += b; } // { dg-error "" } c undeclared + +int main() +{ + test x, y; + x += 5; + std::cout << x << std::endl; + y = x + test(2); + std::cout << y << std::endl; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb28.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb28.C new file mode 100644 index 000000000..89f19d57c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb28.C @@ -0,0 +1,20 @@ +// { dg-do assemble } +#include + +using namespace std; + +enum s { S }; +class a +{ + vector vs; + friend class b; +}; +struct b +{ + vector va; + operator vector< vector >() + { + vector< vector > vvs(va.size()); + return vvs; + } +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb29.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb29.C new file mode 100644 index 000000000..bea0d12e1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb29.C @@ -0,0 +1,19 @@ +// { dg-do assemble } +#include + +using namespace std; + +enum s { S }; +class a +{ + vector vs; + friend class b; +}; +struct b +{ + vector va; + operator vector< vector >() + { + return vector< vector >(va.size()); + } +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C new file mode 100644 index 000000000..b7487e97b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C @@ -0,0 +1,11 @@ +// { dg-do assemble } +#include +template +class Vec { +public: + Vec() { data = new T; } + Vec split() { Vec tmp; operator=(tmp); return tmp; } + void operator=(const Vec &v) { data = new T; } + T *data; +}; +template class Vec >; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C new file mode 100644 index 000000000..e0f290b7f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C @@ -0,0 +1,16 @@ +// { dg-do assemble } +#include + +class bifstream : public std::ifstream { +public: + bifstream(); +// ~bifstream(); +}; + +void load_bin() +{ + bifstream InFile; + + if (!InFile) + return; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C new file mode 100644 index 000000000..1e3c8f02d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C @@ -0,0 +1,20 @@ +// { dg-do run } +#include + +int main() { + try { + throw 1; + } catch(...) { + try { + throw; + } catch(int) { + } + try { + throw; + } catch(int) { + } + } + return 0; +} + + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb32.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb32.C new file mode 100644 index 000000000..a70c8f970 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb32.C @@ -0,0 +1,12 @@ +// { dg-do assemble } +class A { +public: + void malloc(unsigned int); +}; + +void A::malloc(unsigned int) {} + +void foo() { + A a; + a.malloc(3); // <-- line 10 +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C new file mode 100644 index 000000000..50328ad49 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C @@ -0,0 +1,12 @@ +// { dg-do run } +#include +#include + +int +main() +{ + std::printf("If you see this, you don't have a problem!\n"); +#ifdef EXPOSE_BUG + std::ifstream a; +#endif +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb34.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb34.C new file mode 100644 index 000000000..0d9b474d9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb34.C @@ -0,0 +1,19 @@ +// { dg-do assemble } +class Base { +public: + class Bar { public: virtual ~Bar() {} }; +}; + +class Derived : public Base { +public: + class Bar : public Base::Bar {}; +}; + +template +class XYZ : public T::Bar { +}; + +void test() { + XYZ b; + XYZ d; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb35.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb35.C new file mode 100644 index 000000000..6546d7c42 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb35.C @@ -0,0 +1,38 @@ +// { dg-do assemble } + +class string +{ +public: + string(); + string(const string& x); + string(const char* t); + + ~string(); +}; + +void set_status(string message); + +class StatusDelay { +private: + string cause; + +public: + StatusDelay(const string& c) + : cause(c) + { + set_status(cause); + } + + ~StatusDelay() + { + set_status(cause); + } +}; + +static char delay_message[] = "Filtering files"; + +static void searchRemote() +{ + StatusDelay delay(delay_message); + return; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb36.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb36.C new file mode 100644 index 000000000..56e67b300 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb36.C @@ -0,0 +1,19 @@ +// { dg-do assemble } +#include +using namespace std; + +template class foo { +public: + foo(); + foo(vector v); +private: + vector v; + T t; +}; + +template +foo::foo() :v(), t() {} +template +foo::foo(vector v_) :v(v_), t() {} // { dg-error "" } default arg for member template + +foo a; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb37.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb37.C new file mode 100644 index 000000000..185b632f8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb37.C @@ -0,0 +1,26 @@ +// { dg-do assemble } +template +struct A { + typedef T T1; +}; + +template +struct B { + typedef T T2; +}; + +template +struct C { +}; + +template +C +foo (E) +{ + return C(); +} + +void test() +{ + foo(B >()); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb38.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb38.C new file mode 100644 index 000000000..e4bcf32b6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb38.C @@ -0,0 +1,37 @@ +// { dg-do assemble } +class string +{ +public: + string(); + string(const string& x); + string(const char* t); + + ~string(); +}; + +void set_status(string message); + +class StatusDelay { +private: + string cause; + +public: + StatusDelay(const string& c) + : cause(c) + { + set_status(cause); + } + + ~StatusDelay() + { + set_status(cause); + } +}; + +static char delay_message[] = "Filtering files"; + +static void searchRemote() +{ + StatusDelay delay(delay_message); + return; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C new file mode 100644 index 000000000..144d3fff7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C @@ -0,0 +1,18 @@ +// { dg-do assemble } +#include +#include +#include +#include + +using namespace std; + +extern bool foo2 (ostream &out, istream &in); + +bool +foo1 (ostream &out, const char *in) +{ + string tmp(in, std::strlen(in)); + stringbuf sb (tmp); + istream fmt (&sb); + return foo2 (out, fmt); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C new file mode 100644 index 000000000..dfd3d6ced --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C @@ -0,0 +1,50 @@ +// { dg-do assemble } +// Error: Internal Compiler Error in GCC 2.7.2 and EGCS 1998/05/28 snapshot. + +#include + +class some_base + { +public: + class base_func_args; + virtual void func(base_func_args &) = 0; // { dg-message "note" } referenced below + }; + +class some_base::base_func_args + { +public: + int i; + }; + +class some_derived : public some_base // { dg-message "note" } + { +public: + class derived_func_args; + void func(derived_func_args &); + }; + + +class derived_func_args : public some_base::base_func_args + { +public: + float f; + }; + +class some_derived::func(derived_func_args &a) // { dg-error "does not name a type" "type" } illegal member syntax +// { dg-error "expected" "exp" { target *-*-* } 33 } + { + std::cout << a.i << ' ' << a.f << std::endl; + } + +int +main() + { + some_derived d; // { dg-error "abstract type" } + some_derived::derived_func_args dfa; // { dg-error "incomplete type" } + some_base *b = &d; + + dfa.i = 10; + dfa.f = 20; + b->func(dfs); // { dg-error "'dfs' was not declared" } + return 0; + } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C new file mode 100644 index 000000000..9f6ee5f43 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C @@ -0,0 +1,14 @@ +// { dg-do run } +#include +#include +#include + +std::ostream_iterator oo(std::cout); + +int main() +{ + *oo = "Hello, "; + ++oo; + *oo = "world!\n"; +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb43.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb43.C new file mode 100644 index 000000000..1dc43284c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb43.C @@ -0,0 +1,44 @@ +// { dg-do assemble } +// All the pointer_to_binary_function cases used to fail because g++ +// couldn't handle converting an overloaded function to a class type. +// The first one should still fail because it requires an implicit conversion +// to pointer_to_binary_function, which has an `explicit' constructor. + +// { dg-prune-output "note" } + +#include +#include +#include + +using namespace std; + +template class Expr +{ +public : + Expr(){} + Expr(const T&){} +}; + +template +inline bool compare(const Expr a, const Expr b){ return true; } + +int main() +{ + vector a(3); + sort( a.begin(), a.end(), + static_cast,const Expr)>(compare) ); + sort( a.begin(), a.end(), compare ); + sort::iterator, + pointer_to_binary_function, const Expr, bool> > + ( a.begin(), a.end(), compare ); // { dg-error "" } constructor is explicit + sort( a.begin(), a.end(), + ptr_fun, const Expr, bool> (compare) ); + sort( a.begin(), a.end(), + ptr_fun(compare) ); + sort( a.begin(), a.end(), + pointer_to_binary_function, const Expr, bool>(compare) ); + sort( a.begin(), a.end(), + pointer_to_binary_function, const Expr, bool>(compare) ); + sort( a.begin(), a.end(), + pointer_to_binary_function, const Expr, bool>(compare<>) ); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C new file mode 100644 index 000000000..a7e61804c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C @@ -0,0 +1,39 @@ +// { dg-do assemble } +// spurious 'const' in error. +// For egcs-2.91.34, the warning message refers to +// class ostream & operator <<(class ostream &, const class Vector &) +// Also, the template instantiation does not provide the missing +// friend function, the non-template function does + +#include +#include +#include + +using namespace std; + +template +class Vector +{ + friend ostream& operator<< (ostream& out, const Vector & vec); // { dg-warning "non-template" "warn" } + // { dg-message "note" "note" { target *-*-* } 17 } +}; + +template +ostream& operator<< (ostream& out, const Vector & vec) +{ + abort(); // this should not be called +} + +template class Vector; +template ostream& operator<< (ostream& out, const Vector &); + +ostream& operator<< (ostream& out, const Vector&) +{ + return out; +} + +int main() +{ + Vector vc; + cout << vc; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb45.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb45.C new file mode 100644 index 000000000..d6c0a40f6 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb45.C @@ -0,0 +1,6 @@ +// { dg-do assemble } +class A {}; +class B : public virtual A {}; +template class C : public Imp {}; + +template class C; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C new file mode 100644 index 000000000..cbe482e90 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C @@ -0,0 +1,31 @@ +// { dg-do run } +#include + +class A1 { + friend class B; + public: + virtual void foo() {} +}; + +class A2 : public virtual A1 {friend class B;}; + +class A3 : public virtual A1, private A2 {friend class B;}; + +class B +{ + public: + B(A1* a) : itsA(dynamic_cast(a)) {} + A2* itsA; +}; + +int main() +{ + A1* a=new A3; + B b(a); + + if (b.itsA) + std::cout << "cast ok" << std::endl; + else + std::cout << "cast failed" << std::endl; + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb48.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb48.C new file mode 100644 index 000000000..3b98a3504 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb48.C @@ -0,0 +1,10 @@ +// { dg-do assemble } +char *t1 (const char *s) +{ + return const_cast(s); +} + +char *&t1 (const char *&s) +{ + return const_cast(s); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb49.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb49.C new file mode 100644 index 000000000..c1d70a035 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb49.C @@ -0,0 +1,48 @@ +// { dg-do assemble } + +// Here we declare ::S +typedef struct s1 *S; + +struct s1 +{ + int s; +}; + +struct A +{ + // Here we declare A::S + typedef struct s1 *S; +}; + +template class XX; + +template +class X +{ +public: + static T *do_something (); + friend class T; // { dg-error "" } `T' is a template parameter + friend class XX; +}; + +struct N +{ + // Here we declare N::S + class S + { + }; + + // Should use N::S and A::S. + typedef X X_S; + + void bug (); +}; + +void +N::bug () +{ + // X_S is template class X + // `s' is N::S. + S *s = X_S::do_something (); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb5.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb5.C new file mode 100644 index 000000000..06e31b611 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb5.C @@ -0,0 +1,13 @@ +// { dg-do assemble } +enum { a, b }; + +class Bug { + int pri:8; + int flags:15; +public: + void bug() { + flags |= a; // this does not work + } +}; + +void dummy(Bug x) { x.bug(); } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb50.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb50.C new file mode 100644 index 000000000..8d2c4033f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb50.C @@ -0,0 +1,17 @@ +// { dg-do run } +struct foo { }; +int f(int a, int b) +{ + if (b == 0) + throw foo(); + return a / b; +} +int main() +{ + try { + f(0, 0); + return 1; + } catch (foo x) { + return 0; + } +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb51.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb51.C new file mode 100644 index 000000000..3f421b019 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb51.C @@ -0,0 +1,36 @@ +// { dg-do assemble } +typedef unsigned long Xv_opaque; + +class DynaString +{ +public: + DynaString(); + DynaString( const DynaString& dynaStr ); + DynaString( const long n ); + ~DynaString(); + + int operator ==( const char* const string ) const; +}; + +class DDE_Defaults +{ +public: + DynaString GetHost(); + DynaString GetService(); + DynaString GetDatabase(); +}; + +extern DDE_Defaults* ddeDefaults; + +void +f() +{ + DynaString tempHost, tempService, tempDatabase; + if( (tempHost = ddeDefaults->GetHost()) == 0 + || (tempService = ddeDefaults->GetService()) == 0 + || (tempDatabase = ddeDefaults->GetDatabase()) == 0 + ) + { + } +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb52.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb52.C new file mode 100644 index 000000000..4607c1c23 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb52.C @@ -0,0 +1,37 @@ +// { dg-do assemble } +class base { +protected: + virtual void f(); +}; + +class d1 : public virtual base { +protected: + void f(); +}; + +void d1::f() +{ + base::f(); +} + +class dd1 : public virtual d1 { +protected: + void f(); +}; + +void dd1::f() +{ + d1::f(); + base::f(); +} + +class d1_and_base : public virtual d1, public virtual base { +protected: + void f(); +}; + +void d1_and_base::f() +{ + d1::f(); + base::f(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C new file mode 100644 index 000000000..1e71ca82e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C @@ -0,0 +1,10 @@ +// { dg-do run } +#include +#include +#include + +int main() +{ + std::cout << std::setbase(3) << std::endl; + std::exit (0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C new file mode 100644 index 000000000..c1e2400ed --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Since the constructor is in streambuf.h, additional diagnostics are +// produced, which are not really supported in the old-deja framework + +#include + +void +t( char* buf ) +{ + std::istrstream str = buf; //{ dg-error "" } inaccessible copy constructor +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb56.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb56.C new file mode 100644 index 000000000..90932de46 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb56.C @@ -0,0 +1,10 @@ +// { dg-do assemble } +// Error: Internal compiler error on 1998/05/28 snapshot. + +class foo { + public: + typedef int sometype; +}; + +struct die : public foo::sometype { // { dg-error "" } invalid base type +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb57.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb57.C new file mode 100644 index 000000000..b7879fa7f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb57.C @@ -0,0 +1,7 @@ +// { dg-do assemble } +#include +//using namespace std; +class A { + class B : public std::exception {} + ; +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb58.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb58.C new file mode 100644 index 000000000..04ec92a30 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb58.C @@ -0,0 +1,15 @@ +// { dg-do run } +// { dg-options "-w -fpermissive" } +// Test for g++ array init extension + +class A { +public: + A(int i) {} +private: + A( const A & ) {} +}; + +main() +{ + A *list = new A[10](4); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb59.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb59.C new file mode 100644 index 000000000..84ccff26d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb59.C @@ -0,0 +1,31 @@ +// { dg-do run } +#define INC_FUNCTIONAL 1 +#define USE_STATIC_CAST 1 + +#include +#include +#ifdef INC_FUNCTIONAL +#include +#endif + +using namespace std; + +template int p( int val, R& r ) +{ + return val + r; +} + +template void f( vector& v ) +{ +#ifdef USE_STATIC_CAST + accumulate( v.begin(), v.end(), 0, static_cast(p) ); +#else + accumulate( v.begin(), v.end(), 0, p ); +#endif +} + +int main() +{ + vector r; + f( r ); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb6.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb6.C new file mode 100644 index 000000000..6fddb8557 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb6.C @@ -0,0 +1,14 @@ +// { dg-do assemble } +class A { +public: + A() { t=0; } + double t; +}; +template +class B { +public: + void f1() { new T; f2(); } + void f2() { new T; } +}; +template class B; + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb60.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb60.C new file mode 100644 index 000000000..ea80a4ce2 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb60.C @@ -0,0 +1,18 @@ +// { dg-do assemble } +#include + +class t { +public: + t(const std::string& s) : s_(s) {} + std::string s_; + static t* t_; +}; + +t* t::t_; + +t* makeT() +{ + return new t("test"); + return t::t_ ? t::t_ : + t::t_ = new t("test"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb61.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb61.C new file mode 100644 index 000000000..68344a6bf --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb61.C @@ -0,0 +1,8 @@ +// { dg-do assemble } +void +action0(float& arg1) +{ + long cn0 = 1; + + arg1 = cn0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb62.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb62.C new file mode 100644 index 000000000..bffba0480 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb62.C @@ -0,0 +1,7 @@ +// { dg-do assemble } +#include + +void f(void) +{ + std::vector l(5, 0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C new file mode 100644 index 000000000..a49fb0264 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C @@ -0,0 +1,17 @@ +// { dg-do run } +// { dg-options "-w -fpermissive" } +//This uses GNU extensions, so disable -ansi +#include +#include + +class A { +public: + A(bool b) { abort(); } + A(int a, bool b) { printf("cool\n"); } +}; + +main() { + A* a; + + a = new A[2](1,false); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb64.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb64.C new file mode 100644 index 000000000..16f52e0de --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb64.C @@ -0,0 +1,25 @@ +// { dg-do assemble } +template +class B:public A { + B(){} +}; + +template +class C:public B { + C(){} +}; + +/* +g++ bugsol.C +bugsol.C:9: Internal compiler error. +bugsol.C:9: Please submit a full bug report to `egcs-bugs@cygnus.com'. + +g++ -v +Reading specs from +/home/pierre/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.16/specs +gcc version egcs-2.90.16 971105 (gcc2-970802 experimental) + +egcc compiled with gcc version 2.7.2.1 on debian 1.3.1 + +*/ + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb65.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb65.C new file mode 100644 index 000000000..b7b535d5a --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb65.C @@ -0,0 +1,25 @@ +// { dg-do run } +#include + +using namespace std; + +template struct PartialDotProduct { + template + static T Expand(T* a, T* b) { return T(); } +}; + +const int N = 10; + +template +typename iterator_traits::value_type +dot(In1 f1, In2 f2) +{ + return PartialDotProduct::Expand(f1, f2); // line 14 +} + +int main() +{ + double a[N], b[N]; + + double s = dot(&a[0], &b[0]); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C new file mode 100644 index 000000000..308859365 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C @@ -0,0 +1,27 @@ +// { dg-do run } +#include +#include + +int bar () +{ + throw 100; +} + +int main () +{ + int i = 0; + try + { + i = bar (); + } + catch (...) + { + } + +// std::cout << "i = " << i << std::endl; + assert (i == 0) ; +} + + + + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb67.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb67.C new file mode 100644 index 000000000..bebe99598 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb67.C @@ -0,0 +1,6 @@ +// { dg-do assemble } +/* +Check whether a typedef for a basic type as a baseclass is diagnosed. +*/ +typedef int an_int; +class bar : public an_int {}; // { dg-error "" } not an aggregate diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C new file mode 100644 index 000000000..1ada91234 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C @@ -0,0 +1,23 @@ +// { dg-do assemble } +// Test that g++ complains about referring to a builtin type in a +// mem-initializer. +// Contributed by Kevin Buhr + +int r = 0; + +struct foo { // { dg-message "note" } candidate + foo(int x) { r = 1; } // { dg-message "note" } +}; + +struct bar : foo { + typedef int an_int; + bar() : bar::an_int(3) {} // { dg-error "match" "match" } not a base + // { dg-message "candidate" "candidate note" { target *-*-* } 14 } + // { dg-message "expected" "exp" { target *-*-* } 14 } +}; + +int +main() { + bar b; + return r; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb7.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb7.C new file mode 100644 index 000000000..4785305ff --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb7.C @@ -0,0 +1,16 @@ +// { dg-do assemble } +#include + +class T +{ + public: + T(); + +}; + +std::vector tp; + +void f() +{ + tp.insert(tp.begin(), 10 , T()); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb70.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb70.C new file mode 100644 index 000000000..b17dc10dc --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb70.C @@ -0,0 +1,17 @@ +// { dg-do assemble } +// conversion ops should be treated as coming from the most derived class +// for overload resolution. See [over.match.funcs]. + +class X { +public: + operator bool() const; +}; + +class Y : public X { +private: + operator void*() const; +}; + +int f(Y const& y) { + return bool(y); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb71.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb71.C new file mode 100644 index 000000000..b1288e238 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb71.C @@ -0,0 +1,37 @@ +// { dg-do assemble } +typedef __SIZE_TYPE__ size_t; + +class A { + +public: + void operator delete(void*, size_t); + void* operator new(size_t); +}; + +class B : public A { +friend class D; + + B(); + unsigned counter; +}; + +class D { + + int ins( B*&); +}; + +int +D::ins( B*& tempN) +{ + unsigned i; + + if (i == 10) { + } + else { + } + + tempN = new B(); + tempN->counter = 20; + + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C new file mode 100644 index 000000000..bf9cf598d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C @@ -0,0 +1,15 @@ +// { dg-do run } +// { dg-options "-O -Wall" } +// Depletes VM. + +#include +#include +#include +using namespace std; + +int main() +{ + int daten [16] = { 1, 4, 4, 6, 1, 2, 2, 3, 6, 6, 6, 5, 7, 5, 4, 4}; + list menge; + copy (daten, daten+16, back_inserter(menge)); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb74.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb74.C new file mode 100644 index 000000000..5fb821119 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb74.C @@ -0,0 +1,33 @@ +// { dg-do assemble } +class base { +public: + virtual ~base(); +}; + + +class foo : public base { + +public : + + foo (char *cs); + + virtual void op (unsigned char dummy = false); + unsigned char m_dummy; +}; + + +void foo :: op ( unsigned char dummy) + +{ + bool bar; + + if (dummy) { + foo IT_tempPhase( 0 ); + return; + } + + if ((m_dummy || bar)) { + + } + +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb75.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb75.C new file mode 100644 index 000000000..c032c2a78 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb75.C @@ -0,0 +1,19 @@ +// { dg-do assemble } +int*& foo (int const *& x) +{ + return const_cast (x); +} + +/* +If the references in this example are changed to pointers (change +all `&''s to `*'), no warnings result. + +I think this is incorrect according to CD2 5.2.11, para 4: + +4 An lvalue of type T1 can be explicitly converted to an lvalue of type + T2 using the cast const_cast (where T1 and T2 are object types) + if a pointer to T1 can be explicitly converted to the type pointer to + T2 using a const_cast. The result of a reference const_cast refers to + the original object. + +*/ diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C new file mode 100644 index 000000000..c74e7bd81 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C @@ -0,0 +1,18 @@ +// { dg-do assemble } +// the template operator!= interferes. It should be in a namespace. + +#include + +enum T { + V1 +}; + +struct X { + T t : 31; +}; + +void +f(X& v) { + if( v.t != V1 ) { // complains about taking address of bitfield + } +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C new file mode 100644 index 000000000..358c186ab --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C @@ -0,0 +1,33 @@ +// { dg-do run } +#include +#include + +using namespace std; + +int +main(int, char* []) +{ + stringstream s; + + s << "line 1\nline 2\n\nline 4"; + s << std::ends; + + int nLine = 0; + + while( true ) { + char line[100]; + s.get(line, 100); + + if( ! line ) { + break; + } + + ++nLine; + std::cout << nLine << ": " << line << std::endl; + + if( nLine > 10 ) { // stop infinite loop + break; + } + } + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C new file mode 100644 index 000000000..1c1ad3e30 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C @@ -0,0 +1,33 @@ +// { dg-do assemble } +// { dg-prune-output "note" } +// Makes bogus x86 assembly code. +#include + +// The VxWorks kernel-mode headers define a macro named "max", which is not +// ISO-compliant, but is part of the VxWorks API. +#if defined __vxworks && !defined __RTP__ +#undef max +#endif + +using namespace std; + +template +T max(T a, T b) +{ + return (a > b) ? a : b; +} + +// Prototypes (enable one or the other) +double max<>(double, double); // { dg-error "" } bogus code +// int max(int, int); + +int main() +{ + int i = 123; + double d = 1234.5678; + + cout.precision(12); + cout << max(d, i) << endl; // { dg-error "" } + cout << max(i, d) << endl; // { dg-error "" } + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb8.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb8.C new file mode 100644 index 000000000..c66005062 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb8.C @@ -0,0 +1,14 @@ +// { dg-do assemble } + +class foo { +public: + operator <<(const void *); //{ dg-error "" } no return type + operator <<(char *); //{ dg-error "" } no return type +}; + +void main() // { dg-error "must return .int" } +{ + foo f; + f << (void*)0; +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb80.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb80.C new file mode 100644 index 000000000..e30f7ef2c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb80.C @@ -0,0 +1,7 @@ +// { dg-do assemble } +#include + +class A { + class B : public std::exception {} + ; +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb81.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb81.C new file mode 100644 index 000000000..1f05c602c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb81.C @@ -0,0 +1,42 @@ +// { dg-do assemble } +class x +{ +public: + x (int init_buffer_size=0); + ~x (); +}; + + + +class xSequence +{ +public: + xSequence (); + ~xSequence (); + x Get(int index)const; +}; + + + +class foo +{ +public: + bool bar(const x & name, x & value); + +}; + + + +bool foo::bar(const x & name, x & value) +{ + bool result = false; + + xSequence seq; + x v1, v2; + if(result ? bar(seq.Get(1),v2) : bar(seq.Get(2),v2)) + + ; + + return result; +} + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb82.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb82.C new file mode 100644 index 000000000..9bf0398cd --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb82.C @@ -0,0 +1,13 @@ +// { dg-do assemble } +#include + +template +double val () // { dg-error "" } bogus code +{ + return (double) n1; +} + +int main () +{ + printf ("%d\n", val<(int)3> ()); // { dg-error "" } val undeclared +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C new file mode 100644 index 000000000..ecdb6bed7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C @@ -0,0 +1,18 @@ +// { dg-do run { target native } } +// { dg-options "-fprofile-arcs -ftest-coverage" } +void +test_swap(int& x, int& y) throw() +{ + int tmp = x; + x = y; + y = tmp; +} + +main() +{ + int i = 5; + int j = 7; + test_swap(i, j); +} + +/* { dg-final { cleanup-coverage-files } } */ diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb84.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb84.C new file mode 100644 index 000000000..0d09059b3 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb84.C @@ -0,0 +1,18 @@ +// { dg-do run } +// Error: Internal Compiler error on GCC 2.7.2.3 & EGCS 1998/05/23 snapshot. + +class A { +public: + enum { ONE, TWO, THREE }; +}; + +template +void f() { + +} + +int +main() +{ + f(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb86.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb86.C new file mode 100644 index 000000000..d854afe16 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb86.C @@ -0,0 +1,7 @@ +// { dg-do assemble } +template void foo (); + +template +class Q { + friend void foo (); +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb87.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb87.C new file mode 100644 index 000000000..7d288bc2f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb87.C @@ -0,0 +1,7 @@ +// { dg-do assemble } +template struct Foo { + friend void operator<<(int, Foo const &) {} +}; +template class Bar : public Foo {}; +inline Bar<0> bar(int,int,int) { return Bar<3>(); } // { dg-error "" } no conversion + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb88.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb88.C new file mode 100644 index 000000000..cb604bc80 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb88.C @@ -0,0 +1,16 @@ +// { dg-do run } +// { dg-options "-w" } +// Another magic NULL problem. + +#include + +int main() +{ + try + { + throw(NULL); + } + catch (...) + { + } +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb9.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb9.C new file mode 100644 index 000000000..a64380d98 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb9.C @@ -0,0 +1,22 @@ +// { dg-do assemble } +template +class d0om_Hashmap +{ +public: + typedef int value_type; + + class iterator + { + public: + value_type* operator-> () const; + }; + +}; + + +template +typename d0om_Hashmap::value_type* +d0om_Hashmap::iterator::operator-> () const +{ + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb90.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb90.C new file mode 100644 index 000000000..062324112 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb90.C @@ -0,0 +1,22 @@ +// { dg-do assemble } +// { dg-options "-O2" } + +#ifdef HIDE_BUG +#define realloc Realloc +#endif + +class TmpRgn { +public: + void + realloc(); +}; + +class TmpActor { + TmpRgn tmpRgn; + +public: + void + realloc() { + tmpRgn.realloc(); + } +}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb91.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb91.C new file mode 100644 index 000000000..abfe9face --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb91.C @@ -0,0 +1,86 @@ +// { dg-do run } +#include +#include +typedef short _eb91_int16_t; +typedef char _eb91_int8_t; +typedef unsigned char _eb91_u_int8_t; +typedef unsigned short _eb91_u_int16_t; + +template +class other_endian +{ +private: + + INT value; + + + _eb91_u_int16_t change_endian(_eb91_u_int16_t x) + { + union { + _eb91_u_int16_t i; + _eb91_u_int8_t c[2]; + } val; + val.i = x; + std::swap(val.c[0], val.c[1]); + return val.i; + } + + _eb91_int16_t change_endian(_eb91_int16_t x) + { + union { + _eb91_int16_t i; + _eb91_int8_t c[2]; + } val; + val.i = x; + std::swap(val.c[0], val.c[1]); + return val.i; + } +public: + other_endian(const INT i = 0) + { + value = change_endian(i); + } + + operator INT() + { + return change_endian(value); + } +}; + +template +class same_endian +{ + INT value; + +public: + same_endian(const INT i = 0) + { + value = i; + } + + operator INT() + { + return value; + } +}; + + + + + + + + + + + + + + + + + +int main() { + other_endian <_eb91_u_int16_t> little_endian_16_bit_int; + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb92.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb92.C new file mode 100644 index 000000000..a9660e4cc --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb92.C @@ -0,0 +1,2 @@ +// { dg-do assemble } +template f<0>(){} // { dg-error "" } invalid code diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb93.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb93.C new file mode 100644 index 000000000..da5e7bdd7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb93.C @@ -0,0 +1,31 @@ +// { dg-do assemble } +// Error: Internal compiler error on egcs 1998/05/28 snapshot. + +const double M_PI=3.14159265358979323846; + +template +inline double SineSeries() +{ + const double x=I*2*M_PI/N; + const bool go=K+1!=J; + return 1.0-x*x/(2*K+2)/(2*K+3)*SineSeries(); +} + +template<> +inline double SineSeries<0,0,0,0>() +{ + return 1.0; +} + +template +inline double Sine() +{ + const double x=(I*2*M_PI/N); + return x * SineSeries(); +} + +int main() +{ + double f=Sine<32,5>() + return 0; // { dg-error "" } parse error +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb94.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb94.C new file mode 100644 index 000000000..535023606 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb94.C @@ -0,0 +1,16 @@ +// { dg-do assemble } + + +class baseClass +{ +private: +static int variable; +}; + +class myClass : public baseClass +{ +private: +static int variable; // { dg-error "private" } +}; + +myClass::variable = 0; //{ dg-error "" } no type diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb95.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb95.C new file mode 100644 index 000000000..51d8cffe9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb95.C @@ -0,0 +1,18 @@ +// { dg-do run } +struct A {}; + +template +void operator+ (A &i, T &b) {} + +template +void func (A &a, T &b) {} + +int main() +{ + A a; + +#if STRANGE + func(a, "egcs"); +#endif + a+"egcs"; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C new file mode 100644 index 000000000..e273dab5d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C @@ -0,0 +1,25 @@ +// { dg-do run } +// Creates bad assembly on sparc and x86 +template +struct Array { }; + +template +Array test_ok(const Array& a) { + Array result; + return(result); +} + +template +Array test_error(const Array& a) { + Array result; + return(result); +} + +int main(int argc, char* argv[]) { + Array<2> a; + + test_ok(a); + test_error(a); // <<< MARKED LINE! + + return(0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C new file mode 100644 index 000000000..c5620316e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C @@ -0,0 +1,19 @@ +// { dg-do assemble } +// Error: Internal compiler error in egcs 1998/05/28 snapshot. + + + template + inline + unsigned int + extent(T (&x)[Length]) // { dg-message "note" } + { + return Length; + } + + extern int b[]; + + void f() + { + extent(b); // { dg-error "" } no matching function + // { dg-message "candidate" "candidate note" { target *-*-* } 17 } + } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb99.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb99.C new file mode 100644 index 000000000..7f2c83c2e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb99.C @@ -0,0 +1,135 @@ +// { dg-do assemble } + + + + + + + + + + + + + + + + + +class ref_counted +{ + +protected: + ref_counted( void ) : _count( 0 ) {} + +public: + + unsigned int add_ref( void ) { return ++_count; } + unsigned int release( void ) { return --_count; } + unsigned int count( void ) const { return _count; } + + +protected: + unsigned int _count; +}; + + + + + +template < class T > +class ref_ptr +{ + +public: + ref_ptr( T* ptr = 0 ) : _ptr( ptr ) + { + add_ref(); + } + + ref_ptr( const ref_ptr & rptr ) : _ptr( rptr.get() ) + { + add_ref(); + } + + ~ref_ptr( void ) { release(); } + + + T* get( void ) const { return _ptr; } + T* operator->( void ) const { return get(); } + T& operator*( void ) const { return *get(); } + + bool operator!( void ) const { return get() == 0; } + bool operator==( const ref_ptr & rptr ) const { return *get() == *rptr; +} + bool operator<( const ref_ptr & rptr ) const { return *get() < *rptr; } + + + bool operator==( T* ptr ) const { return *get() == *ptr; } + bool operator<( T* ptr ) const { return *get() < *ptr; } + + const ref_ptr & operator=( const ref_ptr & rptr ) + { + release(); + _ptr = rptr.get(); + add_ref(); + + return *this; + } + + T* operator=( T* ptr ) + { + release(); + _ptr = ptr; + add_ref(); + + return _ptr; + } + +protected: + void add_ref( void ) + { + if( _ptr ) + _ptr->add_ref(); + } + + void release( void ) + { + if( _ptr && 0 == _ptr->release() ) + { + delete _ptr; + _ptr = 0; + } + } + + +protected: + T * _ptr; +}; + + +template< class T > +bool operator==( T* ptr, const ref_ptr< T > & rptr ) +{ + return *ptr == *rptr; +} + +template< class T > +bool operator<( T* ptr, const ref_ptr< T > & rptr ) +{ + return *ptr < *rptr; +} + + + +class Baz : public ref_counted { + int dummy; +}; + + +class Bar; + +int main() { + ref_ptr foo; + static_cast (foo)->DoSomething; //{ dg-error "" } invalid cast +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-cast.C b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-cast.C new file mode 100644 index 000000000..d4c0a46c8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-cast.C @@ -0,0 +1,19 @@ +// { dg-do run } +class null { + null (null const&); + void operator& (); + + public: + null () {} + + template + operator T* () const { return 0; } +} const null; + + +int main () +{ + int *p = static_cast(null); + + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-oldcast.C b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-oldcast.C new file mode 100644 index 000000000..be3a5644f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-oldcast.C @@ -0,0 +1,18 @@ +// { dg-do run } +class null { + null (null const&); + void operator& (); + + public: + null () {} + + template + operator T* () const { return 0; } +} const null; + +int main () +{ + int *p = (int*) null; + + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C new file mode 100644 index 000000000..fda61cc1a --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C @@ -0,0 +1,18 @@ +// { dg-do run } +class null { + null (null const&); + void operator& (); + + public: + null () {} + + template + operator T* () const { return 0; } +} const null; + +int main () +{ + int *p = null; + + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-1.C b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-1.C new file mode 100644 index 000000000..221a6d79c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-1.C @@ -0,0 +1,77 @@ +// { dg-do run } +// check cleanup of template temporaries +extern "C" void abort (); +extern "C" void exit (int); + +int ctor = 0; +int dtor = 0; + +template struct A { + A() {ctor++;} + A(int) {ctor++;} + A(const A&) {ctor++;} + ~A() {dtor++;} + operator int() {return 0;} +}; + +template void ff(T); + +template void ff(T) +{ +} + +void g(int) +{ +} + +void f() +{ + int x; + + A a1; + A a2(37); + A a3 = A(47); + A a4 = 97; + + g(A()); + + A(); + + x ? A() : A(); + + x = 47, A(), A(39), A(23), -17; + + while (A()) + ; + for (;A(3);) + ; + if (A >()) + ; + + ff(A()); + + throw 59; +} + +int +main() +{ + int flag = 0; + + try { + A(); + f(); + } + catch (int) { + A(34); + flag = 1; + } + + if (!flag) + abort(); + + if (!ctor || ctor != dtor) + abort(); + + exit(0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-2.C b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-2.C new file mode 100644 index 000000000..2c2e4bd22 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-2.C @@ -0,0 +1,103 @@ +// { dg-do run } +// check MI and VBC offsets on throw +extern "C" void abort (); +extern "C" void exit (int); + +struct A { + int x[23]; +}; + +struct B : virtual public A { + int y[33]; +}; + +struct C : virtual public A, public B { + int z[43]; +}; + +struct D { + int xx[53]; +}; + +struct E : public D, public A { + int yy[63]; +}; + +C c; + +E e; + +void f1() +{ + throw (C*)0; +} + +void f2() +{ + throw &c; +} + +void f3() +{ + throw (E*)0; +} + +void f4() +{ + throw &e; +} + +int main() +{ + int flag; + + flag = 0; + try { + f1(); + } + catch (A* p) { + if (p) + abort(); + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f2(); + } + catch (A* p) { + if (!p || (void*)p == (void*)&c) + abort(); + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f3(); + } + catch (A* p) { + if (p) + abort(); + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f4(); + } + catch (A* p) { + if (!p || (void*)p == (void*)&e) + abort(); + flag = 1; + } + if (!flag) + abort(); + + exit(0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-3.C b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-3.C new file mode 100644 index 000000000..e8369ca76 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-3.C @@ -0,0 +1,30 @@ +// { dg-do run } +// try throwing 0 cast to a class object +extern "C" void abort (); +extern "C" void exit (int); + +struct A {}; + +void f() +{ + throw (A*)0; +} + +int +main() +{ + int flag; + + flag = 0; + try { + f(); + } + catch (A*) { + flag = 1; + } + + if (!flag) + abort(); + + exit (0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-4.C b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-4.C new file mode 100644 index 000000000..24c740dd1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-4.C @@ -0,0 +1,104 @@ +// { dg-do run } +// check MI and VBC offsets on throw +extern "C" void abort (); +extern "C" void exit (int); + +struct A { + int x[23]; +}; + +struct B : virtual public A { + int y[33]; +}; + +struct C : virtual public A, public B { + int z[43]; +}; + +struct D { + int xx[53]; +}; + +struct E : public D, public A { + int yy[63]; +}; + +C c; + +E e; + +void f1() +{ + throw (C*)0; +} + +void f2() +{ + throw &c; +} + +void f3() +{ + throw (E*)0; +} + +void f4() +{ + throw &e; +} + +int +main() +{ + int flag; + + flag = 0; + try { + f1(); + } + catch (void* p) { + if (p) + abort(); + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f2(); + } + catch (void* p) { + if (!p || (void*)p != (void*)&c) + abort(); + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f3(); + } + catch (void* p) { + if (p) + abort(); + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f4(); + } + catch (void* p) { + if (!p || (void*)p != (void*)&e) + abort(); + flag = 1; + } + if (!flag) + abort(); + + exit(0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-5.C b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-5.C new file mode 100644 index 000000000..7913c09ae --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-5.C @@ -0,0 +1,68 @@ +// { dg-do run } +// check cleanup of partial array objects +extern "C" void abort (void); +extern "C" void exit (int); + +int ctor = 0; +int dtor = 0; + +int cnt = 1; + +struct A { + int x; + A(); + A(const A&); + ~A(); +}; + +A::A() +{ + if (cnt == 10) + throw 57; + x = cnt++; + ctor++; +} + +A::A(const A&) +{ + if (cnt == 10) + throw 57; + x = cnt++; + ctor++; +} + +A::~A() +{ + if (x + 1 != cnt--) + abort(); + dtor++; +} + +void f() +{ + A a[] = {A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A(), A()}; + + throw -1066; +} + +int +main() +{ + int flag; + + flag = 0; + try { + f(); + } + catch (int) { + flag = 1; + } + if (!flag) + abort(); + if (ctor != 9) + abort(); + if (dtor != 9) + abort(); + + exit(0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C new file mode 100644 index 000000000..41fed6ff5 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C @@ -0,0 +1,9 @@ +// { dg-do assemble } + +//test 2 +struct A {}; +void f() +{ + struct A; // { dg-error "" } forward ref + throw *(new A); // { dg-error "" } invalid use of undefined type +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-2.C b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-2.C new file mode 100644 index 000000000..cefef7750 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-2.C @@ -0,0 +1,88 @@ +// { dg-do run } +// check EH with templates +extern "C" void abort (); +extern "C" void exit (int); + +template struct A { + A() {} + A(const char*) {} +}; + +void f1() +{ + throw *(new A >); +} + +void f2() +{ + throw *(new A >); +} + +void f3() +{ + throw A > ("howdy"); +} + +void f4() +{ + throw A > ("hi michey"); +} + +int main() +{ + int flag; + + flag = 0; + try { + f1(); + } + catch (A >) { + abort(); + } + catch (A >) { + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f2(); + } + catch (A >) { + abort(); + } + catch (A >) { + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f3(); + } + catch (A >) { + abort(); + } + catch (A >) { + flag = 1; + } + if (!flag) + abort(); + + flag = 0; + try { + f4(); + } + catch (A >) { + abort(); + } + catch (A >) { + flag = 1; + } + if (!flag) + abort(); + + exit(0); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-3.C b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-3.C new file mode 100644 index 000000000..37d5b6939 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-3.C @@ -0,0 +1,15 @@ +// { dg-do assemble } +// try throwing overloaded function + +void f(int) +{ +} + +void f(long) +{ +} + +void g() +{ + throw &f; // { dg-error "" } insufficient contextual information +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-4.C b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-4.C new file mode 100644 index 000000000..4332e0fce --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-4.C @@ -0,0 +1,13 @@ +// { dg-do assemble } +// try throwing template function name + +template void f(T); + +template void f(T) +{ +} + +void g() +{ + throw &f; // { dg-error "" } insufficient contextual information +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-5.C b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-5.C new file mode 100644 index 000000000..c0dfcd592 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-5.C @@ -0,0 +1,12 @@ +// { dg-do assemble } +// check attempting to throw an overloaded function + +struct A { + void f(int); + void f(long); +}; + +void g() +{ + throw &A::f; // { dg-error "" } insufficient context +} -- cgit v1.2.3