Skip to content

Commit 18f2eb5

Browse files
committed
Reject function default arguments, closes #75
1 parent 414e16a commit 18f2eb5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/parse.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,6 +2743,11 @@ class parser
27432743
return {};
27442744
}
27452745

2746+
if (!returns && n->declaration->initializer) {
2747+
error("Cpp2 is currently exploring the path of not allowing default arguments - use overloading instead", false);
2748+
return {};
2749+
}
2750+
27462751
return n;
27472752
}
27482753

0 commit comments

Comments
 (0)