aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Designator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/Designator.cc')
-rw-r--r--lib/CodeGen/Designator.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc
index 4f0e82b..6737937 100644
--- a/lib/CodeGen/Designator.cc
+++ b/lib/CodeGen/Designator.cc
@@ -219,7 +219,9 @@ bool CodeGen::emitLValue(ExprAST *E, LValueInfo &Out) {
}
const RecordFieldInfo *FI = RP->findField(A.FieldName);
if (!FI) {
- reportError("Record type %s has no field %s", TypeName.c_str(), A.FieldName.c_str());
+ // The rejected field was already reported with its record.
+ if (!RP->Invalid)
+ reportError("Record type %s has no field %s", TypeName.c_str(), A.FieldName.c_str());
return false;
}
if (!FI->IsPublic && !sameIdentifier(CurrentClass, TypeName)) {