[cfe-dev] -Wcatch-incomplete-type-extensions
Douglas Gregor
dgregor at apple.com
Tue Jan 24 12:45:05 PST 2012
On Jan 19, 2012, at 10:44 AM, Howard Hinnant wrote:
>
> On Jan 19, 2012, at 1:40 PM, John McCall wrote:
>
>> 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.
>
> It is because of http://llvm.org/bugs/show_bug.cgi?id=6527
>
> I tried to collect all this information in the bug report (http://llvm.org/bugs/show_bug.cgi?id=11803) so it is there in one place. And at this point I'm not sure what the best solution is. But I'm pretty sure we're in an anywhere-but-here situation.
Agreed. I've made the warning into an error in Clang r148838.
- Doug
More information about the cfe-dev
mailing list