From 419412195c2a662452cbd99fca298029556743db Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 18 Jan 2009 23:56:54 +0000 Subject: [PATCH] Check for a bug in gcc C++0x support. git-svn-id: https://svn.dealii.org/trunk@18227 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 12 +++++++++++ deal.II/configure | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index e4aefbe9bc..d28dbce4a9 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -1138,6 +1138,18 @@ AC_DEFUN(DEAL_II_CHECK_CXX0X_COMPONENTS, dnl [ AC_MSG_RESULT(no); all_cxx0x_available=no ] ) + dnl Make sure we don't run into GCC bug 35569 + AC_MSG_CHECKING(for std::bind works with rvalues) + AC_TRY_COMPILE( + [#include + void f(int); ], + [ using namespace std; + using namespace std::placeholders; + bind(multiplies(),4,_1)(5); ;], + [ AC_MSG_RESULT(yes) ], + [ AC_MSG_RESULT(no); all_cxx0x_available=no ] + ) + AC_MSG_CHECKING(for std::shared_ptr) AC_TRY_COMPILE( [#include ], diff --git a/deal.II/configure b/deal.II/configure index a4d4e6f06c..5d582455e3 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -4100,6 +4100,56 @@ echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + { echo "$as_me:$LINENO: checking for std::bind works with rvalues" >&5 +echo $ECHO_N "checking for std::bind works with rvalues... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + void f(int); +int +main () +{ + using namespace std; + using namespace std::placeholders; + bind(multiplies(),4,_1)(5); ; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no + +fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: checking for std::shared_ptr" >&5 -- 2.39.5