diff --git a/cmake/modules/DuneCxaDemangle.cmake b/cmake/modules/DuneCxaDemangle.cmake
index 9f480fa9a519fa85a5d95da36df5f5c7fdc3110d..7909a677591ef4ba65dc17fc8a02053d7c8989da 100644
--- a/cmake/modules/DuneCxaDemangle.cmake
+++ b/cmake/modules/DuneCxaDemangle.cmake
@@ -8,7 +8,8 @@
 # perform tests
 include(CheckCXXSourceCompiles)
 
-CHECK_CXX_SOURCE_COMPILES("#include <cxxabi.h>
+CHECK_CXX_SOURCE_COMPILES("#include <typeinfo>
+#include <cxxabi.h>
 int main(void){
     int foobar = 0;
     const char *foo = typeid(foobar).name();
diff --git a/m4/dune_cxa_demangle.m4 b/m4/dune_cxa_demangle.m4
index b84eea409d5e7cd8be3ef5c07cebd7aa941ae56c..e86b65e516a79fae4b4b315607d06054dd2a1bf3 100644
--- a/m4/dune_cxa_demangle.m4
+++ b/m4/dune_cxa_demangle.m4
@@ -4,6 +4,7 @@ AC_DEFUN([DUNE_CHECK_CXA_DEMANGLE],[
     AC_CACHE_CHECK([for abi::__cxa_demangle], dune_cv_cxa_demangle, [
         AC_LANG_PUSH([C++])
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+    #include <typeinfo>
     #include <cxxabi.h>
             ]],
             [[