diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 3b6ce6bd73..0fe5715578 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1327,6 +1327,9 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, bool IsFunctionDefinition) { if (R.isNull()) { InvalidDecl = true; R = Context.IntTy; + if (IsFunctionDefinition) // int(...) + R = Context.getFunctionType(R, 0, 0, true, 0); + } // See if this is a redefinition of a variable in the same scope. diff --git a/test/Sema/function.c b/test/Sema/function.c index 3a0352d753..7e5887a277 100644 --- a/test/Sema/function.c +++ b/test/Sema/function.c @@ -70,3 +70,10 @@ void gnu_inline1() {} void __attribute__((__gnuc_inline__)) // expected-warning {{'gnuc_inline' attribute requires function to be marked 'inline', attribute ignored}} expected-warning{{extension used}} gnu_inline2() {} + + +// rdar://6802350 +inline foo_t invalid_type() { // expected-error {{unknown type name 'foo_t'}} +} + +