Make the public Rights header self-contained #610

Closed
opened 2026-10-20 15:51:16 +02:00 by erikinkinen · 0 comments
Owner

Goal

Make the public Rights header compile when included by itself.

Reproduction

While compiling the P2-02 baseline fixture producer against the untouched Phase 1 source, putting #include <aes/core/rights.hpp> first fails: std::strong_ordering is not a member of std. The header defines a C++20 spaceship operator but includes only <cstdint>, relying on another header to include <compare> first. All 44 existing CTests pass because their include order supplies the missing declaration.

Minimal reproduction: compile a translation unit containing only #include <aes/core/rights.hpp> and int main() {} with g++ -std=c++20 -fsyntax-only -I core/include.

Steps

  • Include the standard header required by the spaceship comparison directly in rights.hpp.
  • Verify the standalone-header translation unit fails on the baseline and compiles with the fix.
  • Validate formatting, the existing build/tests and unchanged Rights behavior before merging.

Acceptance

The public header is self-contained for C++20 consumers and does not depend on include order. No authority or rights semantics change. P2-02 must retain the original source identity and record any explicit include workaround used to capture old fixtures.

## Goal Make the public Rights header compile when included by itself. ## Reproduction While compiling the P2-02 baseline fixture producer against the untouched Phase 1 source, putting `#include <aes/core/rights.hpp>` first fails: `std::strong_ordering` is not a member of `std`. The header defines a C++20 spaceship operator but includes only `<cstdint>`, relying on another header to include `<compare>` first. All 44 existing CTests pass because their include order supplies the missing declaration. Minimal reproduction: compile a translation unit containing only `#include <aes/core/rights.hpp>` and `int main() {}` with `g++ -std=c++20 -fsyntax-only -I core/include`. ## Steps - [x] Include the standard header required by the spaceship comparison directly in `rights.hpp`. - [x] Verify the standalone-header translation unit fails on the baseline and compiles with the fix. - [x] Validate formatting, the existing build/tests and unchanged Rights behavior before merging. ## Acceptance The public header is self-contained for C++20 consumers and does not depend on include order. No authority or rights semantics change. P2-02 must retain the original source identity and record any explicit include workaround used to capture old fixtures.
erikinkinen added this to the Phase 2 milestone 2026-10-20 15:51:16 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erikinkinen/AES#610
No description provided.