Remove configure test for override keyword.

Detect its support in the code by testing __cplusplus value and using specific
checks for MSVC and Clang as configure detects it as being available when
using recent g++ versions in non-C++11 mode, which do support this keyword but
warn when it is used without -std={gnu,c}++11 option, which makes actually
using it a bad idea in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-03-20 15:49:07 +00:00
parent 33ad33d447
commit 78de4fe291
5 changed files with 9 additions and 106 deletions

56
configure vendored
View File

@@ -21173,62 +21173,6 @@ $as_echo "$wx_cv_explicit" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C++ compiler supports the override keyword" >&5
$as_echo_n "checking if C++ compiler supports the override keyword... " >&6; }
if ${wx_cv_override+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
struct Base { virtual void Foo() = 0; };
struct Derived : Base { virtual void Foo() override { } };
int
main ()
{
return 0;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
wx_cv_override=yes
else
wx_cv_override=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_override" >&5
$as_echo "$wx_cv_override" >&6; }
if test "$wx_cv_override" = "yes"; then
$as_echo "#define HAVE_OVERRIDE 1" >>confdefs.h
fi
if test "x$SUNCXX" = xyes; then
CXXFLAGS="-features=tmplife $GNU_SOURCE_FLAG $CXXFLAGS"
fi