diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-13 13:45:03 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-13 13:45:03 +0000 |
| commit | 05cdcb6a1cc3d4de3a0b3d12d4babcd6438b4754 (patch) | |
| tree | d3e482d215d9d5feba8b40f9de15d6962f1e5bac /lib/CodeGen/Designator.cc | |
| parent | f5a2541ed3faf9a942b867e2d54577352153afce (diff) | |
Add record-derived classes with explicit field visibility
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/Designator.cc')
| -rw-r--r-- | lib/CodeGen/Designator.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc index 640ca0b..9d14d23 100644 --- a/lib/CodeGen/Designator.cc +++ b/lib/CodeGen/Designator.cc @@ -145,6 +145,11 @@ bool CodeGen::emitLValue(ExprAST *E, LValueInfo &Out) { reportError("Record type %s has no field %s", TypeName.c_str(), A.FieldName.c_str()); return false; } + if (!FI->IsPublic) { + reportError("Cannot access private field %s of type %s", + A.FieldName.c_str(), TypeName.c_str()); + return false; + } Addr = Builder->CreateStructGEP(Cur->LLVMType, Addr, FI->Index, TypeName + "." + A.FieldName); TypeName = FI->TypeName; |
