Skip to content

Commit f44dda9

Browse files
committed
Allow in x: const T, closes #696
1 parent 25626db commit f44dda9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/parse.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ auto unqualified_id_node::to_string() const
13001300
ret += separator;
13011301
assert(t.arg.index() != template_argument::empty);
13021302
if (t.arg.index() == template_argument::expression) {
1303-
ret += "(expression)";
1303+
ret += std::get<template_argument::expression>(t.arg)->to_string();
13041304
}
13051305
else if (t.arg.index() == template_argument::type_id) {
13061306
ret += std::get<template_argument::type_id>(t.arg)->to_string();
@@ -7206,13 +7206,14 @@ class parser
72067206
!is_returns
72077207
&& n->declaration->is_const()
72087208
&& n->pass != passing_style::copy
7209+
&& n->pass != passing_style::inout
72097210
)
72107211
{
72117212
switch (n->pass) {
72127213
break;case passing_style::in:
72137214
error( "an 'in' parameter is always const, 'const' isn't needed and isn't allowed", false );
72147215
break;case passing_style::inout:
7215-
error( "an 'inout' parameter can't be const, if you do want it to be const then use 'in' instead", false );
7216+
// error( "an 'inout' parameter can't be const, if you do want it to be const then use 'in' instead", false );
72167217
break;case passing_style::out:
72177218
error( "an 'out' parameter can't be const, otherwise it can't be initialized in the function body", false );
72187219
break;case passing_style::move:

0 commit comments

Comments
 (0)