Front-end: Add missing rule for function-return implicit type conversion check.
Basic (component) type conversion was done, but checking that the composite was correct was not being done. Fixes issue #353.
This commit is contained in:
parent
b10feabc95
commit
bc17b0a96a
3 changed files with 23 additions and 2 deletions
|
|
@ -1208,6 +1208,8 @@ TIntermNode* TParseContext::handleReturnValue(const TSourceLoc& loc, TIntermType
|
|||
} else if (*currentFunctionType != value->getType()) {
|
||||
TIntermTyped* converted = intermediate.addConversion(EOpReturn, *currentFunctionType, value);
|
||||
if (converted) {
|
||||
if (*currentFunctionType != converted->getType())
|
||||
error(loc, "cannot convert return value to function return type", "return", "");
|
||||
if (version < 420)
|
||||
warn(loc, "type conversion on return values was not explicitly allowed until version 420", "return", "");
|
||||
return intermediate.addBranch(EOpReturn, converted, loc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue