OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [arg7.C] - Blame information for rev 779

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// GROUPS passed arg-matching
3
// arg-matching file
4
// Message-Id: <9305041759.AA04913@malachite.bbn.com>
5
// From: Dan Franklin 
6
// Subject: overloaded function resolved incorrectly
7
// Date: Tue, 4 May 93 13:59:18 EDT
8
 
9
#include 
10
 
11
// Given the following overloaded function definitions
12
 
13
int ovf(unsigned long, short,         short) { printf ("PASS\n"); return 0; }
14
int ovf(          int, short, unsigned long) { printf ("FAIL\n"); return 1; }
15
 
16
// and the call
17
//
18
//   ovf(unsigned long, unsigned int, unsigned int)
19
//
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).
25
 
26
int main(int, char**)
27
{
28
    unsigned long pixmap = 0;
29
    unsigned int x = 0;
30
    unsigned int y = 0;
31
 
32
    return ovf(pixmap, x, y);
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.