Add test for void type in struct.

Mysteriously, I had written a test which put arrays of void inside a
struct, but had neglected to include the non-array case. It causes an
okay-not-great error (referring to void as an "opaque type").

Change-Id: Id20a9d3512d29aecea81d46877dce708b7b2f973
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472450
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2021-11-17 09:57:11 -05:00 committed by SkCQ
parent a726978ae7
commit 504d57e9bd
4 changed files with 12 additions and 10 deletions

View File

@ -13,7 +13,6 @@ sksl_error_tests = [
"/sksl/errors/ArrayNegation.sksl",
"/sksl/errors/ArrayOfInvalidSize.sksl",
"/sksl/errors/ArrayOfVoid.sksl",
"/sksl/errors/ArrayOfVoidInStruct.sksl",
"/sksl/errors/ArrayPlus.sksl",
"/sksl/errors/ArrayReturnTypes.sksl",
"/sksl/errors/ArraySplitDimensions.sksl",
@ -221,6 +220,7 @@ sksl_error_tests = [
"/sksl/errors/VectorInlinedIndexOutOfRange.sksl",
"/sksl/errors/VectorSlice.sksl",
"/sksl/errors/VertexEarlyReturn.vert",
"/sksl/errors/VoidInStruct.sksl",
"/sksl/errors/VoidVariable.sksl",
"/sksl/errors/WhileTypeMismatch.sksl",
]

View File

@ -1,7 +0,0 @@
// Expect 3 errors
struct S {
void a[2];
void[2] b;
void[2] c[2];
};

View File

@ -0,0 +1,8 @@
// Expect 4 errors
struct S {
void a;
void b[2];
void[2] c;
void[2] d[2];
};

View File

@ -1,6 +1,7 @@
### Compilation failed:
error: 4: type 'void' may not be used in an array
error: 5: type 'void' may not be used in an array
error: 6: type 'void' may not be used in an array
3 errors
error: 7: type 'void' may not be used in an array
error: 4: opaque type 'void' is not permitted in a struct
4 errors