[cfe-commits] r150128 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/SemaCXX/function-extern-c.cpp

Eli Friedman eli.friedman at gmail.com
Thu Feb 9 15:24:54 PST 2012


On Thu, Feb 9, 2012 at 3:04 PM, Chandler Carruth <chandlerc at google.com> wrote:
> On Thu, Feb 9, 2012 at 12:42 PM, Matt Beaumont-Gay <matthewbg at google.com>
> wrote:
>>
>> On a different note, what do you think about not warning when the
>> return type is incomplete? It's a little surprising that we warn on
>> this:
>>
>> struct foo;
>> extern "C" { struct foo get_foo(void); }
>> struct foo { };
>
>
> I think that's a bug. Incomplete struct types are relatively common as
> "opaque" return types.

A function type with an incomplete return type is essentially opaque
in the sense that it's impossible to call; it doesn't generally make
sense for an interface to expose something like that.

-Eli



More information about the cfe-commits mailing list