[M1] add util::Error, Result<T>, format()

This commit is contained in:
2026-05-08 00:00:21 +00:00
parent 6e922b7249
commit fba725e192
8 changed files with 183 additions and 2 deletions

View File

@@ -12,3 +12,10 @@ All notable changes to cargoxx will be documented in this file.
builds an empty `cargoxx` binary.
- `.clang-format` (LLVM, 100-column) and `.gitignore`.
- `SPEC.md`, `TECH_SPEC.md`.
- M1 foundation in `cargoxx.util`: `ErrorCode` (numbers per `TECH_SPEC.md` §4),
`Error`, `Result<T> = std::expected<T, Error>`, and `format(Error)` rendering
`error[Ennnn]: ...` with optional `--> path:line:col` and `hint:` lines.
`format` lives in `src/util/error.cpp` as a module implementation unit.
- `Catch2 v3` wired through `flake.nix` (libc++-built override) and registered
in CMake; `tests/util_error.cpp` covers six format cases via
`catch_discover_tests`.