new
authorJason Merrill <jason@gcc.gnu.org>
Thu, 4 Jun 1998 11:16:03 +0000 (07:16 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 4 Jun 1998 11:16:03 +0000 (07:16 -0400)
From-SVN: r20226

gcc/testsuite/g++.old-deja/g++.ns/koenig2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/koenig3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/using3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/new2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/static3.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.old-deja/g++.ns/koenig2.C b/gcc/testsuite/g++.old-deja/g++.ns/koenig2.C
new file mode 100644 (file)
index 0000000..c9df60c
--- /dev/null
@@ -0,0 +1,9 @@
+//Build don't link:
+//Check association of {error} for Koenig lookup
+class QString { };
+int foo()
+{
+       QString bar;
+       if (bar == __null ) {
+    }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/koenig3.C b/gcc/testsuite/g++.old-deja/g++.ns/koenig3.C
new file mode 100644 (file)
index 0000000..e039df6
--- /dev/null
@@ -0,0 +1,21 @@
+//Check association of member pointer in overload resolution.
+struct A {
+       int m_val;
+       friend int operator ->* (A & other, int A::*pm)
+               { return 31; }
+};
+
+int A::*pi = & A::m_val;
+
+int
+main(void)
+{
+       A c;
+       c.m_val = 42;
+       int j = c ->* pi;
+
+       if (j == 31)
+               return 0;
+       else
+               return 1;
+}      
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/using3.C b/gcc/testsuite/g++.old-deja/g++.ns/using3.C
new file mode 100644 (file)
index 0000000..e179f31
--- /dev/null
@@ -0,0 +1,14 @@
+typedef        unsigned int atypedef;
+struct astruct{};
+void afunction();
+void aovlfunction();
+void aovlfunction(int);
+int avariable;
+
+namespace foo {
+  using ::atypedef;
+  using ::astruct;
+  using ::afunction;
+  using ::aovlfunction;
+  using ::avariable;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new2.C b/gcc/testsuite/g++.old-deja/g++.other/new2.C
new file mode 100644 (file)
index 0000000..6861c4d
--- /dev/null
@@ -0,0 +1,22 @@
+//Build don't link:
+typedef unsigned int size_t;
+void *operator new(size_t, unsigned int);
+
+struct X{
+  X();
+  X(int);
+};
+
+
+void f(X *x = new X);          // ERROR -
+
+void f(X *x = new X(4));       // ERROR -
+
+void f(X *x = new X[4]);       // ERROR -
+
+void f(X *x = new (3) X(6));   // ERROR -
+
+void f(X *x = new (2) X[10]);  // ERROR -
+
+void f(X *x = new X[10][5]);   // ERROR -
+
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static3.C b/gcc/testsuite/g++.old-deja/g++.pt/static3.C
new file mode 100644 (file)
index 0000000..b3040ac
--- /dev/null
@@ -0,0 +1,12 @@
+template<class T>
+struct A {
+  static T arr[5];
+};
+
+template <class T>
+T A<T>::arr[5] = { 0, 1, 2, 3, 4 };
+
+main ()
+{
+  return A<int>::arr[0];
+}