[gabi++] nullptr can be converted to every pointer type.

The nullptr can be converted to every pointer type, so every catch
statements with pointer type should be able to catch the nullptr
exception.

This commit fixes following test cases for GCC 4.8/Clang 3.4:

* tests/device/test-gabi++/test_gabixx_shared_catch_const_pointer_nullptr
* tests/device/test-gabi++/test_gabixx_shared_catch_member_pointer_nullptr
* tests/device/test-gabi++/test_gabixx_shared_catch_pointer_nullptr
* tests/device/test-gabi++/test_gabixx_static_catch_const_pointer_nullptr
* tests/device/test-gabi++/test_gabixx_static_catch_member_pointer_nullptr
* tests/device/test-gabi++/test_gabixx_static_catch_pointer_nullptr

p.s. GCC 4.6 passed the test simply because the __cplusplus is not
implemented properly, and the test for C++11 (or C++0x) will not
be compiled and tested.

Change-Id: I80bbaf7b57ddbc9104f659b5614f6c1277641aba
diff --git a/sources/cxx-stl/gabi++/src/pbase_type_info.cc b/sources/cxx-stl/gabi++/src/pbase_type_info.cc
index 9a7f215..a68d348 100644
--- a/sources/cxx-stl/gabi++/src/pbase_type_info.cc
+++ b/sources/cxx-stl/gabi++/src/pbase_type_info.cc
@@ -28,6 +28,11 @@
 // pbase_type_info.cc: Methods for __pbase_type_info.
 
 #include "cxxabi_defines.h"
+#include "typeinfo"
+
+#if __cplusplus < 201103L
+extern "C" std::type_info _ZTIDn;
+#endif
 
 namespace __cxxabiv1
 {
@@ -37,8 +42,18 @@
 
   bool __pbase_type_info::can_catch(const __shim_type_info* thr_type,
                                     void*& adjustedPtr) const {
-    unsigned tracker = first_time_init;
-    return can_catch_typeinfo_wrapper(thr_type, adjustedPtr, tracker);
+    if (can_catch_typeinfo_wrapper(thr_type, adjustedPtr, first_time_init)) {
+      return true;
+    }
+
+#if __cplusplus >= 201103L
+    // In C++ 11, the type of nullptr is std::nullptr_t, but nullptr can be
+    // casted to every pointer types.  Thus, we can return true whenever
+    // the exception object is an instance of std::nullptr_t.
+    return (*thr_type == typeid(decltype(nullptr)));
+#else
+    return (*thr_type == _ZTIDn);
+#endif
   }
 
   bool __pbase_type_info::can_catch_typeinfo_wrapper(const __shim_type_info* thr_type,