diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-14 03:31:47 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-14 03:31:47 +0000 |
| commit | 2147449f4d6f37b4624990ff26bce58ebf3cfb4b (patch) | |
| tree | bbf09cea539b8ea01ee3d392ec828067552fa4b7 /lib/CodeGen/Designator.cc | |
| parent | 699e18b65b07af73ccd14b28f83572b1843c7d37 (diff) | |
feat(parser): add explicit parenthesized type casts
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/Designator.cc')
| -rw-r--r-- | lib/CodeGen/Designator.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc index c7d0796..019c19e 100644 --- a/lib/CodeGen/Designator.cc +++ b/lib/CodeGen/Designator.cc @@ -231,6 +231,9 @@ Value *CodeGen::emitCoercedExpr(ExprAST *E, const TypeInfo *Target) { return nullptr; } if (Src && Src->sameType(Target) && !Target->isVoid()) return emitExpr(E); + if (Src && Src->Kind == TypeKind::CScalar && Target->Kind == TypeKind::CScalar && + !Src->isVoid() && !Target->isVoid()) + return convertNumericValue(emitExpr(E), Src, Target); reportError("Cannot implicitly convert %s to %s; use an explicit cast", Src ? Src->Name.c_str() : "expression", Target->Name.c_str()); return nullptr; |
