File tree 5 files changed +122
-63
lines changed
5 files changed +122
-63
lines changed Original file line number Diff line number Diff line change @@ -2244,6 +2244,9 @@ struct function_type_node
2244
2244
auto is_metafunction () const
2245
2245
-> bool;
2246
2246
2247
+ auto is_const_metafunction () const
2248
+ -> bool;
2249
+
2247
2250
auto has_declared_return_type () const
2248
2251
-> bool
2249
2252
{
@@ -3508,6 +3511,16 @@ struct declaration_node
3508
3511
return false ;
3509
3512
}
3510
3513
3514
+ auto is_const_metafunction () const
3515
+ -> bool
3516
+ {
3517
+ if (auto func = std::get_if<a_function>(&type)) {
3518
+ return (*func)->is_const_metafunction ();
3519
+ }
3520
+ // else
3521
+ return false ;
3522
+ }
3523
+
3511
3524
auto is_binary_comparison_function () const
3512
3525
-> bool
3513
3526
{
@@ -3975,7 +3988,10 @@ auto function_type_node::is_metafunction() const
3975
3988
if (
3976
3989
(*parameters).ssize () == 1
3977
3990
&& this ->nth_parameter_type_name (1 ) == " cpp2::meta::type_declaration"
3978
- && (*parameters)[0 ]->direction () == passing_style::inout
3991
+ && (
3992
+ (*parameters)[0 ]->direction () == passing_style::in
3993
+ || (*parameters)[0 ]->direction () == passing_style::inout
3994
+ )
3979
3995
)
3980
3996
{
3981
3997
return true ;
@@ -3984,6 +4000,14 @@ auto function_type_node::is_metafunction() const
3984
4000
}
3985
4001
3986
4002
4003
+ auto function_type_node::is_const_metafunction () const
4004
+ -> bool
4005
+ {
4006
+ return is_metafunction ()
4007
+ && (*parameters)[0 ]->direction () == passing_style::in;
4008
+ }
4009
+
4010
+
3987
4011
auto primary_expression_node::template_arguments () const
3988
4012
-> std::vector<template_argument> const &
3989
4013
{
You can’t perform that action at this time.
0 commit comments