2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / arg7.C
bloba3ccab92b7cfdde5006d0dc18da622e467dc5b64
1 // { dg-do run  }
2 // GROUPS passed arg-matching
3 // arg-matching file
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
9 #include <stdio.h>
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; }
16 // and the call
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).
26 int main(int, char**)
28     unsigned long pixmap = 0;
29     unsigned int x = 0;
30     unsigned int y = 0;
32     return ovf(pixmap, x, y);