HLSL: Handle const with no initializer. Fixes issue #651.

This commit is contained in:
John Kessenich 2016-12-30 16:42:57 -07:00
parent 53864846a9
commit aa6d56298d
5 changed files with 50 additions and 3 deletions

View file

@ -3255,7 +3255,7 @@ bool TParseContext::lineDirectiveShouldSetNextLine() const
void TParseContext::nonInitConstCheck(const TSourceLoc& loc, TString& identifier, TType& type)
{
//
// Make the qualifier make sense, given that there is an initializer.
// Make the qualifier make sense, given that there is not an initializer.
//
if (type.getQualifier().storage == EvqConst ||
type.getQualifier().storage == EvqConstReadOnly) {
@ -5007,7 +5007,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
if (voidErrorCheck(loc, identifier, type.getBasicType()))
return nullptr;
if (initializer)
if (initializer)
rValueErrorCheck(loc, "initializer", initializer);
else
nonInitConstCheck(loc, identifier, type);