annotate gcc/testsuite/g++.old-deja/g++.bugs/900324_06.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do run }
kono
parents:
diff changeset
2 // g++ 1.37.1 bug 900324_06
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 // g++ is unable to use context information (i.e. the required type of the
kono
parents:
diff changeset
5 // expression) to disambiguate a possibly overloaded function name when that
kono
parents:
diff changeset
6 // name is used as either the second or the third operand of a ?: operator.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 // It is also unable to use the fact that the given name is not in fact
kono
parents:
diff changeset
9 // overloaded (and has only one possible interpretation).
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 // This results in improper errors being generated.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 // keywords: overloading, function pointers, disambiguation, operator?:
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 int i;
kono
parents:
diff changeset
16 void (*p)();
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 void function_0 ()
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 void function_1 ()
kono
parents:
diff changeset
23 {
kono
parents:
diff changeset
24 p = i ? function_0 : 0; // { dg-bogus "" }
kono
parents:
diff changeset
25 p = i ? 0 : function_0; // { dg-bogus "" }
kono
parents:
diff changeset
26 p = i ? function_1 : function_0; // { dg-bogus "" }
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 int main () { return 0; }