Skip to content

Commit fd5b254

Browse files
committed
Update tests
1 parent 8c36d42 commit fd5b254

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

source/compiler/tests/class_specifiers_p2.meta

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
class_specifiers_p2.pwn(4) : error 042: invalid combination of class specifiers
55
class_specifiers_p2.pwn(7) : error 042: invalid combination of class specifiers
66
class_specifiers_p2.pwn(11) : error 010: invalid function or declaration
7+
class_specifiers_p2.pwn(16) : error 025: function heading differs from prototype
8+
class_specifiers_p2.pwn(25) : error 025: function heading differs from prototype
79
"""
810
}

source/compiler/tests/class_specifiers_p2.pwn

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,19 @@ static @var2 = 0; // error 042: invalid combination of class specifiers
1111
forward Tag:[2] static stock Func(); // error 010: invalid function or declaration
1212
forward static stock Tag:[2] Func2(); // OK
1313

14+
forward Func3();
15+
public Func3(); // class specifier "public" is introduced; it will be required in the definition
16+
Func3(){} // error 025: function heading differs from prototype
17+
18+
static Func4(); // class specifier "static" is introduced
19+
forward Func4(); // OK (class specifiers are only mandatory in function definitions, not declarations)
20+
static Func4(){} // OK (class specifier "static" is in place)
21+
22+
static Func5(){} // Func5() is "finalized"; subsequent forward declarations
23+
// for this function can't introduce any new class specifiers
24+
forward static Func5(); // OK (no new class specifiers)
25+
forward static stock Func5(); // error 025: function heading differs from prototype
26+
27+
#pragma unused Func4, Func5
28+
1429
main(){}

0 commit comments

Comments
 (0)