annotate gcc/testsuite/g++.old-deja/g++.bugs/900208_03.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 assemble }
kono
parents:
diff changeset
2 // g++ 1.36.1 bug 900208_03
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 // The Cfront 2.0 reference manual (5.3.3) says "This type must be an
kono
parents:
diff changeset
5 // object type; functions cannot be allocated this way...".
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 // g++ fails to detect (at compile time) cases where an attempt is made to
kono
parents:
diff changeset
8 // allocate a function using new.
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 // keywords: operator new, function types
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 typedef void (func_type) ();
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 void global_function_0 ()
kono
parents:
diff changeset
15 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
16 new func_type; // { dg-error "3:new cannot be applied to a function type" } missed by both cfront 2.0 and g++ 1.36.1
111
kono
parents:
diff changeset
17 }
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 int main () { return 0; }