Resolve issue #700: allow initializers on struct members.

This commit is contained in:
John Kessenich
2017-02-02 15:16:20 -07:00
parent 32fd5d26e3
commit 18adbdbbb8
4 changed files with 35 additions and 2 deletions

View File

@@ -1758,6 +1758,16 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
acceptPostDecls(member.type->getQualifier());
// EQUAL assignment_expression
if (acceptTokenClass(EHTokAssign)) {
parseContext.warn(idToken.loc, "struct-member initializers ignored", "typedef", "");
TIntermTyped* expressionNode = nullptr;
if (! acceptAssignmentExpression(expressionNode)) {
expected("initializer");
return false;
}
}
// success on seeing the SEMICOLON coming up
if (peekTokenClass(EHTokSemicolon))
break;