From 345e3d419eafb0e234aecb4a33f37efe2afbbf53 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sun, 18 Oct 2026 08:07:50 +0000 Subject: feat(classes): add copy constructors and statement-scoped temporaries Co-Authored-By: Claude Opus 5.5 --- AGENTS/PITFALLS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'AGENTS/PITFALLS.md') diff --git a/AGENTS/PITFALLS.md b/AGENTS/PITFALLS.md index 820fa55..4c72a4f 100644 --- a/AGENTS/PITFALLS.md +++ b/AGENTS/PITFALLS.md @@ -124,7 +124,7 @@ test programs. Explicit calls do not recurse into fields or affect Alive tracking. Keyword DELETE validates an active allocation start before destroying the object and its fields, then frees memory and leaves aliases dangling; FREE skips all destruction. - DECLARE storage and shallow BYVAL copies are destroyed in reverse declaration order + DECLARE storage and BYVAL copies are destroyed in reverse declaration order at normal function exit or when unwinding leaves the frame. Arrays reverse their flat element order. Repeated DECLARE destroys its previous incarnation first. Lifetimes are function-scoped, even for declarations inside blocks. NEW rebinding @@ -178,3 +178,5 @@ Linux. WHILE accepts both the standard header without DO and the older WHILE DO form. - **Literal escapes.** C++17 escapes are decoded by the lexer. Unicode escapes encode UTF-8 in strings; CHAR Unicode escapes must be ASCII. Built-in STRING remains NUL-terminated: `"a\0b"` is observed as `"a"`. + +- **Copy limits.** Classes may define a same-class BYREF copy constructor. Classes without one, whole TYPE records containing class fields, and BYVAL arrays still copy bits; owning handles inside these aggregate copies need explicit care. Class rvalues transfer ownership when consumed; discarded results and temporary receivers are destroyed at statement end. -- cgit v1.3.1-4-g156e