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

Marshall Clow mclow.lists at gmail.com
Wed Feb 1 13:22:47 PST 2012


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





More information about the cfe-commits mailing list