aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
committerBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/891229_02.C25
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/891230_01.C21
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900107_01.C38
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C50
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_01.C17
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C53
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_05.C31
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C27
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900127_02.C47
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_02.C29
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_03.C49
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C32
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900207_03.C50
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_02.C18
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_03.C19
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_04.C21
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900209_01.C21
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_01.C113
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_02.C114
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_03.C27
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_05.C38
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C26
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_07.C21
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_08.C19
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_09.C33
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_10.C15
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_01.C16
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_02.C25
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_03.C15
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_04.C28
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_01.C39
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_02.C28
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_03.C34
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_01.C27
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_02.C22
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_03.C28
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C23
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C45
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900215_02.C48
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_01.C37
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_02.C31
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_03.C52
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900221_01.C22
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C39
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_01.C30
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_02.C28
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_04.C17
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_05.C21
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900322_01.C62
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C19
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_03.C22
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_04.C26
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_05.C22
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_06.C29
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900325_01.C18
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900330_01.C53
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C31
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_02.C28
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_03.C33
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_04.C33
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900401_01.C16
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C16
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900402_02.C22
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900403_01.C20
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900403_04.C13
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_01.C16
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_02.C25
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C29
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C18
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_07.C18
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900405_01.C20
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900406_01.C20
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900406_02.C26
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900407_01.C37
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_01.C164
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C27
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_03.C42
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_01.C43
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_02.C22
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_03.C20
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C117
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_01.C17
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_02.C33
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_03.C48
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_04.C22
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C19
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_06.C23
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_07.C17
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_09.C30
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_12.C12
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C36
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_02.C27
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_03.C50
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_04.C41
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_05.C24
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_06.C79
96 files changed, 3194 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/891229_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/891229_02.C
new file mode 100644
index 000000000..d91987bdf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/891229_02.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 891229_02
+
+// g++ limits the scope of names which are declared as typedef names within
+// another type to that other type.
+
+// This conflicts with the (global) scope given to such names by cfront 2.0.
+
+// Cfront 2.0 passes this test.
+
+// Note 2/15/94: The standard has changed; this limiting of scope is correct
+// behavior. See 9.9. --jason
+
+// keywords: typedef, nested types, scope
+
+struct foo {
+ foo ();
+ typedef void (*function_p) (void);
+};
+
+function_p fp; // { dg-error "" } no such type in scope
+
+foo::foo () {}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/891230_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/891230_01.C
new file mode 100644
index 000000000..769363d58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/891230_01.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// g++ 1.36.1 bug 891230_01
+
+// g++ gives typedefs which are nested within class declarations a scope
+// which is local to the class declaration itself. This causes examples
+// like the following to get compile-time errors.
+
+// Cfront 2.0 passes this test.
+
+// keywords: typedef, nested types, scope
+
+struct foo {
+
+ typedef foo* foo_p;
+ void member (foo_p);
+};
+
+void foo::member (foo_p p) { // { dg-bogus "" } s
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900107_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900107_01.C
new file mode 100644
index 000000000..b486fc664
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900107_01.C
@@ -0,0 +1,38 @@
+// { dg-do run }
+// g++ 1.36.1 bug 900107_01
+
+// Unlike GCC and Cfront 2.0, the g++ 1.36.1 compiler gives struct, union,
+// and class declarations which are nested within blocks file scope.
+
+// Cfront 2.0 passes this test.
+
+// keywords: block scope, file scope, nested types, tagged types
+
+class c1 { int c1_member1; };
+struct s1 { int s1_member1; };
+union u1 { int u1_member1; };
+enum e1 { e1_val1 };
+typedef int t1;
+
+void foo ()
+{
+ class c1 { // { dg-bogus "" }
+ int c1_member1;
+ } c1_local_object_0;
+
+ struct s1 { // { dg-bogus "" }
+ int s1_member1;
+ } s1_local_object_0;
+
+ union u1 { // { dg-bogus "" }
+ int u1_member1;
+ } u1_local_object_0;
+
+ enum e1 { // OK using g++ or GCC, but mishandled by Cfront 2.0.
+ e1_value1
+ } e1_local_object_0;
+
+ typedef int t1; // OK
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C
new file mode 100644
index 000000000..0d181c7ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C
@@ -0,0 +1,50 @@
+// { dg-options "-pedantic-errors -std=c++98" }
+// { dg-do assemble }
+// g++ 1.36.1 bug 900119_01
+
+// g++ allows initializers to be included in the declaration of members
+// of classes, structs, unions (even when -pedantic is used).
+
+// This is not allowed by the C++ 2.0 Reference Manual or by Cfront 2.0.
+
+// keywords: member declaration, member initialization
+
+// { dg-prune-output "is a static data member" }
+
+int global_int;
+
+class class0 {
+public:
+ int class0_member_0 = 99; /* { dg-error "" } */
+ static int class0_member_1 = 99; /* { dg-error "" } */
+ int &class0_member_2 = global_int; /* { dg-error "" } */
+
+ class0 () : class0_member_2 (global_int) { }
+};
+
+
+struct struct0 {
+ int struct0_member_0 = 99; /* { dg-error "" } */
+ static int struct0_member_1 = 99; /* { dg-error "" } */
+ int &struct0_member_2 = global_int; /* { dg-error "" } */
+
+ struct0 () : struct0_member_2 (global_int) { }
+};
+
+// g++ does not allow unions to have more than one member with an initializer
+
+union union0 {
+ int union0_member_0 = 99; /* { dg-error "" } */
+};
+
+union union1 {
+ //static int union1_member_0 = 99; /* definitely illegal (9.5) */
+};
+
+union union2 {
+ int &union2_member_0 = global_int; /* { dg-error "" } */
+
+ union2 () : union2_member_0 (global_int) { }
+};
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_01.C
new file mode 100644
index 000000000..325916358
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_01.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900121_01
+
+// The following file causes g++ 1.36.1 (and 1.36.2) to abort.
+
+// Cfront 2.0 passes this test.
+
+// keywords: abort, incomplete types, reference types, formal parameters
+
+struct s0; // { dg-error "" } forward declaration
+
+void function (struct s0 &arg1, struct s0 &arg2)
+{
+ arg1 = arg2; // { dg-error "" } causes abort
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C
new file mode 100644
index 000000000..15a6d27f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C
@@ -0,0 +1,53 @@
+// { dg-do assemble }
+// { dg-prune-output "note" }
+// { dg-prune-output "deleted" }
+
+// g++ 1.36.1 bug 900121_02
+
+// Assignment of structs is defined as memberwise assignment,
+// however g++ (1.36.2) and Cfront 2.0 differ on the definition
+// of assignment for unions.
+
+// (NOTE: Stroustrup now says that assignment of unions which contain either
+// members or sub-members (base classes are not allowed for unions) which
+// have non-default assignment operators defined for them will be illegal
+// in future.)
+
+// g++ (1.36.2) on the other hand, accepts this program without errors.
+
+// keywords: unions, operator=, inheritance, members
+
+struct s0 {
+
+ int i;
+
+ void operator= (s0 & arg)
+ {
+ this->i = arg.i;
+ }
+};
+
+struct s1 {
+
+ double d;
+
+ void operator= (s1 & arg)
+ {
+ this->d = arg.d;
+ }
+};
+
+union u0 {
+ s0 u0_member_0; // { dg-error "" }
+ s1 u0_member_1; // { dg-error "" }
+};
+
+void function ()
+{
+ u0 u0_object_0;
+ u0 u0_object_1;
+
+ u0_object_0 = u0_object_1;
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_05.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_05.C
new file mode 100644
index 000000000..62db5b343
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_05.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900121_05
+
+// g++ allows unions to have base types (i.e. to be "derived") and it allows
+// other types to have unions as base types. Both cases are illegal.
+
+// g++ curently does not detect such errors.
+
+// Cfront 2.0 passes this test.
+
+// keywords: unions, inheritance
+
+struct s0 {
+ int s0_member;
+};
+
+union u0 : public s0 { /* { dg-error "" } union has base class */
+ int u0_member_0;
+ int u0_member_1;
+};
+
+union u1 {
+ int u1_member_0;
+ int u1_member_1;
+};
+
+struct s1 : public u1 { /* { dg-error "base type" } */
+ int s1_member_0;
+};
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C
new file mode 100644
index 000000000..a066d5848
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900127_01
+
+// g++ often fails to detect (and issue errors for) ambiguous overload
+// situations. In such cases, one of the possibilities is chosen
+// (apparently arbitrarily). Errors should be issued instead.
+
+// Cfront 2.0 passes this test.
+
+// keywords: function overloading, ambiguity
+
+void foo (int);
+int foo (void);
+
+typedef int (*f_ptr_t1) (void);
+typedef void (*f_ptr_t2) (int);
+
+void bar (f_ptr_t1); // { dg-message "note" }
+void bar (f_ptr_t2); // { dg-message "note" }
+
+void function ()
+{
+ bar (foo); // { dg-error "ambiguous" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 23 }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900127_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900127_02.C
new file mode 100644
index 000000000..c74baa940
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900127_02.C
@@ -0,0 +1,47 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900127_02
+
+// g++ (mostly) keeps separate name spaces for the declarations of data
+// objects and functions.
+
+// This means that a single name may be declared as both a data object and
+// a function within a given scope.
+
+// This fact allows programmers to write code which is not portable to the
+// Cfront translator (which keeps a single namespace for these entities).
+
+// This can also lead to ambiguity when the & (address-of) operator is used.
+
+// Cfront 2.0 passes this test.
+
+// keywords: name spaces, overloading
+
+int global0; // { dg-message "" }
+int global0 (); // { dg-error "" }
+
+int global1 (); // { dg-message "" } xref for below
+int global1; // { dg-error "" } caught
+
+struct struct_0 {
+ int class_local (); // { dg-message "" }
+ int class_local; // { dg-error "" }
+};
+
+struct struct_1 {
+ int class_local; // { dg-message "" }
+ int class_local (); // { dg-error "" }
+};
+
+void function_0 ()
+{
+ int function_0_local; // { dg-message "" }
+ extern int function_0_local (); // { dg-error "" }
+}
+
+void function_1 ()
+{
+ int function_1_local (); // { dg-message "" }
+ extern int function_1_local; // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_02.C
new file mode 100644
index 000000000..6275d6aab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_02.C
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900205_02
+
+// g++ allows constructors to be defined which do not include
+// initializations for reference members of their associated classes.
+
+// Cfront 2.0 does not allow this.
+
+// keywords: reference members, constructors, member initialization
+
+int i;
+
+class c0 {
+ int &int_ref;
+public:
+ c0 () /* : int_ref(i) */ { // { dg-error "" } reference needs initializer
+ }
+};
+
+class c1 {
+ int &int_ref;
+public:
+ c1 ();
+};
+
+c1::c1() /* : int_ref(i) */ { // { dg-error "" } reference needs initializer
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_03.C
new file mode 100644
index 000000000..a46052654
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_03.C
@@ -0,0 +1,49 @@
+// { dg-do assemble }
+// { dg-options "-Wreturn-type -pedantic-errors" }
+// g++ 1.36.1 bug 900205_03
+
+// Section 6.6.3 of the cfront 2.0 Reference Manual says "A return statement
+// without an expression can be used only in functions that do not return
+// a value, that is, a function with the return value type void..."
+
+// Also in 6.6.3: "Flowing off the end of a function is equivalent to a
+// return with no value; this is illegal in a value returning function."
+
+// In contrast to the manual, g++ does not generate ERRORs for cases of
+// "flowing off the end" of non-void functions.
+
+// keywords: return statements, return type, void return, implicit return
+
+
+struct struct00 { };
+
+int global_function_0 () {
+} // { dg-warning "no return" }
+
+struct00 global_function_1 () {
+} // { dg-warning "no return" }
+
+struct struct0 {
+
+ int struct0_member_function_0 () {
+ } // { dg-warning "no return" }
+
+ struct0 struct0_member_function_1 () {
+ } // { dg-warning "no return" }
+};
+
+struct struct1 {
+
+ int struct1_member_function_0 ();
+
+ struct1 struct1_member_function_1 ();
+
+};
+
+int struct1_member_function_0 () {
+} // { dg-warning "no return" }
+
+struct1 struct1::struct1_member_function_1 () {
+} // { dg-warning "no return" }
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C
new file mode 100644
index 000000000..3d8625e5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C
@@ -0,0 +1,32 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900205_04
+
+// g++ allows a class for which an implicit default X::X() constructor must
+// be created (implicitly by the compiler) to be derived from another class
+// which does not have its own default X::X() constructor. This is illegal.
+
+// Cfront 2.0 passes this test.
+
+// keywords: default constructor, inheritance
+
+// In ISO C++ 1998, such a derived class is not ill-formed, but if the
+// implicitly-declared constructor is used, then it is implicitly
+// defined and found to be ill-formed.
+
+struct struct0 { // { dg-message "note" }
+ int data_member;
+
+ struct0 (int, void *); // suppresses implicit default constructor
+};
+
+struct0::struct0 (int, void *) // { dg-message "note" }
+{
+}
+
+struct struct0_derived_struct_0 : public struct0 { // { dg-error "no matching|deleted" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 26 }
+};
+
+struct0_derived_struct_0 object; // { dg-message "synthesized|deleted" }
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900207_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900207_03.C
new file mode 100644
index 000000000..8dd5c9f8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900207_03.C
@@ -0,0 +1,50 @@
+// { dg-do run }
+// g++ 1.36.1 bug 900207_03
+
+// g++ fails to allow objects of class or struct types to be initialized
+// using "constructor syntax" in cases where an implicitly generated copy
+// constructor would be invoked for the initialization, and where there is
+// no explicitly specified constructor associated with the type of the
+// object being initialized.
+
+// Note that the type of the error changes depending upon whether or not the
+// type being initialized has any virtual functions associated with it.
+
+// Cfront 2.0 passes this test.
+
+// keywords: implicit copy constructor, initialization
+
+
+// Check construction for a type without virtual function members.
+
+struct struct0 {
+ int data_member;
+};
+
+struct0 struct0_gbl_object0;
+struct0 struct0_gbl_object1 (struct0_gbl_object0); // { dg-bogus "" }
+
+void struct0_test ()
+{
+ struct0 struct0_lcl_object1 (struct0_gbl_object0); // { dg-bogus "" }
+}
+
+// Check construction for a type with virtual function members.
+
+struct struct1 {
+ int data_member;
+
+ virtual void function_member ();
+};
+
+void struct1::function_member () { }
+
+struct1 struct1_gbl_object0;
+struct1 struct1_gbl_object1 (struct1_gbl_object0); // { dg-bogus "" }
+
+void struct1_test ()
+{
+ struct1 struct1_lcl_object1 (struct1_gbl_object0); // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_02.C
new file mode 100644
index 000000000..8e4fdbf27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_02.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// g++ 1.36.1 bug 900208_02
+
+// g++ does not allow a static member of a class/struct/union to be
+// declared as an array without an explicit upper bound.
+
+// Cfront 2.0 passes this test.
+
+// keywords: static data members, arrays, dimension, array bound
+
+class class0 {
+public:
+ static int class0_data_member_0[]; // { dg-bogus "" }
+};
+
+int class0::class0_data_member_0[3] = { 1, 2, 3 }; // { dg-bogus "" }
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_03.C
new file mode 100644
index 000000000..7b7c247d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_03.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900208_03
+
+// The Cfront 2.0 reference manual (5.3.3) says "This type must be an
+// object type; functions cannot be allocated this way...".
+
+// g++ fails to detect (at compile time) cases where an attempt is made to
+// allocate a function using new.
+
+// keywords: operator new, function types
+
+typedef void (func_type) ();
+
+void global_function_0 ()
+{
+ new func_type; // { dg-error "" } missed by both cfront 2.0 and g++ 1.36.1
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_04.C
new file mode 100644
index 000000000..d01268dfa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900208_04.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900208_04
+
+// The Cfront 2.0 reference manual (5.3.3) says "This type must be an
+// object type; functions cannot be allocated this way...".
+
+// g++ fails to detect (at compile time) cases where an attempt is made to
+// deallocate a function using delete.
+
+// Cfront 2.0 passes this test.
+
+// keywords: operator delete, function types
+
+typedef void (func_type) ();
+
+void global_function_1 (func_type *p)
+{
+ delete p; // { dg-error "" } caught by Cfront 2.0 but not by g++ 1.36.1
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900209_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900209_01.C
new file mode 100644
index 000000000..6d91010ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900209_01.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900209_01
+
+// g++ implicitly casts values whose types are "void*" to other pointer
+// types (just as the language rules for C permit). Such implicit
+// conversions are not allowed by the Cfront 2.0 Reference Manual
+// however.
+
+// Cfront 2.0 passes this test.
+
+// keywords: void pointers, type conversions, pointer type conversions
+
+void * void_pointer_object;
+char * char_pointer_object;
+
+void global_function_0 ()
+{
+ char_pointer_object = void_pointer_object; // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_01.C
new file mode 100644
index 000000000..5bbac2cba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_01.C
@@ -0,0 +1,113 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900210_01
+
+// g++ allows pointer type values to be assigned to variables of integal
+// types. According to the C++ Reference Manual, this is illegal.
+
+// Cfront 2.0 passes this test.
+
+// keywords: pointer types, integral types, implicit type conversions
+
+int i;
+long l;
+short s;
+char c;
+float f;
+double d;
+long double ld;
+enum E {enum_value_0} e;
+
+signed int si;
+signed long sl;
+signed short ss;
+signed char sc;
+
+unsigned int ui;
+unsigned long ul;
+unsigned short us;
+unsigned char uc;
+
+void* vp;
+char* cp;
+int* ip;
+enum E2 {enum_value_1} * ep;
+struct S { int member; } * sp;
+void (*fp) (void);
+
+void global_function ()
+{
+ i = vp; /* { dg-error "" } */
+ i = cp; /* { dg-error "" } */
+ i = ip; /* { dg-error "" } */
+ i = ep; /* { dg-error "" } */
+ i = sp; /* { dg-error "" } */
+ i = fp; /* { dg-error "" } */
+ l = vp; /* { dg-error "" } */
+ l = cp; /* { dg-error "" } */
+ l = ip; /* { dg-error "" } */
+ l = ep; /* { dg-error "" } */
+ l = sp; /* { dg-error "" } */
+ l = fp; /* { dg-error "" } */
+ s = vp; /* { dg-error "" } */
+ s = cp; /* { dg-error "" } */
+ s = ip; /* { dg-error "" } */
+ s = ep; /* { dg-error "" } */
+ s = sp; /* { dg-error "" } */
+ s = fp; /* { dg-error "" } */
+ c = vp; /* { dg-error "" } */
+ c = cp; /* { dg-error "" } */
+ c = ip; /* { dg-error "" } */
+ c = ep; /* { dg-error "" } */
+ c = sp; /* { dg-error "" } */
+ c = fp; /* { dg-error "" } */
+ si = vp; /* { dg-error "" } */
+ si = cp; /* { dg-error "" } */
+ si = ip; /* { dg-error "" } */
+ si = ep; /* { dg-error "" } */
+ si = sp; /* { dg-error "" } */
+ si = fp; /* { dg-error "" } */
+ sl = vp; /* { dg-error "" } */
+ sl = cp; /* { dg-error "" } */
+ sl = ip; /* { dg-error "" } */
+ sl = ep; /* { dg-error "" } */
+ sl = sp; /* { dg-error "" } */
+ sl = fp; /* { dg-error "" } */
+ ss = vp; /* { dg-error "" } */
+ ss = cp; /* { dg-error "" } */
+ ss = ip; /* { dg-error "" } */
+ ss = ep; /* { dg-error "" } */
+ ss = sp; /* { dg-error "" } */
+ ss = fp; /* { dg-error "" } */
+ sc = vp; /* { dg-error "" } */
+ sc = cp; /* { dg-error "" } */
+ sc = ip; /* { dg-error "" } */
+ sc = ep; /* { dg-error "" } */
+ sc = sp; /* { dg-error "" } */
+ sc = fp; /* { dg-error "" } */
+ ui = vp; /* { dg-error "" } */
+ ui = cp; /* { dg-error "" } */
+ ui = ip; /* { dg-error "" } */
+ ui = ep; /* { dg-error "" } */
+ ui = sp; /* { dg-error "" } */
+ ui = fp; /* { dg-error "" } */
+ ul = vp; /* { dg-error "" } */
+ ul = cp; /* { dg-error "" } */
+ ul = ip; /* { dg-error "" } */
+ ul = ep; /* { dg-error "" } */
+ ul = sp; /* { dg-error "" } */
+ ul = fp; /* { dg-error "" } */
+ us = vp; /* { dg-error "" } */
+ us = cp; /* { dg-error "" } */
+ us = ip; /* { dg-error "" } */
+ us = ep; /* { dg-error "" } */
+ us = sp; /* { dg-error "" } */
+ us = fp; /* { dg-error "" } */
+ uc = vp; /* { dg-error "" } */
+ uc = cp; /* { dg-error "" } */
+ uc = ip; /* { dg-error "" } */
+ uc = ep; /* { dg-error "" } */
+ uc = sp; /* { dg-error "" } */
+ uc = fp; /* { dg-error "" } */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_02.C
new file mode 100644
index 000000000..b2d38cdbe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_02.C
@@ -0,0 +1,114 @@
+// { dg-do assemble }
+// { dg-options "" }
+// g++ 1.36.1 bug 900210_02
+
+// g++ allows integral type values to be assigned to variables of pointer
+// types. According to the C++ Reference Manual, this is illegal.
+
+// Cfront 2.0 passes this test.
+
+// keywords: integral types, pointer types, implicit type conversions
+// Special Options: -ansi -pedantic-errors
+int i;
+long l;
+short s;
+char c;
+float f;
+double d;
+long double ld;
+enum E {enum_value_0} e;
+
+signed int si;
+signed long sl;
+signed short ss;
+signed char sc;
+
+unsigned int ui;
+unsigned long ul;
+unsigned short us;
+unsigned char uc;
+
+void* vp;
+char* cp;
+int* ip;
+enum E2 {enum_value_1} * ep;
+struct S { int member; } * sp;
+void (*fp) (void);
+
+void global_function ()
+{
+ vp = i; /* { dg-error "" } */
+ vp = l; /* { dg-error "" } */
+ vp = s; /* { dg-error "" } */
+ vp = c; /* { dg-error "" } */
+ vp = si; /* { dg-error "" } */
+ vp = sl; /* { dg-error "" } */
+ vp = ss; /* { dg-error "" } */
+ vp = sc; /* { dg-error "" } */
+ vp = ui; /* { dg-error "" } */
+ vp = ul; /* { dg-error "" } */
+ vp = us; /* { dg-error "" } */
+ vp = uc; /* { dg-error "" } */
+ cp = i; /* { dg-error "" } */
+ cp = l; /* { dg-error "" } */
+ cp = s; /* { dg-error "" } */
+ cp = c; /* { dg-error "" } */
+ cp = si; /* { dg-error "" } */
+ cp = sl; /* { dg-error "" } */
+ cp = ss; /* { dg-error "" } */
+ cp = sc; /* { dg-error "" } */
+ cp = ui; /* { dg-error "" } */
+ cp = ul; /* { dg-error "" } */
+ cp = us; /* { dg-error "" } */
+ cp = uc; /* { dg-error "" } */
+ ip = i; /* { dg-error "" } */
+ ip = l; /* { dg-error "" } */
+ ip = s; /* { dg-error "" } */
+ ip = c; /* { dg-error "" } */
+ ip = si; /* { dg-error "" } */
+ ip = sl; /* { dg-error "" } */
+ ip = ss; /* { dg-error "" } */
+ ip = sc; /* { dg-error "" } */
+ ip = ui; /* { dg-error "" } */
+ ip = ul; /* { dg-error "" } */
+ ip = us; /* { dg-error "" } */
+ ip = uc; /* { dg-error "" } */
+ ep = i; /* { dg-error "" } */
+ ep = l; /* { dg-error "" } */
+ ep = s; /* { dg-error "" } */
+ ep = c; /* { dg-error "" } */
+ ep = si; /* { dg-error "" } */
+ ep = sl; /* { dg-error "" } */
+ ep = ss; /* { dg-error "" } */
+ ep = sc; /* { dg-error "" } */
+ ep = ui; /* { dg-error "" } */
+ ep = ul; /* { dg-error "" } */
+ ep = us; /* { dg-error "" } */
+ ep = uc; /* { dg-error "" } */
+ sp = i; /* { dg-error "" } */
+ sp = l; /* { dg-error "" } */
+ sp = s; /* { dg-error "" } */
+ sp = c; /* { dg-error "" } */
+ sp = si; /* { dg-error "" } */
+ sp = sl; /* { dg-error "" } */
+ sp = ss; /* { dg-error "" } */
+ sp = sc; /* { dg-error "" } */
+ sp = ui; /* { dg-error "" } */
+ sp = ul; /* { dg-error "" } */
+ sp = us; /* { dg-error "" } */
+ sp = uc; /* { dg-error "" } */
+ fp = i; /* { dg-error "" } */
+ fp = l; /* { dg-error "" } */
+ fp = s; /* { dg-error "" } */
+ fp = c; /* { dg-error "" } */
+ fp = si; /* { dg-error "" } */
+ fp = sl; /* { dg-error "" } */
+ fp = ss; /* { dg-error "" } */
+ fp = sc; /* { dg-error "" } */
+ fp = ui; /* { dg-error "" } */
+ fp = ul; /* { dg-error "" } */
+ fp = us; /* { dg-error "" } */
+ fp = uc; /* { dg-error "" } */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_03.C
new file mode 100644
index 000000000..5f9054275
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_03.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900210_03
+
+// g++ allows void* type values to be assigned to variables of other
+// pointer types. According to the C++ Reference Manual, this is illegal.
+
+// Cfront 2.0 passes this test.
+
+// keywords: void pointers, pointer type conversions, implicit type conversions
+
+void* vp;
+char* cp;
+int* ip;
+enum E {enum_value_1} * ep;
+struct S { int member; } * sp;
+void (*fp) (void);
+
+void global_function ()
+{
+ cp = vp; /* { dg-error "" } */
+ ip = vp; /* { dg-error "" } */
+ ep = vp; /* { dg-error "" } */
+ sp = vp; /* { dg-error "" } */
+ fp = vp; /* { dg-error "" } */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_05.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_05.C
new file mode 100644
index 000000000..a14c554bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_05.C
@@ -0,0 +1,38 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900210_05
+
+// Section 18.3 of the 2.0 Reference Manual says "An implementation
+// providing { anachronistic features } should also provide a way for
+// the user to ensure that they do not occur in a source file."
+
+// The *only* proper way to "ensure" an absence of anachronstic features
+// is for C++ language processors to generate errors (rather than just
+// warnings) when such features are used. These errors could perhaps be
+// triggered by some set of command line options, or by the absence of
+// certain command line options. (For g++, the -pedantic and -traditional
+// options come to mind.)
+
+// The use of errors rather than warnings is important because errors
+// usually result in nonzero exit status codes for language processors
+// and these nonzero exit stati can be automatically checked during
+// normal execution of a Makefile.
+
+// cfront 2.0 provides the +p option which causes errors to be generated for
+// all cases of anachronistic usage.
+
+// g++ generates neither errors nor warnings for such usage, even when the
+// -ansi and -pedantic options are used.
+
+// Cfront 2.0 passes this test.
+
+// keywords: anachronism, enum types, integral types, implicit type conversions
+
+enum enum0 { enum_value_0 } enum0_object;
+int int0_object;
+
+void function ()
+{
+ enum0_object = int0_object; /* { dg-error "" } */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C
new file mode 100644
index 000000000..0475a82c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900210_06
+
+// g++ allows values of pointer-to-const types to be assigned to variables
+// of pointer-to-non-const types.
+
+// Cfront 2.0 disallows such assignments.
+
+// g++ also allows values of pointer-to-volatile types to be assigned to
+// variables of pointer-to-non-volatile types.
+
+// Cfront 2.0 *would* disallow this (if it only supported "volatile").
+
+// keywords: pointer types, implicit type conversions
+
+const char *ccp;
+volatile char *vcp;
+char *cp;
+
+void function ()
+{
+ cp = ccp; /* { dg-error "" } */
+ cp = vcp; /* { dg-error "" } */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_07.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_07.C
new file mode 100644
index 000000000..3a2aae961
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_07.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// { dg-options "" }
+// g++ 1.36.1 bug 900210_07
+
+// g++ allows values of pointer-to-signed types to be assigned to variables
+// of pointer-to-unsigned types, and vise versa.
+
+// Cfront 2.0 passes this test.
+
+// keyowrds: pointer types, implicit type conversions
+// Special Options: -ansi -pedantic-errors
+signed int *sip;
+unsigned int *uip;
+
+void function ()
+{
+ sip = uip; // { dg-error "" }
+ uip = sip; // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_08.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_08.C
new file mode 100644
index 000000000..163757b0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_08.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900210_08
+
+// g++ allows pointer-to-const values to be implicitly converted to
+// void* values. This causes a silent loss of the const qualifier.
+
+// Cfront 2.0 passes this test.
+
+// keywords: pointer types, implicit type conversions
+
+const char *ccp;
+void *vp;
+
+void function ()
+{
+ vp = ccp; /* { dg-error "" } */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_09.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_09.C
new file mode 100644
index 000000000..aabe3d5cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_09.C
@@ -0,0 +1,33 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900210_09
+
+// g++ allows pointer to members (both data members and function members)
+// to be implicitly converted to void*.
+
+// Section 4.8 of the Cfront 2.0 Reference Manual disallows such implicit
+// conversions.
+
+// Cfront 2.0 passes this test.
+
+// keywords: member pointers, void pointers, implicit type conversions
+
+class class0 {
+public:
+ int class0_data_member_0;
+ void class0_function_member_0 ();
+};
+
+int class0::*class0_data_member_pointer;
+int (class0::*class0_function_member_pointer) ();
+
+void *vp;
+
+void global_function_0 ()
+{
+ vp = class0_data_member_pointer; // { dg-error "" }
+ vp = class0_function_member_pointer; // { dg-error "" }
+}
+
+int main () { return 0; }
+
+
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_10.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_10.C
new file mode 100644
index 000000000..b1b106727
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900210_10.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900210_10
+
+// g++ allows operator[] to be declared as a static member function.
+// This is illegal.
+
+// Cfront 2.0 passes this test.
+
+// keywords: operator[], static function members
+
+struct struct0 {
+ static int operator[] (); /* { dg-error "" } */
+};
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_01.C
new file mode 100644
index 000000000..3312d3fca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_01.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900211_01
+
+// g++ issues only warnings for calls to previously undeclared functions,
+// however such calls are actually errors.
+
+// Cfront 2.0 passes this test.
+
+// keywords: undeclared, functions
+
+void global_function_0 ()
+{
+ global_function_1 (); /* { dg-error "" } */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_02.C
new file mode 100644
index 000000000..b9f2def86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_02.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900211_02
+
+// g++ allows you to explicitly specify the return type for a type conversion
+// operator.
+
+// The Cfront 2.0 Reference Manual (12.3.2) says that this in not allowed.
+
+// Cfront 2.0 passes this test.
+
+// keywords: type conversion operators, return type
+
+struct struct0 { int member_0; };
+
+struct0 struct0_object_0;
+
+struct struct1 {
+ struct0 operator struct0 (); /* { dg-error "" } */
+};
+
+struct0 struct1::operator struct0 () { // { dg-error "" }
+ return struct0_object_0;
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_03.C
new file mode 100644
index 000000000..b6144000f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_03.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900211_03
+
+// The following erroneous code causes g++ to segfault.
+
+// Cfront 2.0 passes this test.
+
+// keywords: segfault, operator new, arrays, undeclared, array bound
+
+void function ()
+{
+ char* new_base = new char[x]; // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_04.C
new file mode 100644
index 000000000..504360610
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900211_04.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900211_04
+
+// g++ fails to flag as errors attempts to compare pointer values against
+// (nonzero) integer values;
+
+// Since implicit conversions of pointer to integers (or vise versa) are
+// illegal, these comparisons are also illegal.
+
+// Cfront 2.0 passes this test.
+
+// keywords: comparison operators, pointer types, integral types
+
+int result;
+int i;
+char *p;
+
+void function ()
+{
+ result = i == p; /* { dg-error "" } caught by g++ */
+ result = i != p; /* { dg-error "" } caught by g++ */
+ result = i > p; /* { dg-error "" } missed */
+ result = i < p; /* { dg-error "" } missed */
+ result = i >= p; /* { dg-error "" } missed */
+ result = i <= p; /* { dg-error "" } missed */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_01.C
new file mode 100644
index 000000000..8c3349f94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_01.C
@@ -0,0 +1,39 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900212_01
+
+// g++ fails to flag as errors all attempts to add or subtract integer values
+// from pointers-to-member values.
+
+// Some cases are detected however.
+
+// Cfront 2.0 passes this test.
+
+// keywords: pointer arithmetic, member pointers
+
+struct struct0 {
+};
+
+int struct0::*p0;
+int struct0::*p1;
+
+int (struct0::*fp0) ();
+int (struct0::*fp1) ();
+
+void global_function_0 ()
+{
+ p0 = p1 + 3; // { dg-error "" }
+ p0 = p1 - 3; // { dg-error "" }
+ p1++; /* { dg-error "" } caught by g++ */
+ ++p1; /* { dg-error "" } caught by g++ */
+ p1--; /* { dg-error "" } caught by g++ */
+ --p1; /* { dg-error "" } caught by g++ */
+
+ fp0 = fp1 + 3; // { dg-error "" }
+ fp0 = fp1 - 3; // { dg-error "" }
+ fp1++; /* { dg-error "" } */
+ ++fp1; /* { dg-error "" } */
+ fp1--; /* { dg-error "" } */
+ --fp1; /* { dg-error "" } */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_02.C
new file mode 100644
index 000000000..dbcf96c06
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_02.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900212_02
+
+// g++ fails to flag as errors attempts to take the difference of two values
+// of some compatible pointer-to-member type.
+
+// Cfront 2.0 passes this test.
+
+// keywords: pointer arithmetic, subtraction, member pointers
+
+struct struct0 {
+};
+
+int struct0::*p0;
+int struct0::*p1;
+
+int (struct0::*fp0) ();
+int (struct0::*fp1) ();
+
+int result;
+
+void global_function_0 ()
+{
+ result = (p0 - p1); // { dg-error "" }
+ result = (fp0 - fp1); // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_03.C
new file mode 100644
index 000000000..d930e65ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900212_03.C
@@ -0,0 +1,34 @@
+// { dg-do run }
+// g++ 1.36.1 bug 900212_03
+
+// g++ segfaults on any attempt to use the ->* operator.
+
+// Cfront 2.0 passes this test.
+
+// keywords: member pointers, operator->*
+
+struct struct0 {
+ int data_member;
+ void function_member ();
+};
+
+void struct0::function_member ()
+{
+}
+
+int i;
+
+int struct0::*dmp;
+void (struct0::*fmp) ();
+
+struct0 *ptr;
+
+void global_function_0 ()
+{
+ i = ptr->*dmp; // causes segfault
+ (ptr->*fmp) (); // causes segfault
+ // i = ptr->*(&struct0::data_member); // too complicated for cfront
+ // (ptr->*(&struct0::function_member)) (); // too complicated for cfront
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_01.C
new file mode 100644
index 000000000..e7feb9473
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_01.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900213_01
+
+// g++ incorrectly diagnoses the error when an attempt is made to reference
+// a non-static data-member without an object indication.
+
+// Similar attempts to reference non-static function-members are correctly
+// diagnosed by g++.
+
+// Cfront 2.0 passes this test.
+
+// keywords: non-static members, member pointers, scope resolution
+
+struct struct0 {
+ int struct0_data_member_0; /* { dg-error "" } gets error from below */
+ int struct0_function_member_0 ();
+};
+
+int i;
+
+void global_function_0 ()
+{
+ i = struct0::struct0_data_member_0; /* { dg-error "" } mishandled by g++ */
+ //i = struct0::struct0_function_member_0 (); /* gets caught by g++ */
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_02.C
new file mode 100644
index 000000000..9b9ae994d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_02.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900213_02
+
+// The following erroneous code causes g++ to abort.
+
+// Cfront 2.0 passes this test.
+
+// keywords: abort, member pointers, operator*
+
+struct struct0 {
+ int data_member;
+};
+
+int i;
+int struct0::*dmp;
+
+void global_function_0 ()
+{
+ i = *dmp; // { dg-error "invalid use of unary '\\\*' on pointer to member" } causes abort
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_03.C
new file mode 100644
index 000000000..3c150b8b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900213_03.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900213_03
+
+// g++ fails to detect an error when the address of a "bound" function is
+// assigned to a pointer-to-member-function variable.
+
+// It does however correctly detect a similar errors for data-members.
+
+// keywords: bound function, operator&, member pointers
+
+struct struct0 {
+ int data_member;
+ int function_member ();
+};
+
+int i;
+int struct0::*dmp;
+int (struct0::*fmp) ();
+
+struct0 *ptr;
+
+void global_function_0 ()
+{
+ fmp = &ptr->function_member; // { dg-error "" }
+ //dmp = &ptr->data_member; // caught by g++, missed by cfront
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C
new file mode 100644
index 000000000..88cafbfc1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900214_01
+
+// g++ allows function members of incomplete types to be declared to be
+// friends of other types.
+
+// Cfront 2.0 passes this test.
+
+// keywords: friends, incomplete types, function members
+
+struct A; // { dg-error "" } forward declaration
+
+struct B {
+ friend void A::foo(); // { dg-error "" } type A is incomplete
+};
+
+void A::foo(); /* { dg-error "" } also illegal */
+
+struct A {
+ void foo() {}
+};
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C
new file mode 100644
index 000000000..c79a7035f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C
@@ -0,0 +1,45 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900215_01
+
+// g++ allows the definition of a type conversion operator `operator void'
+// for class types, but subsequently fails to generate calls (where needed)
+// for such type conversion operators.
+
+// Cfront 2.0 does generate such calls.
+
+// The following program exits with status 0 when compiled with Cfront 2.0
+// but exits with status 1 when compiled with g++.
+
+// Cfront 2.0 passes this test.
+
+// 4/27/94 (jason): The pre-San Diego working paper prohibits operator
+// void, so we can go back to just ignoring void values.
+
+// keywords: user-defined type conversion operators, void type, explicit casts
+
+// 8/3/2000 (nathan): The std allows you to define such an op, but
+// it will never be called. [class.conv.fct]. Make it an unconditional warning.
+
+// { dg-options "-Wconversion" }
+
+struct struct0 {
+
+ operator void (); // { dg-warning "" } operator void
+};
+
+int exit_status = 1;
+
+struct0::operator void ()
+{
+ exit_status = 0;
+}
+
+struct struct0 s0_object;
+
+int test ()
+{
+ (void) s0_object;
+ return exit_status;
+}
+
+int main () { return test (); }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900215_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900215_02.C
new file mode 100644
index 000000000..3309c8863
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900215_02.C
@@ -0,0 +1,48 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900215_02
+
+// g++ allows global objects (which happen to be pointers to members of some
+// class X) to be dereferenced without prefix object specifications within
+// member functions of class X.
+
+// In effect, g++ treats any dereference of a pointer-to-member which appears
+// within the context of a member function (and which is not preceeded by
+// either ->* or .*) as if it had been implicitly prefixed with this->*.
+
+// The 2.0 Reference Manual only provides that such implicit prefixing
+// takes place for *members* of the containing class, and *not* for
+// global objects that happen to have certain types (i.e. pointer-to-member
+// of the containing class).
+
+// Also, cfront 2.0 provides implicit this-> prefixes *only* for *members*
+// of the containing class.
+
+// Cfront 2.0 passes this test.
+
+// keywords: member pointers, this, dereference, members
+
+struct struct0 {
+ int data_member;
+ void function_member ();
+};
+
+int struct0::*dmp;
+int (struct0::*fmp) ();
+int i;
+
+struct struct1 {
+ int data_member;
+
+ void function_member ();
+};
+
+void struct0::function_member ()
+{
+ i = (this->*fmp) (); // perfectly legal - for both cfront and g++
+ i = this->*dmp; // perfectly legal - for both cfront and g++
+
+ i = (*fmp) (); // { dg-error "invalid use of unary '\\\*' on pointer to member" }
+ i = *dmp; // { dg-error "invalid use of unary '\\\*' on pointer to member" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_01.C
new file mode 100644
index 000000000..bda259df1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_01.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+// g++ 1.36.1 bug 900220_01
+
+// Ref: 12.8
+
+// Section 12.8 says:
+
+// "That is, X::operator=() will be generated only if no assignment
+// operation is explicitly declared and an object of class X is actually
+// assigned an object of class X (or an object of a class derived from X)
+// or if the address of X::operator= is taken.
+
+// g++ does not allow you to take the address of an implicitly generated
+// operator=
+
+// keywords: operator=, implicit copy operator, operator&
+
+struct struct0 {
+ int data_member;
+};
+
+typedef struct0& (struct0::*member_func_t) (const struct0&);
+
+member_func_t member_func;
+
+void global_function_0 (member_func_t member_f)
+{ // { dg-bogus "" } ref from below
+}
+
+void global_function_1 ()
+{
+ member_func = &struct0::operator=; // { dg-bogus "" }
+
+ global_function_0 (&struct0::operator=); // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_02.C
new file mode 100644
index 000000000..48cb8213d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_02.C
@@ -0,0 +1,31 @@
+// { dg-do run }
+// g++ 1.36.1 bug 900220_02
+
+// g++ treats plain `char' and `unsigned char' as different types, however
+// it fails to treat `signed char' as being a different type from plain
+// `char' as called for by both the ANSI C standard and the C++ reference
+// manual.
+
+// keywords: plain char type, signed char type, unsigned char type, overloading
+
+void overloaded (char) {
+}
+
+void overloaded (signed char) { // { dg-bogus "" }
+}
+
+void overloaded (unsigned char) {
+}
+
+void global_function ()
+{
+ char c = 0;
+ signed char sc = 0;
+ unsigned char uc = 0;
+
+ overloaded (c);
+ overloaded (sc);
+ overloaded (uc);
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_03.C
new file mode 100644
index 000000000..7e4aab6f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900220_03.C
@@ -0,0 +1,52 @@
+// { dg-do run }
+// g++ 1.36.1 bug 900220_03
+
+// g++ does not properly disambiguate calls to overloaded functions
+// which are nearly identical except that one take a reference to a
+// type `T' object and another takes a reference to a type `const T'
+// object.
+
+// (Note that the volatile stuff is commented out here because cfront
+// does not yet grok volatile.)
+
+// Cfront 2.0 passes this test.
+
+// keywords: references, overloading, type qualifiers, pointers
+
+int c_call_count = 0;
+int cc_call_count = 0;
+//int vc_call_count = 0;
+
+void overloaded (char&)
+{
+ c_call_count++;
+}
+
+void overloaded (const char&)
+{
+ cc_call_count++;
+}
+
+//void overloaded (volatile char&)
+//{
+// vc_call_count++;
+//}
+
+int test ()
+{
+ char c = 0;
+ const char cc = 0;
+ //volatile char vc = 0;
+
+ char& cr = c;
+ const char& ccr = cc;
+ //volatile char& vcr = vc;
+
+ overloaded (c); // OK
+ overloaded (cc); // { dg-bogus "" }
+ //overloaded (vc); // OK
+
+ return (c_call_count != 1 || cc_call_count != 1 /* || vc_call_count != 1 */);
+}
+
+int main () { return test (); }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900221_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900221_01.C
new file mode 100644
index 000000000..7a31fbb96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900221_01.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// g++ 1.36.1 bug 900221_01
+
+// Ref: 3.2
+//
+// Section 3.2 of the C++ 2.0 Reference Manual says:
+//
+// "Names of formal arguments for a function are treated as if they
+// were declared in the outermost block of that function"
+//
+// g++ does not enforce this treatment.
+
+// Cfront 2.0 passes this test.
+
+// keywords: scope, formal parameters
+
+void function (int arg1)
+{
+ int arg1; // { dg-error "" } redeclaration of arg1
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C
new file mode 100644
index 000000000..b441eff65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C
@@ -0,0 +1,39 @@
+// { dg-do assemble }
+// { dg-options "" }
+// g++ 1.37.1 bug 900227_01
+
+// g++ allows pointer type values to be converted to integral types which are
+// not actually large enough to hold the converted values.
+
+// Section 3.3.4 of the ANSI C standard says:
+
+// A pointer may be converted to an integral type. The size of the
+// integer required and the results are implementation defined. If
+// the space provided is not long enough, the behavior is undefined.
+
+// I believe that the only proper thing to do in such cases is to generate
+// errors. After all, if the converted value gets truncated, it is not
+// likely to be useful after that.
+
+// Furthermore, as the following example demonstrates, allowing pointers
+// to be converted to integral types which are not of sufficient size to
+// completely hold the converted values may cause additional troubles.
+
+// I tried the following code on 5 different machines and it failed on
+// all five (unless I also use the GNU assembler and the GNU linker). Three
+// of the five (Sun3, Sun4, and Symmetry) got link-time errors about byte
+// offset overflows. The other two (368/SystemV and AViiON) got assembly
+// time errors about relocatable names used in "constant" expressions.
+
+// keywords: casts, pointer types, integral types
+
+// Update 2/10/95: The compiler will now compute these expressions at
+// runtime. I think this is in the spirit of the GNU compilers (jason).
+
+
+int main ();
+
+short s = (short) &main; // { dg-error "loses precision" "lose" { xfail h8*-*-* xstormy16-*-* } }
+char c = (char) &main; // { dg-error "loses precision" "lose" }
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_01.C
new file mode 100644
index 000000000..6b52783c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_01.C
@@ -0,0 +1,30 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900321_01
+
+// cfront flags ERRORs on each of the lines indicated below. g++ does not
+// flag either ERRORs or warnings.
+
+// Although I cannot find where in the current C++ Reference Manual this
+// topic is covered, I am sure that these statements should get ERRORs in
+// a "strongly typed" language.
+
+// Cfront 2.0 passes this test.
+
+// keywords: array types, array bound, pointers
+
+int (*ptr_to_array_of_ints)[];
+int (*ptr_to_array_of_3_ints) [3];
+int (*ptr_to_array_of_5_ints) [5];
+
+void function_0 ()
+{
+ // we miss the first two because typeck.c (comp_array_types) deems
+ // it okay if one of the sizes is null
+ ptr_to_array_of_ints = ptr_to_array_of_3_ints; // { dg-error "" }
+ ptr_to_array_of_3_ints = ptr_to_array_of_ints; // { dg-error "" }
+
+ ptr_to_array_of_3_ints = ptr_to_array_of_5_ints; // { dg-error "" }
+ ptr_to_array_of_5_ints = ptr_to_array_of_3_ints; // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_02.C
new file mode 100644
index 000000000..2d487646f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_02.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900321_02
+
+// The following program exits with a nonzero status because the constructor
+// is not called 3 times as it should be. This program exits with a zero
+// status when compiled with cfront 2.0.
+
+// Cfront 2.0 passes this test.
+
+// keywords: arrays, initialization, default constructor, operator new
+
+int call_count = 0;
+
+struct struct0 {
+ struct0 ();
+};
+
+struct0::struct0 () { call_count++; }
+
+typedef struct0 array[3]; // known dimension
+
+int test ()
+{
+ new array;
+ return (call_count != 3);
+}
+
+int main () { return test (); }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_04.C
new file mode 100644
index 000000000..72c063e42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_04.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900321_04
+
+// The following code causes g++ to segfault.
+
+// Cfront 2.0 passes this test.
+
+// keywords: segfault, object declaration, pointer, array, incomplete type
+
+struct incomplete;
+
+void function ()
+{
+ struct incomplete (*ptr)[]; // causes segfault
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_05.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_05.C
new file mode 100644
index 000000000..eb08d1a56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900321_05.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900321_05
+
+// The following code is legal as far as the ANSI C standard, GCC, and
+// cfront are concerned, however g++ issues errors for the lines indicated.
+
+// Cfront 2.0 passes this test.
+
+// keywords: operator[], pointers, index
+
+char c;
+char *cp;
+int i;
+
+void function ()
+{
+ c = 3["abcdef"]; // { dg-bogus "" }
+ c = i[cp]; // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900322_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900322_01.C
new file mode 100644
index 000000000..bd3296ae2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900322_01.C
@@ -0,0 +1,62 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900322_01
+
+// ** Old, obsolete commentary:
+// **************************************************************************
+// The ANSI C standard, in section 3.1.2.5 (first paragraph) differentiates
+// types into three disjoint sets, i.e object types, function types, and
+// incomplete types.
+
+// Also in 3.1.2.5 (page 24) the standard says that the element type of
+// an array type is an object type.
+
+// Later in that same section the standard also notes that array types with
+// unknown size are considered incomplete types (page 25). (Struct & union
+// types which have only been "forward declared" are also incomplete types.)
+
+// Some experts infer this to mean that it is not legal to specify or to
+// construct an array *type* whose element type is an incomplete type.
+
+// This interpretation suggests that the statements indicated below contain
+// errors.
+
+// g++ fails to flag all of the indicated statements with errors (even when
+// the -pedantic option is used).
+// **************************************************************************
+
+// The above commentary is wrong. (jason 1998/11/13)
+// In fact, the lines marked OK are well-formed; the prohibition is only
+// against forming array types with multiple unknown bounds. This prohibition
+// is found in 8.3.4 [dcl.array].
+
+// It is also ill-formed to create an object of incomplete type.
+
+// keywords: incomplete types, arrays, element types
+
+extern int extern_two_d [] []; // { dg-error "" } invalid declaration
+int tenative_two_d [] []; // { dg-error "" } caught by g++
+static int static_two_d [] []; // { dg-error "" } caught by g++
+
+int (*pointer_to_two_d)[][]; // { dg-error "" } invalid declaration
+
+void function_0 (int arg [] []) { // { dg-error "" } invalid declaration
+}
+
+typedef int int_one_d_type [];
+typedef int_one_d_type int_two_d_type[];// { dg-error "" } invalid declaration
+
+struct s;
+
+extern struct s extern_s_array [10]; // OK
+struct s tenative_s_array [10]; // { dg-error "" } object with incomplete type
+static struct s static_s_array [10]; // { dg-error "" } object with incomplete type
+
+struct s (*pointer_to_s_array) []; // OK
+
+void function_1 (struct s arg []) { // OK
+}
+
+typedef struct s s_type;
+typedef s_type s_one_d_type [10]; // OK
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C
new file mode 100644
index 000000000..b77cc0375
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_02.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900324_02
+
+// The following erroreous code causes g++ to segfault.
+
+// Cfront 2.0 passes this test.
+
+// keywords: segfault, function pointer, conditional operator ?:
+
+void function_0 (int i) { }
+
+void (*fp)(void);
+
+void function_1 ()
+{
+ fp = 1 ? function_0 : fp; // { dg-error "conditional expression|invalid conversion" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_03.C
new file mode 100644
index 000000000..8c9989dbd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_03.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900324_03
+
+// g++ is unable to correctly parse declarations of non-global function-pointer
+// variables and/or function-pointer formal parameters.
+
+// Cfront 2.0 passes this test.
+
+// keywords: syntax, function pointers, block local, formal
+
+void (*p0)(); // OK
+
+void function_0 ()
+{
+ void (*p1)(); // { dg-bogus "" } s
+}
+
+void function_1 (void (*p2)()); // { dg-bogus "" } s
+
+void (*function_2 ()) (); // OK
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_04.C
new file mode 100644
index 000000000..1d671d156
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_04.C
@@ -0,0 +1,26 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900324_04
+
+// g++ implements an extension which supports the copying of array objects.
+
+// This extension is not described in the current C++ Reference Manual, and
+// it is not implemented by cfront (2.0).
+
+// g++ should generate errors for the use of this extension when -pedantic
+// is used, however it does not.
+
+// Cfront 2.0 passes this test.
+
+// keywords: extension, pedantic, arrays, copy
+
+typedef int int_array[20];
+
+int_array ia1;
+int_array ia2;
+
+void function_0 ()
+{
+ ia1 = ia2; // { dg-error "" } gnu extension
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_05.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_05.C
new file mode 100644
index 000000000..62625b59f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_05.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900324_05
+
+// The following erroneous code causes g++ to segfault.
+
+// Cfront 2.0 passes this test.
+
+// keywords: segfault, arrays, references, assignment operator=
+
+typedef int int_array[];
+
+extern int_array int_array_object;
+
+int_array &left = int_array_object;
+int_array &right = int_array_object;
+
+void function ()
+{
+ left = right; // { dg-error "" } causes segfault
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_06.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_06.C
new file mode 100644
index 000000000..95eb00074
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900324_06.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900324_06
+
+// g++ is unable to use context information (i.e. the required type of the
+// expression) to disambiguate a possibly overloaded function name when that
+// name is used as either the second or the third operand of a ?: operator.
+
+// It is also unable to use the fact that the given name is not in fact
+// overloaded (and has only one possible interpretation).
+
+// This results in improper errors being generated.
+
+// keywords: overloading, function pointers, disambiguation, operator?:
+
+int i;
+void (*p)();
+
+void function_0 ()
+{
+}
+
+void function_1 ()
+{
+ p = i ? function_0 : 0; // { dg-bogus "" }
+ p = i ? 0 : function_0; // { dg-bogus "" }
+ p = i ? function_1 : function_0; // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900325_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900325_01.C
new file mode 100644
index 000000000..e95a20b61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900325_01.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900325_01
+
+// g++ fails to generate errors for attempts to declare a formal argument to
+// be of a void type.
+
+// keywords: formal parameter, void type
+
+typedef void __void;
+typedef __void Void;
+
+void function0 (void arg1) { // { dg-error "" } missed
+}
+
+void function1 (Void arg1) { // { dg-error "" } missed
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900330_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900330_01.C
new file mode 100644
index 000000000..6800499c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900330_01.C
@@ -0,0 +1,53 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900330_01
+//
+// As indicated by the example at the end of the section 3.5.3 of the ANSI
+// C standard, when a type qualifier (i.e. "const" or "volatile") is applied
+// to an array type, the effect should be as if the element type had been
+// qualified with the given qualifier.
+//
+// This rule applies to C++ also.
+//
+// In section 7.1.6 of the C++ Reference Manual it says "Each element of a
+// const array is const..."
+//
+// It appears however that when a name already exists for a given array type
+// (i.e. a typedef name) and when that name is qualified by a type qualifier,
+// (i.e. "const" or "volatile"), gcc & g++ may act as if the qualifier applied
+// to the named (array) type rather that to the elements of that type.
+//
+// The result is that (even with the -ansi and -pedantic options) g++
+// generates no errors or warnings for the lines indicated (even though it
+// should).
+//
+// Due to the incorrect associations, gcc & g++ will also issue inappropriate
+// warnings in some cases (as illustrated below).
+
+// keywords: type qualifiers, arrays
+
+typedef const int const_int;
+typedef const_int array_of_const_int[3];
+array_of_const_int *ptr_to_array_of_consts;
+
+typedef int array_of_int[3];
+typedef const array_of_int const_array_of_int;
+const_array_of_int *ptr_to_const_array;
+
+void function_0 ()
+{
+ ptr_to_array_of_consts = ptr_to_const_array; /* gets bogus warning */
+ ptr_to_const_array = ptr_to_array_of_consts; /* gets bogus warning */
+}
+
+/* The following example is taken from ANSI 3.5.3 */
+
+typedef int A[2][3];
+const A a = {{4, 5, 6}, {7, 8, 9}};
+int *pi;
+
+void function_1 ()
+{
+ pi = a[0]; // { dg-error "" } a[0] has type "const int *"
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C
new file mode 100644
index 000000000..cad19a2c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900330_02
+
+// The C++ Reference Manual says in section 13.1:
+
+// "Two function declarations of the same name refer to the same function
+// if they are in the same scope and have identical argument types. A
+// function member of a derived class is *not* in the same scope as a function
+// member of the same name in a base class."
+
+// g++ fails to correctly detect the error indicated.
+
+// Cfront 2.0 passes this test.
+
+// keywords: function, member, overloading, hiding
+
+struct B {
+ int f(int);
+};
+
+struct D : public B {
+ int f(struct B); // { dg-message "D::f|no known conversion" } referred to below
+};
+
+void h(D* pd)
+{
+ pd->f(1); // { dg-error "no matching" } D::f(struct B) hides B::f(int)
+ // { dg-message "candidate" "candidate note" { target *-*-* } 27 }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_02.C
new file mode 100644
index 000000000..f4d69fdca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_02.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900331_02
+
+// g++ fails to treat conditional expressions which yield composite type
+// (i.e. struct type, union type, or class type) lvalues as if they did
+// in fact yield lvalues in all cases.
+
+// Cfront 2.0 passes this test.
+
+// keywords: conditional operator?:, lvalues, composite types
+
+struct struct0 {
+ int data_member;
+};
+
+struct0 object0;
+struct0 object1;
+struct0 object2;
+
+int i;
+
+void function0 ()
+{
+ (i ? object0 : object1).data_member = 99; // { dg-bogus "" }
+ (i ? object0 : object1) = object2; // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_03.C
new file mode 100644
index 000000000..f59f107e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_03.C
@@ -0,0 +1,33 @@
+// { dg-do run }
+// { dg-options "" }
+// g++ 1.37.1 bug 900331_03
+
+// Special Options: -ansi
+
+// The following code causes g++ to abort.
+
+// Curiously, the abort does not occur if the -pedantic option is used.
+
+// Cfront 2.0 passes this test.
+
+// Keywords: abort, conditional operator?:, lvalues, composite types
+
+struct struct0 {
+ int data_member;
+
+ virtual void function_member () {} // contributes to the abort
+};
+
+struct0 object0;
+struct0 object1;
+struct0 object2;
+
+int i;
+
+void function0 ()
+{
+ object2 = (i ? object0 : object1); // OK
+ (i ? object0 : object1) = object2; // causes abort
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_04.C
new file mode 100644
index 000000000..ddc39182c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900331_04.C
@@ -0,0 +1,33 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900331_04
+
+// g++ is unable to correctly parse declarations of formal parameters and
+// local objects which have pointer-to-array types or reference-to-array
+// types.
+
+// Cfront 2.0 passes this test.
+
+// keywords: syntax, arrays, pointers, references, local, formal
+
+int array[10];
+
+int (*global_array_ptr)[10] = &array;
+int (&global_array_ref)[10] = array;
+
+void function0 (int (*formal_array_ptr)[10]) { // { dg-bogus "" } s
+}
+
+void function1 (int (&formal_array_ref)[10]) { // { dg-bogus "" } s
+}
+
+void function2 ()
+{
+ int (*local_array_ptr)[10] = &array; // { dg-bogus "" } s
+}
+
+void function3 ()
+{
+ int (&local_array_ref)[10] = array; // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900401_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900401_01.C
new file mode 100644
index 000000000..cef7175f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900401_01.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900401_01
+
+// The following erroneous code causes g++ to abort.
+
+// Cfront 2.0 passes this test.
+
+// keywords: abort, bit-fields, arrays
+
+typedef unsigned nibble_array[4];
+
+struct whole {
+ nibble_array nibbles:16; // { dg-error "" }
+};
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C
new file mode 100644
index 000000000..42533861f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900402_01
+
+// The following erroneous code causes g++ to abort.
+
+// Cfront 2.0 passes this test.
+
+// keywords: abort, bit-fields, function types
+
+typedef void (func_type) ();
+
+struct s {
+ func_type f:32; // { dg-error "" } bitified with function type
+};
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900402_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900402_02.C
new file mode 100644
index 000000000..d3cf5ad9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900402_02.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900402_02
+
+// g++ fails to correctly flag all attempts to construct an array type
+// of zero length as errors.
+
+// keywords: arrays, array bound, zero length
+
+typedef int array_type[0]; // { dg-error "zero-size array" }
+
+int array_object_1[0]; // { dg-error "zero-size array" }
+
+void function_0 (int formal_array[0]) // { dg-error "zero-size array" }
+{
+}
+
+void function_2 ()
+{
+ int local_object_array_0[0]; // { dg-error "zero-size array" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900403_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900403_01.C
new file mode 100644
index 000000000..124654fbf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900403_01.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900403_01
+
+// g++ allows casts to be treated as lvalues (even when the -pedantic
+// option is used). Neither the C++ Reference Manual nor cfront 2.0
+// allow this. (gcc gives warnings for such usage with -pedantic).
+
+// Cfront 2.0 passes this test.
+
+// keywords: lvalues, casts
+
+int i, j;
+
+void f ()
+{
+ (int) i = j; // { dg-error "" }
+ ((int) i) = j; // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900403_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900403_04.C
new file mode 100644
index 000000000..1435bfad3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900403_04.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900403_04
+
+// The following erroneous code causes g++ to abort.
+
+// keywords: abort, bit-fields, zero length
+
+struct s {
+ unsigned int foo:0; // { dg-error "" } This is the real line
+ unsigned int field;
+};
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_01.C
new file mode 100644
index 000000000..60e81129a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_01.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900404_01
+
+// g++ allows string initializers for known-length character arrays to be
+// one character longer (counting the terminating null) than the actual
+// length of the array to be initialized.
+
+// The C++ Reference Manual (section 8.4.2) expressly prohibits this.
+
+// Cfront 2.0 passes this test.
+
+// keywords: arrays, initialization, array bounds
+
+char cv[4] = "asdf"; // { dg-error "" } missed
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_02.C
new file mode 100644
index 000000000..3f87b614b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_02.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900404_02
+
+// g++ fails to treat multicharacter literals as type "int" as required by
+// section 2.5.2 of the C++ Reference Manual.
+
+// The result is that the following program will exit with a nonzero
+// exit status.
+
+// keywords: character literals, multi-character literals, int type
+
+int exit_status = 0;
+
+void function0 (int i) // function that should be called
+{
+ i = i;
+}
+
+void function0 (char c) // function that is actually called
+{
+ c = c;
+ exit_status++;
+}
+
+int main () { function0 ('abcd'); return exit_status; } // { dg-warning "" }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C
new file mode 100644
index 000000000..7e2829f7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900404_03
+
+// g++ fails to be able to properly flag errors for even simple cases of
+// ambiguous overload resolution (such as the one shown below).
+
+// Cfront 2.0 passes this test.
+
+// keywords: overloading, ambiguity, resolution
+
+void function0 (int i, char c) // { dg-message "function0" }
+{
+ i = c;
+}
+
+void function0 (char c, int i) // { dg-message "function0" }
+{
+ i = c;
+}
+
+char c;
+
+void test ()
+{
+ function0 (c,c); // { dg-error "ambiguous" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 25 }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
new file mode 100644
index 000000000..04ff66905
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900404_04
+
+// [dcl.dcl] explains that simple-declarations may omit the
+// init-declarator-list only if the decl-specifier-seq declares a
+// class, i.e. if it contains a class-specifier, an
+// elaborated-type-specifier with class key, or an enum-specifier. The
+// declaration below contains neither.
+
+// g++ fails to flag errors for such usage.
+
+// keywords: semicolon, vacuous, file scope, declaration
+
+int i;
+
+; // { dg-error "extra ';'" }
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_07.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_07.C
new file mode 100644
index 000000000..19791bfdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900404_07.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900404_07
+
+// It is illegal to use a cast to attempt to convert an object type
+// to a non-scalar type (e.g. an array type).
+
+// g++ fails to properly flag as errors such illegal uses of array types.
+
+// keywords: array types, casts, type conversion
+
+typedef int array_type[10];
+
+array_type *ap;
+
+void foo ()
+{
+ int i = *((array_type) *ap); /* { dg-error "" } missed */
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900405_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900405_01.C
new file mode 100644
index 000000000..25686f800
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900405_01.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900405_01
+
+// The C++ Reference Manual says (in section 5.4) "Types may not be defined
+// in casts."
+
+// g++ fails to flag errors for cases where an attempt is made to define
+// a struct, class, union, or enum type within a cast.
+
+// keywords: casts, type definitions, tagged types
+
+void f ()
+{
+ (enum e { red, green } *) 0; // { dg-error "" } type defined in cast
+ (struct s { int member; } *) 0; // { dg-error "" } type defined in cast
+ (union u { int member; } * ) 0; // { dg-error "" } type defined in cast
+ (class c { int member; } *) 0; // { dg-error "" } type defined in cast
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900406_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900406_01.C
new file mode 100644
index 000000000..f99f73d72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900406_01.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900406_01
+
+// The following code causes g++ to segfault.
+
+// cfront 2.0 passes this test.
+
+// keywords: segfault, operator new, array types, array bounds
+
+void function0 ()
+{
+ new int[]; // { dg-error "" } causes segfault
+}
+
+void function1 ()
+{
+ new int (*)[]; // { dg-error "" } no size specified
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900406_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900406_02.C
new file mode 100644
index 000000000..bcbffeb55
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900406_02.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// g++ bug 900406_02
+
+// g++ fails to correctly parse some type specifications within casts.
+
+// This results in incorrect errors being issued.
+
+// These errors are not issued for identical code by either cfront or
+// by gcc.
+
+// cfront 2.0 passes this test.
+
+// keywords: syntax, array types, casts
+
+int (*ipp)[];
+int (**ippp)[];
+
+int function ()
+{
+ ipp = (int (*)[]) 0; // OK
+ ippp = (int (**)[]) 0; // { dg-bogus "" } (syntax)
+ return 0;
+}
+
+int main () { return 0; }
+
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900407_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900407_01.C
new file mode 100644
index 000000000..e5976d694
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900407_01.C
@@ -0,0 +1,37 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900407_01
+
+// g++ fails to flag errors for uses of anachronistic features such as the
+// invocation of a base class constructor in a ctor-initializer list without
+// explicitly giving its name.
+
+// Errors should probably be issued for such usage unless the -traditional
+// option is used.
+
+// Warnings are however issued.
+
+// Cfront 2.0 flags such usage as an error when the +p (pure-language) option
+// is used.
+
+// Cfront 2.0 passes this test.
+
+// keywords: anachronism, inheritance, initialization, mem-initializer
+
+struct s0 {
+ int member;
+
+ s0 ();
+};
+
+s0::s0() { }
+
+struct s1 : public s0 {
+ int member;
+
+ s1 ();
+};
+
+s1::s1() : () { // { dg-error "" } anachronism used
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_01.C
new file mode 100644
index 000000000..a806ef070
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_01.C
@@ -0,0 +1,164 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900428_01
+
+// g++ fails to issue error messages for cases where an incomplete type
+// object must be evaluated if the value of such an evaluation is not
+// actually used in the given context.
+
+// In the case where such an object is volatile, it is obvious that this
+// could be a problem, however I believe that errors should be issued
+// for such cases regardless of whether or not such values are volatile
+// because the abstract semantics seem to require the evaluation of such
+// values whether they are volatile or not.
+
+// [expr.static.cast/4, stmt.expr/1, expr.comma/1] show that expressions do
+// not under go lvalue to rvalue decay, unless the value is actually used.
+// This can be surprising when the object is volatile. We interpret a
+// dereference of pointer to volatile to be a read.
+
+// keywords: incomplete types, evaluation, volatile qualifier
+
+int *ip_fn ();
+int &ir_fn ();
+volatile int *vip_fn ();
+volatile int &vir_fn ();
+
+void int_test (int i, int *p, volatile int *vp, int &r, volatile int &vr)
+{
+ int j;
+ volatile int vj;
+
+ *p; // ok, no warning
+ (void)*p; // ok, no warning
+ (void)(i ? j : *p); // ok, no warning
+ (void)(i ? *p : j); // ok, no warning
+ (void)((void)1, *p); // ok, no warning
+
+ *vp; // ok, no warning
+ (void)*vp; // ok, no warning
+ (void)(i ? vj : *vp); // ok, no warning
+ (void)(i ? *vp : vj); // ok, no warning
+ (void)((void)1, *vp); // ok, no warning
+
+ r; // ok, no warning
+ (void)r; // ok, no warning
+ (void)(i ? j : r); // ok, no warning
+ (void)(i ? r : j); // ok, no warning
+ (void)((void)1, r); // ok, no warning
+
+ vr; // { dg-warning "" } reference not accessed
+ (void)vr; // { dg-warning "" } reference not accessed
+ (void)(i ? vj : vr); // { dg-warning "" } reference not accessed
+ (void)(i ? vr : vj); // { dg-warning "" } reference not accessed
+ (void)((void)1, vr); // { dg-warning "" } reference not accessed
+
+ *ip_fn (); // ok, no warning
+ *vip_fn (); // ok, no warning
+ ir_fn (); // ok, no warning
+ vir_fn (); // { dg-warning "" } reference not accessed
+}
+
+struct S;
+S *sp_fn ();
+S &sr_fn ();
+volatile S *vsp_fn ();
+volatile S &vsr_fn ();
+
+void incomplete_test (int i, S *p, volatile S *vp, S &r, volatile S &vr)
+{
+ extern S j;
+ extern volatile S vj;
+
+ *p; // ok, no warning
+ (void)*p; // ok, no warning
+ (void)(i ? j : *p); // ok, no warning
+ (void)(i ? *p : j); // ok, no warning
+ (void)((void)1, *p); // ok, no warning
+
+ *vp; // { dg-warning "" } incomplete not accessed
+ (void)*vp; // { dg-warning "" } incomplete not accessed
+ (void)(i ? vj : *vp); // { dg-warning "" } incomplete not accessed
+ (void)(i ? *vp : vj); // { dg-warning "" } incomplete not accessed
+ (void)((void)1, *vp); // { dg-warning "" } incomplete not accessed
+
+ r; // ok, no warning
+ (void)r; // ok, no warning
+ (void)(i ? j : r); // ok, no warning
+ (void)(i ? r : j); // ok, no warning
+ (void)((void)1, r); // ok, no warning
+
+ vr; // { dg-warning "" } reference not accessed
+ (void)vr; // { dg-warning "" } reference not accessed
+ (void)(i ? vj : vr); // { dg-warning "" } reference not accessed
+ (void)(i ? vr : vj); // { dg-warning "" } reference not accessed
+ (void)((void)1, vr); // { dg-warning "" } reference not accessed
+
+ *sp_fn (); // ok, no warning
+ *vsp_fn (); // { dg-warning "" } incomplete not accessed
+ sr_fn (); // ok, no warning
+ vsr_fn (); // { dg-warning "" } reference not accessed
+}
+
+struct T {int m;};
+T *tp_fn ();
+T &tr_fn ();
+volatile T *vtp_fn ();
+volatile T &vtr_fn ();
+
+void complete_test (int i, T *p, volatile T *vp, T &r, volatile T &vr)
+{
+ T j;
+ volatile T vj;
+
+ *p; // ok, no warning
+ (void)*p; // ok, no warning
+ (void)(i ? j : *p); // ok, no warning
+ (void)(i ? *p : j); // ok, no warning
+ (void)((void)1, *p); // ok, no warning
+
+ *vp; // ok, no warning
+ (void)*vp; // ok, no warning
+ (void)(i ? vj : *vp); // ok, no warning
+ (void)(i ? *vp : vj); // ok, no warning
+ (void)((void)1, *vp); // ok, no warning
+
+ r; // ok, no warning
+ (void)r; // ok, no warning
+ (void)(i ? j : r); // ok, no warning
+ (void)(i ? r : j); // ok, no warning
+ (void)((void)1, r); // ok, no warning
+
+ vr; // { dg-warning "" } reference not accessed
+ (void)vr; // { dg-warning "" } reference not accessed
+ (void)(i ? vj : vr); // { dg-warning "" } reference not accessed
+ (void)(i ? vr : vj); // { dg-warning "" } reference not accessed
+ (void)((void)1, vr); // { dg-warning "" } reference not accessed
+
+ *tp_fn (); // ok, no warning
+ *vtp_fn (); // ok, no warning
+ tr_fn (); // ok, no warning
+ vtr_fn (); // ok, no warning{ dg-warning "" } reference not accessed
+}
+
+void extern_test ()
+{
+ extern S es;
+ extern volatile S ves;
+ extern T et;
+ extern volatile T vet;
+
+ extern S &esr;
+ extern volatile S &vesr;
+ extern T &etr;
+ extern volatile T &vetr;
+
+ es; // ok, no warning
+ ves; // { dg-warning "" } incomplete not accessed
+ et; // ok, no warning
+ vet; // ok, no warning
+
+ esr; // ok, no warning
+ vesr; // { dg-warning "" } incomplete not accessed
+ etr; // ok, no warning
+ vetr; // { dg-warning "" } reference not accessed
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C
new file mode 100644
index 000000000..4846a8113
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900428_02
+
+// g++ fails to issue either errors or warnings (even with -pedantic) for
+// attempts to perform either pre or post increment or decrement operations
+// on variables which have either pointer-to-void types or pointer-to-function
+// types.
+
+// cfront 2.0 passes this test.
+
+// keywords: pointer arithmetic, increment, decrement
+
+void *vp;
+void (*fp) ();
+
+void test ()
+{
+ vp++; /* { dg-error "" } */
+ ++vp; /* { dg-error "" } */
+ vp--; /* { dg-error "" } */
+ --vp; /* { dg-error "" } */
+
+ fp++; /* { dg-error "" } */
+ ++fp; /* { dg-error "" } */
+ fp--; /* { dg-error "" } */
+ --fp; /* { dg-error "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_03.C
new file mode 100644
index 000000000..d0625c4b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900428_03.C
@@ -0,0 +1,42 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900428_03
+
+// g++ fails to detect cases where a constructor for a derived class invokes
+// (either explicitly or implicitly) a private constructor for a base class.
+
+// cfront 2.0 passes this test.
+
+// keywords: inheritance, private, accessability, constructors
+
+struct struct_0 {
+ int struct_0_data_member;
+
+private:
+ struct_0 (int, int);
+public:
+ struct_0 (int);
+};
+
+struct_0::struct_0 (int i) { }
+struct_0::struct_0 (int, int) { } // { dg-error "is private" }
+
+struct struct_1 : public struct_0 {
+
+ struct_1 ();
+};
+
+struct_1::struct_1 () : struct_0 (8,9) // { dg-error "within this context" }
+{
+}
+
+struct struct_2 {
+ struct_0 struct_2_data_member;
+
+ struct_2 ();
+};
+
+struct_2::struct_2 () : struct_2_data_member (8,9) // { dg-error "within this context" }
+{
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_01.C
new file mode 100644
index 000000000..e5dff0e25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_01.C
@@ -0,0 +1,43 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900511_01
+
+// g++ fails to properly apply user-defined type conversion operators
+// in cases where is it not obvious that the given conversion is
+// appropriate for the context (i.e. operator and other operands)
+// where the conversion should take place.
+
+// cfront 2.0 passes this test.
+
+struct struct_1 {
+ int member;
+
+ operator int ();
+};
+
+struct_1::operator int ()
+{
+ return 0;
+}
+
+struct struct_2 {
+ int member;
+
+ operator float ();
+};
+
+struct_2::operator float ()
+{
+ return 0.0;
+}
+
+struct_1 struct_1_object;
+struct_2 struct_2_object;
+double d;
+
+void test ()
+{
+ d = struct_2_object + struct_1_object; // OK
+ d = struct_1_object + struct_2_object; // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_02.C
new file mode 100644
index 000000000..f2f565084
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_02.C
@@ -0,0 +1,22 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900511_02
+
+// g++ does not properly shadow names of types with names of data members
+// in cases where the type names in question are used in the context of
+// formal parameters lists for member functions.
+
+// keywords: typedef names, shadowing, scope, formal parameter list
+
+// cfront 2.0 passes this test.
+
+enum enum0 { enum0_value_0 };
+
+struct struct0 {
+ int enum0;
+ void member_function (enum0 e); // { dg-error "" } invalid use of struct-local member
+};
+
+void class0::member_function (enum0 e) { // { dg-error "" } syntax error
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_03.C
new file mode 100644
index 000000000..d01b6aa36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900511_03.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900511_03
+
+// g++ does not properly shadow names of types with names of data members
+// in cases where the type names in question are used in the context of
+// formal parameters lists for member functions.
+
+// keywords: typedef names, shadowing, scope, formal parameter list
+
+class class0;
+
+struct struct1 {
+ int class0;
+ void member_function (class0 *); // { dg-error "" } invalid use of struct-local member
+};
+
+void class1::member_function (class0 *p) { // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C
new file mode 100644
index 000000000..e2460d99b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C
@@ -0,0 +1,117 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900514_03
+
+// g++ fails to flag ERRORs on the following erroneous code.
+
+// In Section 12.3.2 it says "Defining conversion by both a constructor and
+// a conversion function can lead to ambiguities." However in the case below,
+// the explicit cast syntax disambiguates the constructor as one which
+// invokes the type conversion operator rather than the conversion.
+
+// NO, IT DOESN'T. It's still ambiguous. --jason 2002-12-03
+
+// cfront 2.0 passes this test.
+
+// keywords: user-defined type conversion operator, constructor
+
+struct t_0_st_0;
+
+struct t_0_st_1 { // { dg-message "initializing" }
+ int member;
+
+ t_0_st_1 (t_0_st_0&);// { dg-message "note" }
+ t_0_st_1 ();
+};
+
+struct t_0_st_0 {
+ int member;
+
+ operator t_0_st_1 ();// { dg-message "note" }
+};
+
+t_0_st_0 t_0_st_0_obj0; // { dg-message "candidate" }
+
+void t_0_assignment ()
+{
+ t_0_st_1 t_0_st_1_obj0;
+ t_0_st_1 t_0_st_1_obj1;
+ t_0_st_1 t_0_st_1_obj2;
+
+ t_0_st_1_obj0 = t_0_st_0_obj0; // { dg-error "ambiguous" } caught
+ t_0_st_1_obj1 = t_0_st_1 (t_0_st_0_obj0);
+}
+
+void t_0_local_init ()
+{
+ t_0_st_1 t_0_st_1_obj0 = t_0_st_0_obj0; // { dg-error "ambiguous" }
+ t_0_st_1 t_0_st_1_obj1 = t_0_st_1 (t_0_st_0_obj0);
+}
+
+struct t_1_st_0;
+
+struct t_1_st_1 {
+ int member;
+
+ t_1_st_1 (t_1_st_0&); // { dg-message "note" }
+ t_1_st_1 ();
+ void operator= (t_1_st_1&); // { dg-message "operator=|no known conversion" }
+};
+
+struct t_1_st_0 {
+ int member;
+
+ operator t_1_st_1 (); // { dg-message "note" }
+};
+
+t_1_st_0 t_1_st_0_obj0; // { dg-message "candidate" }
+
+void t_1_assignment ()
+{
+ t_1_st_1 t_1_st_1_obj0;
+ t_1_st_1 t_1_st_1_obj1;
+ t_1_st_1 t_1_st_1_obj2;
+
+ t_1_st_1_obj0 = t_1_st_0_obj0; // { dg-error "no match" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 74 }
+ t_1_st_1_obj1 = t_1_st_1 (t_1_st_0_obj0); // { dg-error "no match" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 76 }
+}
+
+void t_1_local_init ()
+{
+ t_1_st_1 t_1_st_1_obj0 = t_1_st_0_obj0; // { dg-error "ambiguous" }
+ t_1_st_1 t_1_st_1_obj1 = t_1_st_1 (t_1_st_0_obj0);
+}
+
+struct t_2_st_0;
+
+struct t_2_st_1 { // { dg-message "initializing" }
+ int member;
+
+ t_2_st_1 (t_2_st_0); // { dg-message "note" }
+ t_2_st_1 ();
+};
+
+struct t_2_st_0 {
+ int member;
+
+ operator t_2_st_1 (); // { dg-message "note" }
+};
+
+t_2_st_0 t_2_st_0_obj0; // { dg-message "candidate" }
+
+void t_2_assignment ()
+{
+ t_2_st_1 t_2_st_1_obj0;
+ t_2_st_1 t_2_st_1_obj1;
+ t_2_st_1 t_2_st_1_obj2;
+
+ t_2_st_1_obj0 = t_2_st_0_obj0; // { dg-error "ambiguous" } caught
+ t_2_st_1_obj1 = t_2_st_1 (t_2_st_0_obj0);
+}
+
+void t_2_local_init ()
+{
+ t_2_st_1 t_2_st_1_obj0 = t_2_st_0_obj0; // { dg-error "ambiguous" }
+ t_2_st_1 t_2_st_1_obj1 = t_2_st_1 (t_2_st_0_obj0);
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_01.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_01.C
new file mode 100644
index 000000000..4d2651169
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_01.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900519_01
+
+// g++ fails to flag errors for some attempts to declare or define non-member
+// type conversion operators.
+
+// cfront 2.0 passes this test.
+
+// keywords: user-defined type conversion operator, non-member
+
+extern operator int (); // { dg-error "" }
+
+extern operator int () { // { dg-error "" }
+ return 0;
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_02.C
new file mode 100644
index 000000000..309d1ed72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_02.C
@@ -0,0 +1,33 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900519_02
+
+// The C++ Reference Manual says (in section 8.4.3) "A reference to a plain
+// T can only be initialized with a plain T" however g++ allows the
+// initialization of plain references with qualified objects in many cases.
+
+// keywords: references, initialization, type qualifiers
+
+extern const int cint_obj = 9;
+volatile int vint_obj = 9;
+
+void take_int_ref (int& arg) { } // { dg-message "" } referenced by errors below
+
+int& global_int_ref0 = cint_obj; // { dg-error "" }
+int& global_int_ref1 = vint_obj; // { dg-error "" }
+
+extern const int& cint_ref;
+extern volatile int& vint_ref;
+
+void test_0 ()
+{
+ int& local_int_ref0 = cint_obj; // { dg-error "" }
+ int& local_int_ref1 = vint_obj; // { dg-error "" }
+
+ take_int_ref (cint_obj); // { dg-error "" } caught
+ take_int_ref (vint_obj); // { dg-error "" }
+
+ take_int_ref (cint_ref); // { dg-error "" }
+ take_int_ref (vint_ref); // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_03.C
new file mode 100644
index 000000000..8f845f484
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_03.C
@@ -0,0 +1,48 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900519_03
+
+// The C++ Reference Manual says (in section 8.4.3) "A reference to a
+// volatile T can be initialized with a volatile T or a plain T but not a
+// const T. A reference to a const T can be initialized with a const T or
+// a plain T or something that can be converted into a plain T, but not a
+// volatile T."
+
+// g++ fails to disgnose such errors in most cases.
+
+// keywords: references, initialization, type qualifiers
+
+extern const int cint_obj;
+extern volatile int vint_obj;
+
+void take_cint_ref (const int& arg) { } // { dg-message "" }
+void take_vint_ref (volatile int& arg) { } // { dg-message "" }
+
+const int& global_cint_ref2 = vint_obj; // { dg-error "" }
+
+volatile int& global_vint_ref1 = cint_obj; // { dg-error "" }
+
+extern const int& extern_cint_ref;
+extern volatile int& extern_vint_ref;
+
+void test_0 ()
+{
+ const int& local_cint_ref2 = vint_obj; // { dg-error "" }
+
+ volatile int& local_vint_ref1 = cint_obj; // { dg-error "" }
+}
+
+void test_1 ()
+{
+ take_cint_ref (vint_obj); // { dg-error "" }
+
+ take_vint_ref (cint_obj); // { dg-error "" } caught
+}
+
+void test_2 ()
+{
+ take_cint_ref (extern_vint_ref); // { dg-error "" }
+
+ take_vint_ref (extern_cint_ref); // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_04.C
new file mode 100644
index 000000000..5074c5a4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_04.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900519_04
+
+// The following legal code causes g++ to segfault.
+
+// cfront 2.0 passes this test.
+
+// keywords: segfault, references, initialization
+
+int cint_obj = 9;
+
+void take_cint_ref (int& arg) { }
+
+int& cint_ref_0 = cint_obj;
+int& cint_ref_1 = cint_obj;
+
+void test_0 ()
+{
+ take_cint_ref (cint_ref_1); // causes segfault
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C
new file mode 100644
index 000000000..f7f7ef3a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900519_05
+
+// g++ fails to allow the use of function-reference types.
+
+// cfront 2.0 passes this test.
+
+// keywords: function types, reference types
+
+typedef void (func_type) (int, int);
+typedef func_type& func_ref_type;
+
+void function (int arg1, int arg2)
+{
+}
+
+func_type& global_func_ref1 = function;
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_06.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_06.C
new file mode 100644
index 000000000..601e4aab3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_06.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900519_06
+
+// g++ allows the type given in an invocation of operator new to be a
+// reference type.
+
+// Since pointers to reference types are illegal, the required return type
+// from such an invocation (of operator new) is illegal, and thus (it seems)
+// the entire call to new should be treated as being illegal.
+
+typedef int& int_ref;
+
+void test (int n)
+{
+ new int&; // { dg-error "" } missed
+ new int_ref; // { dg-error "" } missed
+ new int&[n]; // { dg-error "" } missed
+ new int_ref[n]; // { dg-error "" } missed
+ new int&[3]; // { dg-error "" } missed
+ new int_ref[3]; // { dg-error "" } missed
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_07.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_07.C
new file mode 100644
index 000000000..650147ef2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_07.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900519_07
+
+// It is illegal to specify or to use array-of-reference types, yet g++
+// allows them to be specified (in typedef statements and in declarations)
+// and to be used (in declarations).
+
+// keywords: reference types, array types
+
+int i;
+int j;
+
+typedef int& int_ref;
+typedef int_ref int_ref_array_type[2]; // { dg-error "" } missed
+
+int& int_ref_array_obj0[2] = { i, j }; // { dg-error "" } missed
+int_ref int_ref_array_obj1[2] = { i, j }; // { dg-error "" } missed
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_09.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_09.C
new file mode 100644
index 000000000..71c426334
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_09.C
@@ -0,0 +1,30 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900519_09
+
+// g++ allows the allocation of const objects via operator new even when
+// these uses of operator new do not include initializations.
+
+// This is inconsistant within the restrictions placed on the construction
+// of class, struct, and union types which have constant members.
+
+// Since there is no completely valid way of initializing such objects
+// after the invocation of new, these cases should all be illegal.
+
+// keywords: operator new, initialization, const qualifier
+
+struct struct_0 {
+ int member;
+};
+
+typedef const int const_int;
+typedef const struct struct_0 const_struct_0;
+
+void test ()
+{
+ new const int; // { dg-error "" }
+ new const_int; // { dg-error "" }
+ new const struct_0; // { dg-error "" }
+ new const_struct_0; // { dg-error "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_12.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_12.C
new file mode 100644
index 000000000..e08aba1af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_12.C
@@ -0,0 +1,12 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900519_12
+
+// The following erroneous code causes g++ to segfault.
+
+// cfront 2.0 passes this test.
+
+// keywords: segfault, typedef, pointer type, function type
+
+typedef eek void (*)(); // { dg-error "" }
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C
new file mode 100644
index 000000000..6b8260d41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C
@@ -0,0 +1,36 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900519_13
+
+// If multiple inheritance creates a situation in which a given name is
+// inherited from more than one base class, and if the inherited declarations
+// for the name are for different categories of members (e.g. object members,
+// function members, enumeral members), then g++ will (in some cases) fail
+// to flag errors when the ambiguous name is used.
+
+// cfront 2.0 passes this test.
+
+// keywords: inheritance, ambiguity resolution, members
+
+struct base_0 {
+ enum { base_member }; // { dg-message "" } candidate (26, 30)
+};
+
+struct base_1 {
+ int base_member; // { dg-message "" } candidate (26, 34)
+};
+
+struct base_2 {
+ int base_member (); // { dg-message "" } candidate (30, 34)
+};
+
+struct derived_0 : public base_0, public base_1 {
+ void member () { base_member; } // { dg-error "" }
+};
+
+struct derived_1 : public base_0, public base_2 {
+ void member () { base_member; } // { dg-error "" } missed
+};
+
+struct derived_2 : public base_1, public base_2 {
+ void member () { base_member; } // { dg-error "" } missed
+};
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_02.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_02.C
new file mode 100644
index 000000000..69e0440c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_02.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900520_02
+
+// keywords: reference types, initialization, parameter passing
+
+typedef int b_array[3];
+typedef int u_array[];
+
+typedef b_array &b_array_ref;
+typedef u_array &u_array_ref;
+
+void take_b_array_ref (b_array_ref arg) { } // { dg-message "" } passed to here
+
+extern u_array u_array_gbl_obj;
+
+u_array_ref u_array_ref_gbl_obj0 = u_array_gbl_obj;
+
+b_array_ref b_array_ref_gbl_obj0 = u_array_ref_gbl_obj0; // { dg-error "" } invalid declaration
+
+void test_passing ()
+{
+ take_b_array_ref (u_array_ref_gbl_obj0); // { dg-error "" } invalid call
+}
+
+b_array u_array_gbl_obj;
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_03.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_03.C
new file mode 100644
index 000000000..7978e386a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_03.C
@@ -0,0 +1,50 @@
+// { dg-do assemble }
+// g++ 1.37.1 bug 900520_03
+
+// The C++ Reference Manual says (in section 8.2.4):
+
+// When an identifier of array type appears in an expression, except
+// as the operand of sizeof or & or used to initialize a reference,
+// it is converted into a pointer to the first member of the array.
+
+// One must assume from the verbage, that when the name of a non-const array
+// object appears in one of the exempted contexts mentioned in this passage,
+// that it is *not* automatically converted into a pointer value, but rather
+// that it remains as an array type value, and that it may therefore also
+// still be an lvalue, and may be used to initialize references.
+
+// As the following code demonstrates, g++ does in fact treat the names
+// of non-const array objects as valid initializers for reference-to-array
+// type object in some (but not all) contexts.
+
+// The exception is that g++ does not allow names which designate objects
+// on incomplete array types to be used as actual parameters in function
+// calls where the corresponding formal parameter is of a reference-to-array
+// type.
+
+// g++ does however allow other similar sorts of initializations of non-formal
+// reference objects.
+
+// 5/16/94 (jason): The 1/25/94 WP explicitly states in section 8.3.5 that
+// parameter types may not contain pointers or references to arrays of unknown
+// bound. g++ is correct.
+
+// keywords: reference types, array types, initialization, parameter passing
+
+typedef int u_array[];
+typedef u_array &u_array_ref;
+
+void take_u_array_ref (u_array_ref arg) { } // { dg-error "" } reference to array of unknown bound in parmtype
+
+extern u_array u_array_gbl_obj;
+u_array_ref u_array_ref_gbl_obj0 = u_array_gbl_obj; // OK
+
+void test_local_initialization ()
+{
+ u_array_ref u_array_ref_lcl_obj0 = u_array_gbl_obj; // OK
+}
+
+void test_passing ()
+{
+ take_u_array_ref (u_array_gbl_obj);
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_04.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_04.C
new file mode 100644
index 000000000..4fce93637
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_04.C
@@ -0,0 +1,41 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900520_04
+
+// g++ does not yet support the initialization of scalar type objects
+// (including built-in arithmetic types, enum types, and pointer types)
+// via constructor initialization syntax except within a call to operator
+// new.
+
+// keywords: unimplemented, syntax, initialization, scalar types
+
+enum e_type { e_value };
+
+typedef char *charp;
+
+charp cp;
+
+int global_i (1); // { dg-bogus "" }
+double global_d (9.9); // { dg-bogus "" }
+charp global_cp0 (cp); // { dg-bogus "" }
+charp global_cp1 (0); // { dg-bogus "" }
+enum e_type global_e (e_value); // { dg-bogus "" }
+
+void func0 ()
+{
+ int local_i (1); // { dg-bogus "" }
+ double local_d (9.9); // { dg-bogus "" }
+ charp local_cp0 (cp); // { dg-bogus "" }
+ charp local_cp1 (0); // { dg-bogus "" }
+ enum e_type local_e (e_value); // { dg-bogus "" }
+}
+
+void func1 ()
+{
+ int* ip = new int (1); // { dg-bogus "" }
+ double* dp = new double (9.9); // { dg-bogus "" }
+ charp* cpp0 = new charp (cp); // { dg-bogus "" }
+ charp* cpp1 = new charp (0); // { dg-bogus "" }
+ enum e_type* ep = new e_type (e_value); // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_05.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_05.C
new file mode 100644
index 000000000..294feee75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_05.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900520_05
+
+// The following legal code gets syntax errors from g++.
+
+// keywords: syntax, unimplemented, operator new, initialization, pointer types
+
+struct struct_0 {
+};
+
+char *cp;
+static struct_0 *sp;
+
+void test0 ()
+{
+ new char * (cp); // { dg-bogus "" }
+}
+
+void test1 ()
+{
+ new struct_0 * (sp); // { dg-bogus "" }
+}
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_06.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_06.C
new file mode 100644
index 000000000..e11123193
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900520_06.C
@@ -0,0 +1,79 @@
+// { dg-do run }
+// g++ 1.37.1 bug 900520_06
+
+// When an object of a class type is passed into a formal parameter of the
+// same class type (in a function call) the language definition calls for
+// this action to be treated like any other form of an initialization of
+// an object of the given class type.
+
+// g++ fails however to invoke the (compiler-supplied) copy constructor for
+// the class type when a parameter of the class type is passed as an
+// actual parameter.
+
+// This causes the following program to exit with a nonzero exit status.
+
+// cfront 2.0 passes this test.
+
+int base_copy_ctor_called = 0;
+int member_copy_ctor_called = 0;
+
+struct struct_0 {
+ struct_0 ();
+ struct_0 (const struct_0&);
+};
+
+struct_0::struct_0 ()
+{
+}
+
+struct_0::struct_0 (const struct_0&)
+{
+ base_copy_ctor_called++;
+}
+
+struct struct_1 {
+ struct_1 ();
+ struct_1 (const struct_1&);
+};
+
+struct_1::struct_1 ()
+{
+}
+
+struct_1::struct_1 (const struct_1&)
+{
+ member_copy_ctor_called++;
+}
+
+struct struct_2 : public struct_0 {
+ struct_2 ();
+ struct_1 struct_1_member;
+#ifdef MAKE_COPY_CONSTRUCTOR_EXPLICIT
+ struct_2 (const struct_2&);
+#endif
+};
+
+struct_2::struct_2 ()
+{
+}
+
+#ifdef MAKE_COPY_CONSTRUCTOR_EXPLICIT
+struct_2::struct_2 (const struct_2& arg) :
+ struct_0 ((struct_0&)arg),
+ struct_1_member (arg.struct_1_member)
+{
+}
+#endif
+
+void take_struct_2 (struct_2 arg)
+{
+}
+
+int test ()
+{
+ struct_2 struct_2_object0;
+ take_struct_2 (struct_2_object0);
+ return (base_copy_ctor_called != 1 || member_copy_ctor_called != 1);
+}
+
+int main () { return test (); }