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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bugs/] [900324_06.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// g++ 1.37.1 bug 900324_06
3
 
4
// g++ is unable to use context information (i.e. the required type of the
5
// expression) to disambiguate a possibly overloaded function name when that
6
// name is used as either the second or the third operand of a ?: operator.
7
 
8
// It is also unable to use the fact that the given name is not in fact
9
// overloaded (and has only one possible interpretation).
10
 
11
// This results in improper errors being generated.
12
 
13
// keywords: overloading, function pointers, disambiguation, operator?:
14
 
15
int i;
16
void (*p)();
17
 
18
void function_0 ()
19
{
20
}
21
 
22
void function_1 ()
23
{
24
  p = i ? function_0 : 0;               // { dg-bogus "" }
25
  p = i ? 0 : function_0;               // { dg-bogus "" }
26
  p = i ? function_1 : function_0;      // { dg-bogus "" }
27
}
28
 
29
int main () { return 0; }

powered by: WebSVN 2.1.0

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