mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-15 20:01:22 +00:00
Validator: Change the error message for v-0031
It previously said: "a struct containing a runtime-sized array must be in the 'storage' storage class" This had be looking at the variable's storage class, when the error was actually trying to tell me I needed `[[block]]` on the struct declaration. Change-Id: I7a23a0c0c35508bdac20c808d2635592638dfa77 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/40602 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This commit is contained in:
parent
a51aa1f805
commit
4c51d97a5c
@ -318,9 +318,9 @@ bool ValidatorImpl::ValidateConstructedTypes(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!st->IsBlockDecorated()) {
|
if (!st->IsBlockDecorated()) {
|
||||||
add_error(member->source(), "v-0031",
|
add_error(member->source(), "v-0015",
|
||||||
"a struct containing a runtime-sized array "
|
"a struct containing a runtime-sized array "
|
||||||
"must be in the 'storage' storage class: '" +
|
"requires the [[block]] attribute: '" +
|
||||||
program_->Symbols().NameFor(st->symbol()) + "'");
|
program_->Symbols().NameFor(st->symbol()) + "'");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,8 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsLastNoBlock_Fail) {
|
|||||||
|
|
||||||
EXPECT_FALSE(v.ValidateConstructedTypes(program->AST().ConstructedTypes()));
|
EXPECT_FALSE(v.ValidateConstructedTypes(program->AST().ConstructedTypes()));
|
||||||
EXPECT_EQ(v.error(),
|
EXPECT_EQ(v.error(),
|
||||||
"v-0031: a struct containing a runtime-sized array must be "
|
"v-0015: a struct containing a runtime-sized array requires the "
|
||||||
"in the 'storage' storage class: 'Foo'");
|
"[[block]] attribute: 'Foo'");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ValidatorTypeTest, RuntimeArrayIsNotLast_Fail) {
|
TEST_F(ValidatorTypeTest, RuntimeArrayIsNotLast_Fail) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user