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