1// GROUPS passed overloading 2// Check that calls to the correct overloaded virtual 3// functions are generated even where the type of the formal 4// arguments for the overloadings are similar or related. 5 6extern "C" int printf (const char *, ...); 7 8int proper_method_called = 0; 9 10struct base { 11 int member; 12 virtual void method (char) 13 { 14 } 15 virtual void method (char *) 16 { 17 } 18}; 19 20struct derived : public base { 21 int member; 22 virtual void method (char) 23 { 24 } 25 virtual void method (char *) 26 { 27 proper_method_called++; 28 } 29}; 30 31char *message; 32 33int main () 34{ 35 derived derived_object; 36 37 derived_object.method (message); 38 39 if (proper_method_called != 1) 40 { printf ("FAIL\n"); return 1; } 41 else 42 printf ("PASS\n"); 43} 44