// * cp-cvt.c (build_default_binary_type_conversion): Look deeper into
// what ARG1 and ARG2 are if they're POINTER_TYPEs.
-volatile void exit(int);
-
class CountableSet
{
public:
SimpleSet()
{
size = 0;
- array = ((void*)0) ; // ERROR - implicit conversion
+ array = 0;
}
int Get(int p, T& t)
{
--- /dev/null
+// Test that an object-dependent reference to a member function can be
+// used to produce a pointer to member function, as in VC++.
+// Contributed by Jason Merrill <jason@cygnus.com>
+// Special g++ Options: -fpermissive -w
+
+struct A
+{
+ int f(int a) { }
+ void f(int a, int b) { }
+};
+
+typedef int (A::* pmf1)(int);
+typedef void (A::* pmf2)(int, int);
+
+int main()
+{
+ A a;
+ pmf1 fn1;
+ pmf2 fn2;
+
+ fn1 = a.f;
+ fn1 = (pmf1)a.f;
+ fn2 = (pmf2)a.f;
+};
// Build don't link:
-inline void strlen (const char *) { }
+static inline void strlen (const char *) { }
void f ()
{
// support, because it doesn't support variadic functions.
// Special g++ Options: -fvtable-thunks
-// excess errors test - XFAIL mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3 mn10300-*-* mn10200-*-* v850-*-* sh-*-*-*
+// excess errors test - XFAIL mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3 mn10300-*-* mn10200-*-* v850-*-* sh-*-*
#include <stdarg.h>
+++ /dev/null
-// Testcase for use of template parms as types for other template parms.
-
-template <class T, T t>
-class A {
- T a;
-public:
- A(): a(t) {}
-
- operator T () { return a; }
-};
-
-template <class S, S s>
-class B {
- A<S,s> a;
-public:
- B(A<S,s>& b): a(b) {}
-
- operator S () { return a*20; }
-};
-
-main()
-{
- A<int, 5> a;
- B<int, 5> b(a);
-
- if (b * a == 500)
- return 0;
- else
- return 1;
-}
// Build don't link:
// Special g++ Options:
-volatile void abort();
+volatile void abort(); // WARNING - mismatch
volatile void oink() {
abort() ;
} // gets bogus error -
// the type of the argument -- but because it is non-const.
struct A {
- operator const char *() const;
+ operator const char *() const { return ""; }
};
struct B : public A {
int main()
{
B b;
- (const char *)b; // WARNING - surprising overload resolution
+ if ((const char *)b != 0) // WARNING - surprising overload resolution
+ return 1;
+ if ((const char *)(const B)b == 0)
+ return 2;
+ if ((const char *)(const B &)b == 0)
+ return 3;
}
--- /dev/null
+// Testcase for use of template parms as types for other template parms.
+
+template <class T, T t>
+class A {
+ T a;
+public:
+ A(): a(t) {}
+
+ operator T () { return a; }
+};
+
+template <class S, S s>
+class B {
+ A<S,s> a;
+public:
+ B(A<S,s>& b): a(b) {}
+
+ operator S () { return a*20; }
+};
+
+int
+main()
+{
+ A<int, 5> a;
+ B<int, 5> b(a);
+
+ if (b * a == 500)
+ return 0;
+ else
+ return 1;
+}
// On targets that don't support weak symbols, we require an explicit
// instantiation of arr.
-// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux*
+// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* alpha-dec-osf*
template<class T>
struct A {