--- /dev/null
+struct.error.frag
+ERROR: 0:12: 'z' : no such field in structure
+ERROR: 1 compilation errors. No code generated.
+
+
+Shader version: 460
+ERROR: node is still EOpNull!
+0:7 Function Definition: test( ( global structure{ global float x})
+0:7 Function Parameters:
+0:8 Sequence
+0:8 Branch: Return with expression
+0:8 Constant:
+0:8 1.000000
+0:11 Function Definition: main( ( global void)
+0:11 Function Parameters:
+0:12 Sequence
+0:12 Function Call: test( ( global structure{ global float x})
+0:? Linker Objects
+
+
+Linked fragment stage:
+
+
+Shader version: 460
+ERROR: node is still EOpNull!
+0:7 Function Definition: test( ( global structure{ global float x})
+0:7 Function Parameters:
+0:8 Sequence
+0:8 Branch: Return with expression
+0:8 Constant:
+0:8 1.000000
+0:11 Function Definition: main( ( global void)
+0:11 Function Parameters:
+0:12 Sequence
+0:12 Function Call: test( ( global structure{ global float x})
+0:? Linker Objects
+
inheritMemoryQualifiers(base->getQualifier(), result->getWritableType().getQualifier());
} else {
auto baseSymbol = base;
- while (baseSymbol->getAsSymbolNode() == nullptr)
- baseSymbol = baseSymbol->getAsBinaryNode()->getLeft();
- TString structName;
- structName.append("\'").append(baseSymbol->getAsSymbolNode()->getName().c_str()).append( "\'");
- error(loc, "no such field in structure", field.c_str(), structName.c_str());
+ while (baseSymbol->getAsSymbolNode() == nullptr) {
+ auto binaryNode = baseSymbol->getAsBinaryNode();
+ if (binaryNode == nullptr) break;
+ baseSymbol = binaryNode->getLeft();
+ }
+ if (baseSymbol->getAsSymbolNode() != nullptr) {
+ TString structName;
+ structName.append("\'").append(baseSymbol->getAsSymbolNode()->getName().c_str()).append("\'");
+ error(loc, "no such field in structure", field.c_str(), structName.c_str());
+ } else {
+ error(loc, "no such field in structure", field.c_str(), "");
+ }
}
} else
- error(loc, "does not apply to this type:", field.c_str(), base->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str());
+ error(loc, "does not apply to this type:", field.c_str(),
+ base->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str());
// Propagate noContraction up the dereference chain
if (base->getQualifier().isNoContraction())