[cfe-commits] [libcxxabi] r149536 - in /libcxxabi/trunk/test: catch_member_pointer_nullptr.cpp catch_pointer_nullptr.cpp

Howard Hinnant hhinnant at apple.com
Wed Feb 1 13:30:13 PST 2012


On Feb 1, 2012, at 4:22 PM, Marshall Clow wrote:

> On Feb 1, 2012, at 1:01 PM, Howard Hinnant wrote:
> 
>> Author: hhinnant
>> Date: Wed Feb  1 15:01:52 2012
>> New Revision: 149536
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=149536&view=rev
>> Log:
>> Add some tests to test catching nullptr with pointers and member pointers.  Tests are only activated if #if __has_feature(cxx_nullptr).
> 
> Do you also want some const-pointer tests?
> Something like this (warning, uncompiled code):
> 
> struct  A {};
> 
> void test1 () {
> 
> try  {
> 	throw nullptr;
>        assert(false);
>    }
> 
> catch ( const A* ) {}
> catch ( A *) { assert (false); }
> }
> 
> void test1 () {
> 
> try  {
> 	throw nullptr;
>        assert(false);
>    }
> 
> catch ( A* ) {}
> catch ( const A *) { assert (false); }
> }
> 
> 
> -- Marshall
> 
> Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>
> 
> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
>        -- Yu Suzuki
> 


Thanks!

Howard




More information about the cfe-commits mailing list