Skip to content

Commit

Permalink
Reject function default arguments, closes hsutter#75
Browse files Browse the repository at this point in the history
  • Loading branch information
hsutter committed Dec 26, 2022
1 parent 9044650 commit 60d9903
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -2743,6 +2743,11 @@ class parser
return {};
}

if (!returns && n->declaration->initializer) {
error("Cpp2 is currently exploring the path of not allowing default arguments - use overloading instead", false);
return {};
}

return n;
}

Expand Down

0 comments on commit 60d9903

Please sign in to comment.