diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-08-18 09:31:48 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-08-18 09:31:48 +0000 |
commit | 8e4f1b30f495927c863d3d08052e3c93a7d7a7d1 (patch) | |
tree | 84d12f3976ca34878e4de907750ec17917f81a3b /gcc | |
parent | 19420d00dce75db81a29e665a427808ef16d114b (diff) | |
download | gcc-8e4f1b30f495927c863d3d08052e3c93a7d7a7d1.zip gcc-8e4f1b30f495927c863d3d08052e3c93a7d7a7d1.tar.gz gcc-8e4f1b30f495927c863d3d08052e3c93a7d7a7d1.tar.bz2 |
13478.C: Mark candidate.
* g++.old-deja/g++.benjamin/13478.C: Mark candidate.
* g++.old-deja/g++.mike/net36.C: Mark candidate.
* g++.old-deja/g++.robertl/eb131.C: Mark candidate.
* g++.old-deja/g++.oliva/overload1.C: Remove XFAIL.
* g++.old-deja/g++.other/ptrmem7.C: New test.
* g++.old-deja/g++.pt/ptrmem10.C: New test.
From-SVN: r35778
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.benjamin/13478.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.mike/net36.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.oliva/overload1.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C | 46 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C | 29 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.robertl/eb131.C | 2 |
7 files changed, 88 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8465331..34d1f05 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,14 @@ 2000-08-18 Nathan Sidwell <nathan@codesourcery.com> + * g++.old-deja/g++.benjamin/13478.C: Mark candidate. + * g++.old-deja/g++.mike/net36.C: Mark candidate. + * g++.old-deja/g++.robertl/eb131.C: Mark candidate. + * g++.old-deja/g++.oliva/overload1.C: Remove XFAIL. + * g++.old-deja/g++.other/ptrmem7.C: New test. + * g++.old-deja/g++.pt/ptrmem10.C: New test. + +2000-08-18 Nathan Sidwell <nathan@codesourcery.com> + * g++.old-deja/g++.pt/typename27.C: New test. 2000-08-17 Nathan Sidwell <nathan@codesourcery.com> diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/13478.C b/gcc/testsuite/g++.old-deja/g++.benjamin/13478.C index 97256ed..c4dba9c 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/13478.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/13478.C @@ -19,7 +19,7 @@ protected: static const hand_table table_1[]; static const AData table_2; private: - void foo (void); + void foo (void); // ERROR - candidate }; const hand_table Agent::table_1[] = diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net36.C b/gcc/testsuite/g++.old-deja/g++.mike/net36.C index 843c314..21c3a1e 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/net36.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/net36.C @@ -11,7 +11,7 @@ typedef void (A::*handler) (X*); class B { public: - void setHandler(handler); + void setHandler(handler); // ERROR - candidate }; void f(B* b) { diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C b/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C index fd79dad..ed8993a 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C @@ -12,7 +12,7 @@ struct foo { /* gcc emits a hard error without -pedantic, and a warning with -pedantic, even in bad1. */ -int (*ok1)() = foo::bar; // gets bogus error - XFAIL *-*-* +int (*ok1)() = foo::bar; void (foo::*bad1)(int) = foo::bar; // ERROR - missing & int (*ok2)() = &foo::bar; // ok diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C new file mode 100644 index 0000000..188af76 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C @@ -0,0 +1,46 @@ +// Build don't link: +// +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 14 Aug 2000 <nathan@codesourcery.com> + +// A pointer to member can only be formed by `&T::m', however, other forms +// are ok for pointer to static member. Thus the error can only be determined +// after overload resolution. + +struct A +{ + static int ns (short); + static int ns (float); + int ns (int); + int ns (double); + int single (int); + static int sole (short); + void foo (); +}; +void A::foo () +{ + int (A::*ptr1) (int) = &A::ns; + int (A::*ptr2) (int) = A::ns; // ERROR - not ptr mem + int (A::*ptr3) (int) = &ns; // ERROR - not ptr mem + int (A::*ptr4) (int) = ns; // ERROR - not ptr mem + + int (*ptr5) (short) = &A::ns; + int (*ptr6) (short) = A::ns; + int (*ptr7) (short) = &ns; + int (*ptr8) (short) = ns; + + int (A::*ptr11) (int) = &A::single; + int (A::*ptr12) (int) = A::single; // ERROR - not ptr mem + int (A::*ptr13) (int) = &single; // ERROR - not ptr mem + int (A::*ptr14) (int) = single; // ERROR - not ptr mem + + int (A::*ptr20) (int) = &(A::ns); // ERROR - not ptr mem + int (A::*ptr21) (int) = &(A::single); // ERROR - not ptr mem + + int (*ptr31) (short) = &A::sole; + int (*ptr32) (short) = A::sole; + int (*ptr33) (short) = &sole; + int (*ptr34) (short) = sole; + int (*ptr41) (short) = &(A::sole); + int (*ptr43) (short) = &(sole); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C new file mode 100644 index 0000000..0e7a6d7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C @@ -0,0 +1,29 @@ +// Build don't link: +// +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 14 Aug 2000 <nathan@codesourcery.com> + +// A pointer to member can only be formed by `&T::m', however, other forms +// are ok for pointer to static member. Thus the error can only be determined +// after overload resolution. In template deduction, this can disambiguate +// otherwise ambiguous cases. + +struct A +{ + static int f (int); + int f (short); + void baz (); +}; + +template <typename T> void foo (int (*)(T)); // ERROR - candidate +template <typename T> void foo (int (A::*)(T)); // ERROR - candidate + + +void A::baz () +{ + foo (&A::f); // ERROR - ambiguous + foo (A::f); + foo (&(A::f)); + foo (f); + foo (&f); +} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C index 1768dd0..34ee0af 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C @@ -10,7 +10,7 @@ struct a { void bar( double ); void bar( float ); - void foo( void (a::*member)(float) ); + void foo( void (a::*member)(float) ); // ERROR - candidate }; a::a() |