summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-12-10 16:15:39 +0100
committerLuboš Luňák <l.lunak@suse.cz>2012-12-10 16:50:32 +0100
commit02e2202894652751f59a0709e1b767e8ed2ab30c (patch)
tree7a2521717013364467c3174121b60726eb62af20 /configure.ac
parent06448095946f635dd5753fd2db6079ca14bcfde7 (diff)
do not try to use -std=c++11 after all
The very same libstdc++ that breaks with clang and -std=gnu++0x has also the ABI breakage that prevents using C++11 anyway. Moreover, there's still the idea that we should preferably use the gnu variant, just like the default is -std=gnu++98, rather than strict C++11 (the gcc manpage for -ansi e.g. says that some builtins are disabled in this case). Change-Id: I4dac01374ee7a34796161f6e0e76eb962953e709
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac37
1 files changed, 2 insertions, 35 deletions
diff --git a/configure.ac b/configure.ac
index 696f9754064e..caac6596c978 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5658,6 +5658,8 @@ if test "$GCC" = "yes"; then
fi
AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
+ # This should check libstdc++ version, not gcc, but clang has incidentally C++11 support
+ # disabled in this case by the __float128 case below.
if test "$GCCVER" -ge 040700 -a "$GCCVER" -lt 040702; then
AC_MSG_NOTICE([Not using -std=gnu++0x on $CXX version 4.7.0/4.7.1 due to libstdc++ ABI breakage.])
else
@@ -5697,41 +5699,6 @@ return !(i != 0 && j != 0);
AC_LANG_POP([C++])
CXXFLAGS=$save_CXXFLAGS
-
- if test "$HAVE_CXX0X" != "TRUE"; then
- save_CXXFLAGS=$CXXFLAGS
- CXXFLAGS="$CXXFLAGS -std=c++11"
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- #include <stddef.h>
- #include <vector>
- // some Clang fail when compiling against GCC 4.7 headers
- // with -std=gnu++0x (__float128)
- template <typename T, size_t S> char
- (&sal_n_array_size( T(&)[S] ))[S];
- namespace
- {
- struct b
- {
- int i;
- int j;
- };
- }
- ]], [[
- struct a
- {
- int i;
- int j;
- };
- a thinga[]={{0,0}, {1,1}};
- b thingb[]={{0,0}, {1,1}};
- size_t i = sizeof(sal_n_array_size(thinga));
- size_t j = sizeof(sal_n_array_size(thingb));
- return !(i != 0 && j != 0);
- ]])],[HAVE_CXX0X=TRUE CXXFLAGS_CXX11=-std=c++11],[])
- AC_LANG_POP([C++])
- CXXFLAGS=$save_CXXFLAGS
- fi
fi
if test "$HAVE_CXX0X" = "TRUE"; then
AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])