ETLCPP / etl

Embedded Template Library
https://www.etlcpp.com
MIT License
2.05k stars 373 forks source link

etl::expected doesn't compile with ETL_LOG_ERRORS #787

Closed HMS-JJO closed 7 months ago

HMS-JJO commented 7 months ago

Hi,

When enabling the ETL_LOG_ERRORS option I am unable to use etl::expected since expected_invalid<TError> doesn't publicly inherit from expected_invalid<void> resulting in the following error:

etl/error_handler.h:299:66: error: 'etl::exception' is an inaccessible base of 'etl::expected_invalid<Type>'
     #define ETL_ASSERT(b, e) {if(!(b)) {etl::error_handler::error((e));}}                                 // If the condition fails, calls the error handler
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
etl/expected.h:695:7: note: in expansion of macro 'ETL_ASSERT'
       ETL_ASSERT(storage.index() == Value_Type, ETL_ERROR(expected_invalid<TError>));

I believe there is a missing public in etl/expected.h:77.

This affects etl version 20.38.6.

jwellbelove commented 7 months ago

Fixed 20.38.8

jwellbelove commented 7 months ago

Fixed 20.38.7