We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
constexpr
mutable
1 parent bc82833 commit b9e73e0Copy full SHA for b9e73e0
source/to_cpp1.h
@@ -4421,10 +4421,15 @@ class cppfront
4421
emit(*n.parameters);
4422
}
4423
4424
- // For an anonymous function, make the emitted lambda 'mutable'
+ // For an anonymous function, the emitted lambda is 'constexpr' or 'mutable'
4425
if (!n.my_decl->has_name())
4426
{
4427
- printer.print_cpp2( " mutable", n.position() );
+ if (n.my_decl->is_constexpr) {
4428
+ printer.print_cpp2( " constexpr", n.position() );
4429
+ }
4430
+ else {
4431
+ printer.print_cpp2( " mutable", n.position() );
4432
4433
4434
4435
// For now, adding implicit noexcept only for move/swap/dtor functions
0 commit comments