diff options
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 30 | ||||
-rw-r--r-- | libstdc++-v3/Makefile.in | 1 | ||||
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 17 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 149 | ||||
-rw-r--r-- | libstdc++-v3/doc/Makefile.in | 1 | ||||
-rw-r--r-- | libstdc++-v3/include/Makefile.in | 1 | ||||
-rw-r--r-- | libstdc++-v3/include/std/chrono | 65 | ||||
-rw-r--r-- | libstdc++-v3/libmath/Makefile.in | 1 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/Makefile.in | 1 | ||||
-rw-r--r-- | libstdc++-v3/po/Makefile.in | 1 | ||||
-rw-r--r-- | libstdc++-v3/src/Makefile.am | 6 | ||||
-rw-r--r-- | libstdc++-v3/src/Makefile.in | 9 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc | 4 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc | 45 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc | 46 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc | 47 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/Makefile.in | 1 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/lib/libstdc++.exp | 31 |
18 files changed, 396 insertions, 60 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8c90e3a99cc..be834051e0d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,33 @@ +2008-08-01 Paolo Bonzini <bonzini@gnu.org> + Chris Fairles <chris.fairles@gmail.com> + + * acinclude.m4 ([GLIBCXX_CHECK_CLOCK_GETTIME]): Reinstate clock_gettime + search, but only in libposix4, never link librt. + * src/Makefile.am: Reinstate previous change to add GLIBCXX_LIBS. + * configure: Regenerate. + * configure.in: Likewise. + * Makefile.in: Likewise. + * src/Makefile.in: Likewise. + * libsup++/Makefile.in: Likewise. + * po/Makefile.in: Likewise. + * doc/Makefile.in: Likewise. + +2008-07-31 Chris Fairles <chris.fairles@gmail.com> + + * include/std/chrono (duration): Use explicitly defaulted ctor, cctor, + dtor and assignment. Add diagnostics as per 20.8.3 paragraphs 2, 3 + and 4 in WD. Other minor tweaks. + * testsuite/20_util/duration/cons/1_neg.cc: Adjust line numbers. + * testsuite/20_util/duration/requirements/typedefs_neg1.cc: New. + * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise. + * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise. + +2008-07-31 Paolo Carlini <paolo.carlini@oracle.com> + + * testsuite/lib/libstdc++.exp (libstdc++_init): Set v3-libgomp. + (check_v3_target_parallel_mode): Robustify, just follow the + structure of testsuite/Makefile.am. + 2008-07-29 Paolo Carlini <paolo.carlini@oracle.com> * include/debug/set.h: Minor formatting fixes. diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index 4835d08349f..f4e4a414b88 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -180,6 +180,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@ GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@ +GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index e998471c446..0a669c9a7fa 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1018,7 +1018,15 @@ AC_DEFUN([GLIBCXX_CHECK_CLOCK_GETTIME], [ AC_LANG_CPLUSPLUS ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-exceptions" - + ac_save_LIBS="$LIBS" + + AC_SEARCH_LIBS(clock_gettime, [posix4]) + + # Link to -lposix4. + case "$ac_cv_search_clock_gettime" in + -lposix4*) GLIBCXX_LIBS=$ac_cv_search_clock_gettime + esac + AC_CHECK_HEADERS(unistd.h, ac_has_unistd_h=yes, ac_has_unistd_h=no) ac_has_clock_monotonic=no; @@ -1055,13 +1063,16 @@ AC_DEFUN([GLIBCXX_CHECK_CLOCK_GETTIME], [ AC_DEFINE(_GLIBCXX_USE_CLOCK_MONOTONIC, 1, [ Defined if clock_gettime has monotonic clock support. ]) fi - + if test x"$ac_has_clock_realtime" = x"yes"; then AC_DEFINE(_GLIBCXX_USE_CLOCK_REALTIME, 1, [ Defined if clock_gettime has realtime clock support. ]) fi - + + AC_SUBST(GLIBCXX_LIBS) + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" AC_LANG_RESTORE ]) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 901a2dc1e4f..2ea940ae8a1 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -458,7 +458,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CPP CPPFLAGS EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM lt_ECHO LDFLAGS CXXCPP enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS glibcxx_thread_h WERROR SECTION_FLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_C_GLOBAL_TRUE GLIBCXX_C_HEADERS_C_GLOBAL_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE GLIBCXX_C_HEADERS_EXTRA_TRUE GLIBCXX_C_HEADERS_EXTRA_FALSE DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE ENABLE_PARALLEL_TRUE ENABLE_PARALLEL_FALSE EXTRA_CXX_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS LIBICONV LTLIBICONV SYMVER_FILE port_specific_symbol_files ENABLE_SYMVERS_TRUE ENABLE_SYMVERS_FALSE ENABLE_SYMVERS_GNU_TRUE ENABLE_SYMVERS_GNU_FALSE ENABLE_SYMVERS_GNU_NAMESPACE_TRUE ENABLE_SYMVERS_GNU_NAMESPACE_FALSE ENABLE_SYMVERS_DARWIN_TRUE ENABLE_SYMVERS_DARWIN_FALSE ENABLE_VISIBILITY_TRUE ENABLE_VISIBILITY_FALSE GLIBCXX_LDBL_COMPAT_TRUE GLIBCXX_LDBL_COMPAT_FALSE baseline_dir ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR ATOMIC_FLAGS CPU_DEFINES_SRCDIR ABI_TWEAKS_SRCDIR OS_INC_SRCDIR ERROR_CONSTANTS_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CPP CPPFLAGS EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM lt_ECHO LDFLAGS CXXCPP enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS glibcxx_thread_h WERROR SECTION_FLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_C_GLOBAL_TRUE GLIBCXX_C_HEADERS_C_GLOBAL_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE GLIBCXX_C_HEADERS_EXTRA_TRUE GLIBCXX_C_HEADERS_EXTRA_FALSE DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE ENABLE_PARALLEL_TRUE ENABLE_PARALLEL_FALSE EXTRA_CXX_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS GLIBCXX_LIBS LIBICONV LTLIBICONV SYMVER_FILE port_specific_symbol_files ENABLE_SYMVERS_TRUE ENABLE_SYMVERS_FALSE ENABLE_SYMVERS_GNU_TRUE ENABLE_SYMVERS_GNU_FALSE ENABLE_SYMVERS_GNU_NAMESPACE_TRUE ENABLE_SYMVERS_GNU_NAMESPACE_FALSE ENABLE_SYMVERS_DARWIN_TRUE ENABLE_SYMVERS_DARWIN_FALSE ENABLE_VISIBILITY_TRUE ENABLE_VISIBILITY_FALSE GLIBCXX_LDBL_COMPAT_TRUE GLIBCXX_LDBL_COMPAT_FALSE baseline_dir ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR ATOMIC_FLAGS CPU_DEFINES_SRCDIR ABI_TWEAKS_SRCDIR OS_INC_SRCDIR ERROR_CONSTANTS_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' ac_pwd=`pwd` @@ -40960,6 +40960,149 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-exceptions" + ac_save_LIBS="$LIBS" + + echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5 +echo $ECHO_N "checking for library containing clock_gettime... $ECHO_C" >&6 +if test "${ac_cv_search_clock_gettime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_clock_gettime=no +if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char clock_gettime (); +int +main () +{ +clock_gettime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_clock_gettime="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_clock_gettime" = no; then + for ac_lib in posix4; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char clock_gettime (); +int +main () +{ +clock_gettime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_clock_gettime="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5 +echo "${ECHO_T}$ac_cv_search_clock_gettime" >&6 +if test "$ac_cv_search_clock_gettime" != no; then + test "$ac_cv_search_clock_gettime" = "none required" || LIBS="$ac_cv_search_clock_gettime $LIBS" + +fi + + + # Link to -lposix4. + case "$ac_cv_search_clock_gettime" in + -lposix4*) GLIBCXX_LIBS=$ac_cv_search_clock_gettime + esac for ac_header in unistd.h @@ -41260,7 +41403,10 @@ _ACEOF fi + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -122537,6 +122683,7 @@ s,@EXTRA_CXX_FLAGS@,$EXTRA_CXX_FLAGS,;t t s,@SECTION_LDFLAGS@,$SECTION_LDFLAGS,;t t s,@OPT_LDFLAGS@,$OPT_LDFLAGS,;t t s,@LIBMATHOBJS@,$LIBMATHOBJS,;t t +s,@GLIBCXX_LIBS@,$GLIBCXX_LIBS,;t t s,@LIBICONV@,$LIBICONV,;t t s,@LTLIBICONV@,$LTLIBICONV,;t t s,@SYMVER_FILE@,$SYMVER_FILE,;t t diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in index 7ffe5766ce1..a5c842f2ce8 100644 --- a/libstdc++-v3/doc/Makefile.in +++ b/libstdc++-v3/doc/Makefile.in @@ -148,6 +148,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@ GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@ +GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index cb529671e3a..2c5d744fd4f 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -148,6 +148,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@ GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@ +GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index b5fd1fd209e..d20c7f45cd9 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -166,36 +166,51 @@ namespace std { return numeric_limits<_Rep>::min(); } }; + template<typename _Tp> + struct __is_duration + : std::false_type + { }; + + template<typename _Rep, typename _Period> + struct __is_duration<duration<_Rep, _Period>> + : std::true_type + { }; + + template<typename T> + struct __is_ratio + : std::false_type + { }; + + template<intmax_t _Num, intmax_t _Den> + struct __is_ratio<ratio<_Num, _Den>> + : std::true_type + { }; + /// duration template<typename _Rep, typename _Period> struct duration { + static_assert(!__is_duration<_Rep>::value, "rep cannot be a duration"); + static_assert(__is_ratio<_Period>::value, + "period must be a specialization of ratio"); static_assert(_Period::num > 0, "period must be positive"); typedef _Rep rep; typedef _Period period; - // construction / destruction - duration () - : __r(rep(0)) - { } + // 20.8.3.1 construction / copy / destroy + duration() = default; template<typename _Rep2> explicit duration(_Rep2 const& __rep) : __r(static_cast<rep>(__rep)) { - static_assert(is_convertible<_Rep2,rep>::value == true - && (treat_as_floating_point<rep>::value == true - || (!treat_as_floating_point<rep>::value - && !treat_as_floating_point<_Rep2>::value)), - "cannot construct integral duration with floating point type"); + static_assert(is_convertible<_Rep2,rep>::value + && (treat_as_floating_point<rep>::value + || !treat_as_floating_point<_Rep2>::value), + "cannot construct integral duration with floating point type"); } - duration(const duration& __d) - : __r(__d.count()) - { } - - // conversions template<typename _Rep2, typename _Period2> duration(const duration<_Rep2, _Period2>& __d) : __r(duration_cast<duration>(__d).count()) @@ -205,12 +220,16 @@ namespace std "the resulting duration is not exactly representable"); } - // observer + ~duration() = default; + duration(const duration&) = default; + duration& operator=(const duration&) = default; + + // 20.8.3.2 observer rep count() const { return __r; } - // arithmetic + // 20.8.3.3 arithmetic duration operator+() const { return *this; } @@ -269,7 +288,7 @@ namespace std return *this; } - // special values + // 20.8.3.4 special values // TODO: These should be constexprs. static const duration zero() @@ -324,22 +343,12 @@ namespace std operator*(const _Rep2& __s, const duration<_Rep1, _Period>& __d) { return __d * __s; } - template<typename _Tp> - struct __is_not_duration - : std::true_type - { }; - - template<typename _Rep, typename _Period> - struct __is_not_duration<duration<_Rep, _Period>> - : std::false_type - { }; - template<typename _Tp, typename _Up, typename _Ep = void> struct __division_impl; template<typename _Rep1, typename _Period, typename _Rep2> struct __division_impl<duration<_Rep1, _Period>, _Rep2, - typename enable_if<__is_not_duration<_Rep2>::value>::type> + typename enable_if<!__is_duration<_Rep2>::value>::type> { typedef typename common_type<_Rep1, _Rep2>::type __cr; typedef diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in index 1db093b15cc..1592897335e 100644 --- a/libstdc++-v3/libmath/Makefile.in +++ b/libstdc++-v3/libmath/Makefile.in @@ -163,6 +163,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@ GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@ +GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index 0f7cf8c517e..105aec63d8d 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -218,6 +218,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@ GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@ +GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in index c79788dac38..b19c1b4d94b 100644 --- a/libstdc++-v3/po/Makefile.in +++ b/libstdc++-v3/po/Makefile.in @@ -148,6 +148,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@ GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@ +GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index 6ea357f2ce9..cf4522fe28a 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -196,10 +196,14 @@ vpath % $(top_srcdir) libstdc___la_SOURCES = $(sources) libstdc___la_LIBADD = \ + $(GLIBCXX_LIBS) \ $(top_builddir)/libmath/libmath.la \ $(top_builddir)/libsupc++/libsupc++convenience.la -libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD) +libstdc___la_DEPENDENCIES = \ + ${version_dep} \ + $(top_builddir)/libmath/libmath.la \ + $(top_builddir)/libsupc++/libsupc++convenience.la libstdc___la_LDFLAGS = \ -version-info $(libtool_VERSION) ${version_arg} -lm diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index b674061d3a8..6c2030a845e 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -72,6 +72,7 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(toolexeclibdir)" toolexeclibLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(toolexeclib_LTLIBRARIES) +am__DEPENDENCIES_1 = am__libstdc___la_SOURCES_DIST = atomic.cc bitmap_allocator.cc \ pool_allocator.cc mt_allocator.cc codecvt.cc compatibility.cc \ complex_io.cc ctype.cc debug.cc functexcept.cc hash.cc \ @@ -205,6 +206,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@ GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@ +GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -428,10 +430,15 @@ sources = \ libstdc___la_SOURCES = $(sources) libstdc___la_LIBADD = \ + $(GLIBCXX_LIBS) \ + $(top_builddir)/libmath/libmath.la \ + $(top_builddir)/libsupc++/libsupc++convenience.la + +libstdc___la_DEPENDENCIES = \ + ${version_dep} \ $(top_builddir)/libmath/libmath.la \ $(top_builddir)/libsupc++/libsupc++convenience.la -libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD) libstdc___la_LDFLAGS = \ -version-info $(libtool_VERSION) ${version_arg} -lm diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc index fa63dab22b5..d8b08dbd4f8 100644 --- a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc +++ b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc @@ -41,6 +41,6 @@ test02() // { dg-error "instantiated from here" "" { target *-*-* } 30 } // { dg-error "instantiated from here" "" { target *-*-* } 39 } -// { dg-error "not exactly representable" "" { target *-*-* } 203 } -// { dg-error "integral duration with floating point" "" { target *-*-* } 187 } +// { dg-error "not exactly representable" "" { target *-*-* } 218 } +// { dg-error "integral duration with floating point" "" { target *-*-* } 208 } // { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc new file mode 100644 index 00000000000..188950d6347 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc @@ -0,0 +1,45 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } +// 2008-07-31 Chris Fairles <chris.fairles@gmail.com> + +// Copyright (C) 2008 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#include <chrono> + +void test01() +{ + // Check if rep is a duration type + typedef std::chrono::duration<int> rep_type; + typedef std::chrono::duration<rep_type> test_type; + test_type d; +} + +// { dg-error "rep cannot be a duration" "" { target *-*-* } 193 } +// { dg-error "instantiated from here" "" { target *-*-* } 40 } +// { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc new file mode 100644 index 00000000000..783044fada6 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc @@ -0,0 +1,46 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } +// 2008-07-31 Chris Fairles <chris.fairles@gmail.com> + +// Copyright (C) 2008 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#include <chrono> + +void test01() +{ + // Check if period is a ratio + typedef int rep_type; + typedef int period_type; + typedef std::chrono::duration<rep_type, period_type> test_type; + test_type d; +} + +// { dg-error "must be a specialization of ratio" "" { target *-*-* } 194 } +// { dg-error "instantiated from here" "" { target *-*-* } 41 } +// { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc new file mode 100644 index 00000000000..2896845d7d2 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc @@ -0,0 +1,47 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } +// 2008-07-31 Chris Fairles <chris.fairles@gmail.com> + +// Copyright (C) 2008 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#include <ratio> +#include <chrono> + +void test01() +{ + // Check if period is positive + typedef int rep_type; + typedef std::ratio<-1> period_type; + typedef std::chrono::duration<rep_type, period_type> test_type; + test_type d; +} + +// { dg-error "period must be positive" "" { target *-*-* } 196 } +// { dg-error "instantiated from here" "" { target *-*-* } 42 } +// { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index c029ced7612..4bd6419a506 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -152,6 +152,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@ GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@ +GLIBCXX_LIBS = @GLIBCXX_LIBS@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index afcaa19d136..9412ce976ad 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -81,7 +81,7 @@ proc v3-copy-files {srcfiles} { # Called once, during runtest.exp setup. proc libstdc++_init { testfile } { global env - global v3-sharedlib + global v3-sharedlib v3-libgomp global srcdir blddir objdir tool_root_dir global cc cxx cxxflags cxxpchflags cxxldflags global includes @@ -135,10 +135,13 @@ proc libstdc++_init { testfile } { v3track gccdir 3 # Locate libgomp. This is only required for parallel mode. + set v3-libgomp 0 set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.so] if {$libgompdir != ""} { + set v3-libgomp 1 set libgompdir [file dirname $libgompdir] append ld_library_path_tmp ":${libgompdir}" + verbose -log "libgomp support detected" } v3track libgompdir 3 @@ -968,7 +971,7 @@ proc check_v3_target_debug_mode { } { proc check_v3_target_parallel_mode { } { global cxxflags - global DEFAULT_CXXFLAGS + global v3-libgomp global et_parallel_mode global tool @@ -993,29 +996,9 @@ proc check_v3_target_parallel_mode { } { } else { set et_parallel_mode 0 - # Set up and compile a C++ test program that depends - # on parallel mode working. - set src parallel_mode[pid].cc - set exe parallel_mode[pid].exe - - set f [open $src "w"] - puts $f "#include <omp.h>" - puts $f "int main()" - puts $f "{ return 0; }" - close $f - - set cxxflags_saved $cxxflags - set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror" - - set lines [v3_target_compile $src $exe executable ""] - set cxxflags $cxxflags_saved - file delete $src - - if [string match "" $lines] { - # No error message, compilation succeeded. + # If 'make check-parallel' is running the test succeeds. + if { ${v3-libgomp} == 1 && [regexp "libgomp" $cxxflags] } { set et_parallel_mode 1 - } else { - verbose "check_v3_target_parallel_mode: compilation failed" 2 } } verbose "check_v3_target_parallel_mode: $et_parallel_mode" 2 |