Skip to content

Commit 871e366

Browse files
committed
Echo requires-clause on generated postfix ++/--
1 parent 4248d1e commit 871e366

File tree

7 files changed

+129
-91
lines changed

7 files changed

+129
-91
lines changed

regression-tests/test-results/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
cppfront compiler v0.3.0 Build 8C10:1238
2+
cppfront compiler v0.3.0 Build 8C11:0148
33
Copyright(c) Herb Sutter All rights reserved
44

55
SPDX-License-Identifier: CC-BY-NC-ND-4.0

source/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"8C10:1238"
1+
"8C11:0148"

source/parse.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,6 +2256,18 @@ struct function_type_node
22562256
return returns.index() != empty;
22572257
}
22582258

2259+
auto has_deduced_return_type() const
2260+
-> bool
2261+
{
2262+
return
2263+
returns.index() == empty
2264+
|| (
2265+
returns.index() == id
2266+
&& std::get<function_type_node::id>(returns).type->is_wildcard()
2267+
)
2268+
;
2269+
}
2270+
22592271
auto unnamed_return_type_to_string() const
22602272
-> std::string
22612273
{
@@ -3359,6 +3371,16 @@ struct declaration_node
33593371
return false;
33603372
}
33613373

3374+
auto has_deduced_return_type() const
3375+
-> bool
3376+
{
3377+
if (auto func = std::get_if<a_function>(&type)) {
3378+
return (*func)->has_deduced_return_type();
3379+
}
3380+
// else
3381+
return false;
3382+
}
3383+
33623384
auto unnamed_return_type_to_string() const
33633385
-> std::string
33643386
{

0 commit comments

Comments
 (0)