mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Allow $defined take declarations: $defined(int x = y)
Taking the address of a label would cause a crash. #2430
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
fn int main(String[] args)
|
||||
{
|
||||
$defined(int a = 3.0);
|
||||
$defined(int[*] b); // #error: Inferred array types can only be used in declarations
|
||||
}
|
||||
10
test/test_suite/statements/label_addr.c3
Normal file
10
test/test_suite/statements/label_addr.c3
Normal file
@@ -0,0 +1,10 @@
|
||||
import std;
|
||||
fn int main(String[] args)
|
||||
{
|
||||
switch FOO: (1)
|
||||
{
|
||||
case 1:
|
||||
io::printfn("%p", &FOO); // #error: It is not possible to take the address of a label
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user