|
SofaBuffers C/C++ 0.12.0
API Documentation
|
Detects a container that states its own fixed capacity: the condition behind fixed_capacity_v.
More...
#include <sofab.hpp>
Detects a container that states its own fixed capacity: the condition behind fixed_capacity_v.
Named, rather than written inline where it is used, because the natural spelling of fixed_capacity_v – an immediately-invoked constexpr lambda with a requires-expression in its body – segfaults Clang 17 on instantiation, in Sema::BuildExprRequirement reached through TransformRequiresExpr inside TransformLambdaExpr inside InstantiateVariableInitializer. That form is valid C++20 and GCC and current Clang both accept it; the crash is an upstream Clang 17 bug, reproduced on stock 17.0.6 rather than only on the Renesas fork the RL78 job builds with. What matters is where the requires-expression sits: it is fine in a named concept, so max_size_v above keeps its lambda, and fine in an if constexpr inside a function template, so arrayRoom_ keeps its inline one. This was the only place that put a requires-expression in a lambda body, and the only one that had to move. test/cpp-freestanding/freestanding.cpp pins this with a static_assert, because that file is the only C++ the RL78 job compiles.