FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / net26.C
blobed43df8e997066ef9a09226d6329158ff7dd6c92
1 // A test case found by InterViews testing...
3 extern "C" int printf(const char *, ...);
5 class A {
6 public:
7         int foo() { printf("ok nv\n"); return 0; }
8         virtual int vfoo() { printf("ok v\n"); return 0; }
9 };
11 struct S {
12         int (A::*pfn1)();
13         int (A::*pfn2)();
14         int (A::*pfn3)();
17 // This failed before.
18 S s = { &A::foo, &A::vfoo, &A::foo };
20 A a;
22 int main() {
23   (a.*s.pfn1)();
24   (a.*s.pfn2)();
25   printf("PASS\n");
26   return 0;