File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -4771,22 +4771,20 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
4771
4771
}
4772
4772
4773
4773
void visitFuncDecl (FuncDecl *FD) {
4774
- if (!IsFirstPass) {
4775
- if (FD->hasBody ()) {
4776
- // Record the body.
4777
- TC.definedFunctions .push_back (FD);
4778
- } else if (requiresDefinition (FD)) {
4779
- // Complain if we should have a body.
4780
- TC.diagnose (FD->getLoc (), diag::func_decl_without_brace);
4781
- }
4782
-
4774
+ if (!IsFirstPass)
4783
4775
return ;
4784
- }
4785
4776
4786
4777
TC.validateDecl (FD);
4787
4778
checkAccessControl (TC, FD);
4788
- }
4789
4779
4780
+ if (FD->hasBody ()) {
4781
+ // Record the body.
4782
+ TC.definedFunctions .push_back (FD);
4783
+ } else if (requiresDefinition (FD)) {
4784
+ // Complain if we should have a body.
4785
+ TC.diagnose (FD->getLoc (), diag::func_decl_without_brace);
4786
+ }
4787
+ }
4790
4788
4791
4789
void visitModuleDecl (ModuleDecl *) { }
4792
4790
Original file line number Diff line number Diff line change @@ -219,7 +219,9 @@ struct X6<T> {
219
219
220
220
extension X6 {
221
221
var k : Int { return 0 } // expected-note{{previously declared here}}
222
- func k( ) // expected-error{{invalid redeclaration of 'k()'}}
222
+ func k( )
223
+ // expected-error@-1{{invalid redeclaration of 'k()'}}
224
+ // expected-error@-2{{expected '{' in body of function declaration}}
223
225
}
224
226
225
227
// Subscripting
You can’t perform that action at this time.
0 commit comments