2 // GROUPS passed arg-matching
4 // Message-Id: <9305041759.AA04913@malachite.bbn.com>
5 // From: Dan Franklin <dan@diamond.bbn.com>
6 // Subject: overloaded function resolved incorrectly
7 // Date: Tue, 4 May 93 13:59:18 EDT
11 // Given the following overloaded function definitions
13 int ovf(unsigned long, short, short) { printf ("PASS\n"); return 0; }
14 int ovf( int, short, unsigned long) { printf ("FAIL\n"); return 1; }
18 // ovf(unsigned long, unsigned int, unsigned int)
20 // it seems to me (and to cfront) that this should resolve to ovf #1 above,
21 // but g++ resolves it to ovf #2. Resolving to ovf #1 requires two conversions
22 // (unsigned int => short) while resolving to ovf #2 takes two conversions
23 // (unsigned long => int, unsigned int => short) and a promotion
24 // (unsigned int => unsigned long).
28 unsigned long pixmap = 0;
32 return ovf(pixmap, x, y);