Skip to content

Add expected handling for safe_int class - #143

Closed
PLGCesar wants to merge 1 commit into
managarm:masterfrom
PLGCesar:master
Closed

PLGCesar wants to merge 1 commit into
managarm:masterfrom
PLGCesar:master

Conversation

@PLGCesar

@PLGCesar PLGCesar commented Aug 9, 2026 •

Copy link
Copy Markdown

Minor error fixed.
Log:

Error: no template named 'expected' in namespace 'std'
46 |         std::expected<T, bad_safe_int> expected() const {
|         ~~~~~^
../../apps/mlibc/subprojects/frigg/include/frg/safe_int.hpp:51:7: error: no template named 'expected' in namespace 'std'
51 |         std::expected<T, E> or_unexpected(E error) const {
|         ~~~~~^
../../apps/mlibc/subprojects/frigg/include/frg/safe_int.hpp:53:16: error: no member named 'unexpected' in namespace 'std'
53 |                         return std::unexpected{error};
|                                ~~~~~^
../../apps/mlibc/subprojects/frigg/include/frg/safe_int.hpp:53:26: error: expected ';' after return statement
53 |                         return std::unexpected{error};
|                                               ^
|                                               ;
4 errors generated

I think it's all sorted out; CI compiled everything without errors at least.

@ArsenArsen

Copy link
Copy Markdown
Member

this is probably okay but please clean up the commits

@PLGCesar

PLGCesar commented Aug 9, 2026

Copy link
Copy Markdown
Author

Provavelmente está tudo bem, mas por favor, limpe os commits
Okay

A minor error has been fixed:
`error: no template named 'expected' in namespace 'std'
46 |         std::expected<T, bad_safe_int> expected() const {
|         ~~~~~^
../../apps/mlibc/subprojects/frigg/include/frg/safe_int.hpp:51:7: error: no template named 'expected' in namespace 'std'
51 |         std::expected<T, E> or_unexpected(E error) const {
|         ~~~~~^
../../apps/mlibc/subprojects/frigg/include/frg/safe_int.hpp:53:16: error: no member named 'unexpected' in namespace 'std'
53 |                         return std::unexpected{error};
|                                ~~~~~^
../../apps/mlibc/subprojects/frigg/include/frg/safe_int.hpp:53:26: error: expected ';' after return statement
53 |                         return std::unexpected{error};
|                                               ^
|                                               ;
4 errors generated.`

Add a new test file

Delete Test
@PLGCesar

PLGCesar commented Aug 9, 2026

Copy link
Copy Markdown
Author

Provavelmente está tudo bem, mas por favor, limpe os commits.

Done

@no92

no92 commented Aug 9, 2026

Copy link
Copy Markdown
Member

Checking FTMs is fine, but why would std:: expected be missing in the first place if the header inclusion doesn't fail? Is it some old C++ standard being used?

@PLGCesar

PLGCesar commented Aug 9, 2026

Copy link
Copy Markdown
Author

Verificar as FTMs é aceitável, mas por que std::expected estaria ausente se a inclusão do cabeçalho não falhou? Será que estão usando algum padrão antigo do C++?

Well, no old version of C++ is being used (besides, I tested it with C++23 and C++26) And the same error persists; I really don't get it, even including the file, it still doesn't seem exist

@ArsenArsen

Copy link
Copy Markdown
Member

Checking FTMs is fine, but why would std:: expected be missing in the first place if the header inclusion doesn't fail? Is it some old C++ standard being used?

clang (at least up to some version) doesn't implement a requisite feature of concepts (IIRC) so the header exists but is effectively empty.

https://gcc.gnu.org/cgit/gcc/tree/libstdc++-v3/include/bits/version.def#n1598

@PLGCesar PLGCesar closed this by deleting the head repository Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants