[cfe-dev] [PATCH] Add Microsoft's handling of exception specifications
Douglas Gregor
dgregor at apple.com
Mon Aug 30 08:05:46 PDT 2010
On Aug 28, 2010, at 4:30 AM, Martin Vejnár wrote:
> On 8/26/2010 4:42 PM, Douglas Gregor wrote:
>> On Aug 24, 2010, at 3:19 AM, Martin Vejnár wrote:
>>> In any case, I'm attaching another patch that does what you suggest.
>>
>> I think the patch is okay, but please provide test cases that explore
>> how Visual C++ actually checks compatibility of exception
>> specifications, to make sure that we're modeling what Visual C++ does
>> rather than having some different non-conforming behavior.
>
> I've added a simple test case to the patch. Note that the patch is not trying to replicate the exact behavior of MSVC with respect to exception specifications, it only addresses the particular case that causes clang to fail on Microsoft's <new>.
>
> In particular, the patch keeps the following code ill-formed:
>
> void (*q)() throw(int) = 0;
> void (*p)() throw(float) = q;
>
> whereas MSVC accepts it.
Okay. Note that your patch broke the test in test/SemaCXX/exception-spec.cpp. I've fixed up the test (by moving the Microsoft-specific bits to a different test), but in the future, please be sure that the Clang test suite runs cleanly with your patch. Committed the result as r112482. Thanks!
- Doug
More information about the cfe-dev
mailing list