Skip to content
Snippets Groups Projects
Commit c5975565 authored by Oliver Sander's avatar Oliver Sander
Browse files

merge patch 6492 (fix for nullptr with g++ 4.6) from the trunk

[[Imported from SVN: r6504]]
parents d0a64fb7 7a3a5456
Branches
Tags
No related merge requests found
......@@ -28,7 +28,9 @@ private:
void operator&() const; // whose address can't be taken
} nullptr = {}; // and whose name is nullptr
typedef dune_nullptr_t nullptr_t;
namespace Dune {
typedef dune_nullptr_t nullptr_t;
}
template<class T>
bool operator == (T* t, dune_nullptr_t)
......@@ -42,6 +44,14 @@ bool operator == (dune_nullptr_t, T* t)
return (t == static_cast<T*>(nullptr));
}
#else
#include <cstddef>
namespace Dune {
using std::nullptr_t;
}
#endif // HAVE_NULLPTR
#endif // DUNE_NULLPTR_HH
......@@ -8,7 +8,7 @@
void basic_tests()
{
typedef nullptr_t NULLPTR_T;
typedef Dune::nullptr_t NULLPTR_T;
char* ch = nullptr; // ch has the null pointer value
char* ch2 = 0; // ch2 has the null pointer value
#ifdef FAIL
......
......@@ -3,7 +3,7 @@ AC_DEFUN([NULLPTR_CHECK],[
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether nullptr is supported])
AC_TRY_COMPILE([],[typedef nullptr_t peng;
AC_TRY_COMPILE([],[
char* ch = nullptr;
], [
HAVE_NULLPTR=yes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment