Resolve issue #700: allow initializers on struct members.
This commit is contained in:
parent
32fd5d26e3
commit
18adbdbbb8
4 changed files with 35 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue