@@ -465,7 +465,7 @@ bool write_variable_base(code_generator::output& output, const cpp_variable_base
465465}
466466
467467void write_storage_class (code_generator::output& output, cpp_storage_class_specifiers storage,
468- bool is_constexpr)
468+ bool is_constexpr, bool is_consteval )
469469{
470470 if (is_static (storage))
471471 output << keyword (" static" ) << whitespace;
@@ -475,6 +475,8 @@ void write_storage_class(code_generator::output& output, cpp_storage_class_speci
475475 output << keyword (" thread_local" ) << whitespace;
476476 if (is_constexpr)
477477 output << keyword (" constexpr" ) << whitespace;
478+ else if (is_consteval)
479+ output << keyword (" consteval" ) << whitespace;
478480}
479481
480482bool generate_variable (code_generator& generator, const cpp_variable& var,
@@ -483,7 +485,7 @@ bool generate_variable(code_generator& generator, const cpp_variable& var,
483485 code_generator::output output (type_safe::ref (generator), type_safe::ref (var), cur_access);
484486 if (output)
485487 {
486- write_storage_class (output, var.storage_class (), var.is_constexpr ());
488+ write_storage_class (output, var.storage_class (), var.is_constexpr (), false );
487489
488490 write_variable_base (output, var, var.name ());
489491 output << punctuation (" ;" ) << newl;
@@ -602,7 +604,7 @@ bool generate_function(code_generator& generator, const cpp_function& func,
602604 {
603605 if (is_friended (func))
604606 output << keyword (" friend" ) << whitespace;
605- write_storage_class (output, func.storage_class (), func.is_constexpr ());
607+ write_storage_class (output, func.storage_class (), func.is_constexpr (), func. is_consteval () );
606608
607609 if (output.options () & code_generator::exclude_return)
608610 output.excluded (func) << whitespace;
@@ -705,6 +707,8 @@ bool generate_member_function(code_generator& generator, const cpp_member_functi
705707 output << keyword (" friend" ) << whitespace;
706708 if (func.is_constexpr ())
707709 output << keyword (" constexpr" ) << whitespace;
710+ else if (func.is_consteval ())
711+ output << keyword (" consteval" ) << whitespace;
708712 else
709713 write_prefix_virtual (output, func.virtual_info ());
710714
@@ -756,6 +760,8 @@ bool generate_conversion_op(code_generator& generator, const cpp_conversion_op&
756760 output << keyword (" explicit" ) << whitespace;
757761 if (op.is_constexpr ())
758762 output << keyword (" constexpr" ) << whitespace;
763+ else if (op.is_consteval ())
764+ output << keyword (" consteval" ) << whitespace;
759765 else
760766 write_prefix_virtual (output, op.virtual_info ());
761767
@@ -791,6 +797,8 @@ bool generate_constructor(code_generator& generator, const cpp_constructor& ctor
791797 output << keyword (" explicit" ) << whitespace;
792798 if (ctor.is_constexpr ())
793799 output << keyword (" constexpr" ) << whitespace;
800+ if (ctor.is_consteval ())
801+ output << keyword (" consteval" ) << whitespace;
794802
795803 output << identifier (ctor.semantic_scope ()) << identifier (ctor.name ());
796804 write_function_parameters (output, ctor);
0 commit comments