Skip to content

Commit c2e0778

Browse files
committed
Allow implicit on a constructor with more than one argument after this
Resolves comment 0a13eae#commitcomment-126660334
1 parent 82c585f commit c2e0778

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

source/sema.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,24 +1054,6 @@ class sema
10541054
return false;
10551055
}
10561056

1057-
// An implicit constructor must have two parameters
1058-
if (n.is_constructor())
1059-
{
1060-
auto& params = std::get<declaration_node::a_function>(n.type)->parameters;
1061-
assert(params->ssize() > 0);
1062-
if (
1063-
params->parameters[0]->is_implicit()
1064-
&& params->ssize() > 2
1065-
)
1066-
{
1067-
errors.emplace_back(
1068-
n.position(),
1069-
"an 'implicit' constructor must have at most one additional parameter besides 'this'"
1070-
);
1071-
return false;
1072-
}
1073-
}
1074-
10751057
// A nonvirtual and nondefaultable function must have an initializer
10761058
if (
10771059
n.is_function()

0 commit comments

Comments
 (0)