[cfe-dev] -Wcatch-incomplete-type-extensions
John McCall
rjmccall at apple.com
Thu Jan 19 10:40:53 PST 2012
On Jan 19, 2012, at 10:25 AM, Howard Hinnant wrote:
> On Jan 19, 2012, at 12:39 PM, John McCall wrote:
>>> I'm willing to file a bug on this, but I wanted to get guidance here first.
>>
>> That is absolutely a bug that we should fix.
>
> http://llvm.org/bugs/show_bug.cgi?id=11803
>
>>> g++-4.2 refuses to compile the code that malfunctions, and thus never gets into this situation.
>>
>> Because it catches a reference to incomplete type? Rejecting this is not allowed.
>
> The compiler is required to issue a diagnostic because the code is ill-formed (clang does issue a warning):
>
> 15.3 [except.handle]/p1:
>
>> The exception-declaration in a handler describes the type(s) of exceptions that can cause that handler to be entered. The exception-declaration shall not denote an incomplete type, an abstract class type, or an rvalue reference type. The exception-declaration shall not denote a pointer or reference to an incomplete type, other than void*, const void*, volatile void*, or const volatile void*.
Okay. I don't know off-hand why we accept this, then, particularly if GCC does not.
John.
More information about the cfe-dev
mailing list