FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / arg7.C
blob620be2637708b2cd9cae15e7e245a557bc5c7d5b
1 // GROUPS passed arg-matching
2 // arg-matching file
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
8 #include <stdio.h>
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; }
15 // and the call
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).
25 int main(int, char**)
27     unsigned long pixmap = 0;
28     unsigned int x = 0;
29     unsigned int y = 0;
31     return ovf(pixmap, x, y);