Add support for forward declarations of structures.
Now a declaration like 'struct Foo;' can be used to establish the name of a struct type, without providing a definition. One can pass pointers to such types around the system, but can't do much else with them (as in C/C++). Issue #125.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Dereference operator "->" can't be applied to non-pointer type "varying struct Foo"
|
||||
// Member operator "->" can't be applied to non-pointer type "varying struct Foo"
|
||||
|
||||
struct Foo { int x; };
|
||||
|
||||
|
||||
5
tests_errors/struct-ref-undecl-1.ispc
Normal file
5
tests_errors/struct-ref-undecl-1.ispc
Normal file
@@ -0,0 +1,5 @@
|
||||
// Member operator "." can't be applied to declared but not defined struct type
|
||||
|
||||
struct Foo;
|
||||
|
||||
int bar(Foo & foo) { return foo.x; }
|
||||
5
tests_errors/struct-ref-undecl-2.ispc
Normal file
5
tests_errors/struct-ref-undecl-2.ispc
Normal file
@@ -0,0 +1,5 @@
|
||||
// Member operator "->" can't be applied to declared but not defined struct type
|
||||
|
||||
struct Foo;
|
||||
|
||||
int bar(Foo * uniform foo) { return foo->x; }
|
||||
Reference in New Issue
Block a user