rice 2.1.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +5 -5
  2. data/COPYING +2 -2
  3. data/Doxyfile +4 -16
  4. data/Makefile.am +2 -2
  5. data/Makefile.in +28 -17
  6. data/{README → README.md} +323 -328
  7. data/aclocal.m4 +104 -107
  8. data/ax_cxx_compile_stdcxx.m4 +951 -0
  9. data/configure +549 -238
  10. data/configure.ac +3 -3
  11. data/extconf.rb +11 -10
  12. data/rice/Array.hpp +16 -16
  13. data/rice/Array.ipp +11 -11
  14. data/rice/Class_defn.hpp +1 -0
  15. data/rice/Constructor.hpp +27 -371
  16. data/rice/Data_Object_defn.hpp +3 -3
  17. data/rice/Director.hpp +3 -3
  18. data/rice/Enum.ipp +1 -1
  19. data/rice/Exception.cpp +2 -7
  20. data/rice/Hash.hpp +8 -5
  21. data/rice/Hash.ipp +2 -2
  22. data/rice/Makefile.am +1 -4
  23. data/rice/Makefile.in +80 -35
  24. data/rice/Module_impl.ipp +1 -1
  25. data/rice/Object.cpp +1 -1
  26. data/rice/Object.ipp +15 -1
  27. data/rice/Object_defn.hpp +24 -1
  28. data/rice/String.cpp +2 -7
  29. data/rice/Struct.cpp +2 -2
  30. data/rice/Struct.hpp +1 -1
  31. data/rice/Struct.ipp +1 -1
  32. data/rice/config.hpp +2 -2
  33. data/rice/config.hpp.in +2 -2
  34. data/rice/detail/Arguments.hpp +1 -1
  35. data/rice/detail/Auto_Function_Wrapper.ipp +512 -1025
  36. data/rice/detail/Auto_Member_Function_Wrapper.ipp +272 -545
  37. data/rice/detail/Iterator.hpp +2 -2
  38. data/rice/detail/method_data.cpp +8 -2
  39. data/rice/detail/ruby.hpp +1 -4
  40. data/rice/detail/ruby_version_code.hpp +1 -1
  41. data/rice/detail/wrap_function.hpp +32 -307
  42. data/rice/protect.hpp +3 -57
  43. data/rice/to_from_ruby.ipp +128 -4
  44. data/ruby/Makefile.in +11 -8
  45. data/ruby/lib/Makefile.in +10 -7
  46. data/ruby/lib/version.rb +1 -1
  47. data/sample/Makefile.am +10 -4
  48. data/sample/Makefile.in +20 -11
  49. data/sample/callbacks/extconf.rb +3 -0
  50. data/sample/callbacks/sample_callbacks.cpp +38 -0
  51. data/sample/callbacks/test.rb +28 -0
  52. data/test/Makefile.am +1 -0
  53. data/test/Makefile.in +118 -49
  54. data/test/embed_ruby.cpp +21 -0
  55. data/test/embed_ruby.hpp +4 -0
  56. data/test/ext/Makefile.in +10 -7
  57. data/test/test_Address_Registration_Guard.cpp +2 -1
  58. data/test/test_Array.cpp +2 -1
  59. data/test/test_Builtin_Object.cpp +2 -1
  60. data/test/test_Class.cpp +7 -4
  61. data/test/test_Data_Object.cpp +2 -1
  62. data/test/test_Data_Type.cpp +2 -1
  63. data/test/test_Director.cpp +2 -1
  64. data/test/test_Enum.cpp +24 -3
  65. data/test/test_Exception.cpp +2 -1
  66. data/test/test_Hash.cpp +2 -1
  67. data/test/test_Identifier.cpp +2 -1
  68. data/test/test_Memory_Management.cpp +2 -1
  69. data/test/test_Module.cpp +2 -1
  70. data/test/test_Object.cpp +13 -1
  71. data/test/test_String.cpp +2 -1
  72. data/test/test_Struct.cpp +2 -1
  73. data/test/test_Symbol.cpp +2 -1
  74. data/test/test_To_From_Ruby.cpp +102 -1
  75. data/test/test_global_functions.cpp +2 -1
  76. data/test/test_rice.rb +4 -0
  77. data/test/unittest.cpp +35 -9
  78. metadata +72 -16
  79. data/check_stdcxx_11.ac +0 -142
  80. data/rice/detail/object_call.hpp +0 -69
  81. data/rice/detail/object_call.ipp +0 -131
  82. data/rice/detail/traits.hpp +0 -43
  83. data/rice/detail/wrap_function.ipp +0 -514
data/configure CHANGED
@@ -645,7 +645,7 @@ RUBY_CPPFLAGS
645
645
  RUBY_VERSION_CODE
646
646
  RUBY
647
647
  RICE_USING_MINGW32
648
- HAVE_CXX11
648
+ HAVE_CXX14
649
649
  host_os
650
650
  host_vendor
651
651
  host_cpu
@@ -664,7 +664,6 @@ am__nodep
664
664
  AMDEPBACKSLASH
665
665
  AMDEP_FALSE
666
666
  AMDEP_TRUE
667
- am__quote
668
667
  am__include
669
668
  DEPDIR
670
669
  OBJEXT
@@ -738,7 +737,8 @@ PACKAGE_VERSION
738
737
  PACKAGE_TARNAME
739
738
  PACKAGE_NAME
740
739
  PATH_SEPARATOR
741
- SHELL'
740
+ SHELL
741
+ am__quote'
742
742
  ac_subst_files=''
743
743
  ac_user_opts='
744
744
  enable_option_checking
@@ -1922,7 +1922,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
1922
1922
 
1923
1923
 
1924
1924
 
1925
- am__api_version='1.15'
1925
+ am__api_version='1.16'
1926
1926
 
1927
1927
  ac_aux_dir=
1928
1928
  for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2127,12 +2127,7 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
2127
2127
  am_aux_dir=`cd "$ac_aux_dir" && pwd`
2128
2128
 
2129
2129
  if test x"${MISSING+set}" != xset; then
2130
- case \"$am_aux_dir\" in
2131
- *\ * | *\ *)
2132
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2133
- *)
2134
- MISSING="\${SHELL} \"$am_aux_dir\"/missing" ;;
2135
- esac
2130
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
2136
2131
  fi
2137
2132
  # Use eval to expand $SHELL
2138
2133
  if eval "$MISSING --is-lightweight"; then
@@ -2467,8 +2462,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
2467
2462
 
2468
2463
  # For better backward compatibility. To be removed once Automake 1.9.x
2469
2464
  # dies out for good. For more background, see:
2470
- # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2471
- # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2465
+ # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2466
+ # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2472
2467
  mkdir_p='$(MKDIR_P)'
2473
2468
 
2474
2469
  # We need awk for the "check" target (and possibly the TAP driver). The
@@ -2519,7 +2514,7 @@ END
2519
2514
  Aborting the configuration process, to ensure you take notice of the issue.
2520
2515
 
2521
2516
  You can download and install GNU coreutils to get an 'rm' implementation
2522
- that behaves properly: <http://www.gnu.org/software/coreutils/>.
2517
+ that behaves properly: <https://www.gnu.org/software/coreutils/>.
2523
2518
 
2524
2519
  If you want to complete the configuration process using your problematic
2525
2520
  'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3050,45 +3045,45 @@ DEPDIR="${am__leading_dot}deps"
3050
3045
 
3051
3046
  ac_config_commands="$ac_config_commands depfiles"
3052
3047
 
3053
-
3054
- am_make=${MAKE-make}
3055
- cat > confinc << 'END'
3048
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
3049
+ $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
3050
+ cat > confinc.mk << 'END'
3056
3051
  am__doit:
3057
- @echo this is the am__doit target
3052
+ @echo this is the am__doit target >confinc.out
3058
3053
  .PHONY: am__doit
3059
3054
  END
3060
- # If we don't find an include directive, just comment out the code.
3061
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3062
- $as_echo_n "checking for style of include used by $am_make... " >&6; }
3063
3055
  am__include="#"
3064
3056
  am__quote=
3065
- _am_result=none
3066
- # First try GNU make style include.
3067
- echo "include confinc" > confmf
3068
- # Ignore all kinds of additional output from 'make'.
3069
- case `$am_make -s -f confmf 2> /dev/null` in #(
3070
- *the\ am__doit\ target*)
3071
- am__include=include
3072
- am__quote=
3073
- _am_result=GNU
3074
- ;;
3075
- esac
3076
- # Now try BSD make style include.
3077
- if test "$am__include" = "#"; then
3078
- echo '.include "confinc"' > confmf
3079
- case `$am_make -s -f confmf 2> /dev/null` in #(
3080
- *the\ am__doit\ target*)
3081
- am__include=.include
3082
- am__quote="\""
3083
- _am_result=BSD
3057
+ # BSD make does it like this.
3058
+ echo '.include "confinc.mk" # ignored' > confmf.BSD
3059
+ # Other make implementations (GNU, Solaris 10, AIX) do it like this.
3060
+ echo 'include confinc.mk # ignored' > confmf.GNU
3061
+ _am_result=no
3062
+ for s in GNU BSD; do
3063
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
3064
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
3065
+ ac_status=$?
3066
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
3067
+ (exit $ac_status); }
3068
+ case $?:`cat confinc.out 2>/dev/null` in #(
3069
+ '0:this is the am__doit target') :
3070
+ case $s in #(
3071
+ BSD) :
3072
+ am__include='.include' am__quote='"' ;; #(
3073
+ *) :
3074
+ am__include='include' am__quote='' ;;
3075
+ esac ;; #(
3076
+ *) :
3084
3077
  ;;
3085
- esac
3086
- fi
3087
-
3088
-
3089
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
3090
- $as_echo "$_am_result" >&6; }
3091
- rm -f confinc confmf
3078
+ esac
3079
+ if test "$am__include" != "#"; then
3080
+ _am_result="yes ($s style)"
3081
+ break
3082
+ fi
3083
+ done
3084
+ rm -f confinc.* confmf.*
3085
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
3086
+ $as_echo "${_am_result}" >&6; }
3092
3087
 
3093
3088
  # Check whether --enable-dependency-tracking was given.
3094
3089
  if test "${enable_dependency_tracking+set}" = set; then :
@@ -3420,198 +3415,506 @@ else
3420
3415
  RICE_USING_MINGW32="false"
3421
3416
  fi
3422
3417
 
3423
- # ============================================================================
3424
- # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
3425
- # ============================================================================
3418
+ # ===========================================================================
3419
+ # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
3420
+ # ===========================================================================
3426
3421
  #
3427
3422
  # SYNOPSIS
3428
3423
  #
3429
- # AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
3424
+ # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
3430
3425
  #
3431
3426
  # DESCRIPTION
3432
3427
  #
3433
- # Check for baseline language coverage in the compiler for the C++11
3434
- # standard; if necessary, add switches to CXXFLAGS to enable support.
3428
+ # Check for baseline language coverage in the compiler for the specified
3429
+ # version of the C++ standard. If necessary, add switches to CXX and
3430
+ # CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
3431
+ # or '14' (for the C++14 standard).
3435
3432
  #
3436
- # The first argument, if specified, indicates whether you insist on an
3433
+ # The second argument, if specified, indicates whether you insist on an
3437
3434
  # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
3438
3435
  # -std=c++11). If neither is specified, you get whatever works, with
3439
3436
  # preference for an extended mode.
3440
3437
  #
3441
- # The second argument, if specified 'mandatory' or if left unspecified,
3442
- # indicates that baseline C++11 support is required and that the macro
3443
- # should error out if no mode with that support is found. If specified
3444
- # 'optional', then configuration proceeds regardless, after defining
3445
- # HAVE_CXX11 if and only if a supporting mode is found.
3438
+ # The third argument, if specified 'mandatory' or if left unspecified,
3439
+ # indicates that baseline support for the specified C++ standard is
3440
+ # required and that the macro should error out if no mode with that
3441
+ # support is found. If specified 'optional', then configuration proceeds
3442
+ # regardless, after defining HAVE_CXX${VERSION} if and only if a
3443
+ # supporting mode is found.
3446
3444
  #
3447
3445
  # LICENSE
3448
3446
  #
3449
3447
  # Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
3450
3448
  # Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
3451
3449
  # Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
3452
- # Copyright (c) 2014 Alexey Sokolov <sokolov@google.com>
3450
+ # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
3451
+ # Copyright (c) 2015 Paul Norman <penorman@mac.com>
3452
+ # Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
3453
+ # Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
3454
+ # Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
3453
3455
  #
3454
3456
  # Copying and distribution of this file, with or without modification, are
3455
3457
  # permitted in any medium without royalty provided the copyright notice
3456
- # and this notice are preserved. This file is offered as-is, without any
3458
+ # and this notice are preserved. This file is offered as-is, without any
3457
3459
  # warranty.
3458
3460
 
3459
- #serial 4
3461
+ #serial 11
3462
+
3463
+
3464
+
3465
+
3466
+
3467
+
3468
+
3469
+
3470
+
3471
+
3472
+
3473
+
3474
+
3475
+
3476
+
3477
+
3460
3478
 
3461
3479
 
3462
3480
 
3463
3481
 
3464
3482
 
3465
3483
 
3466
- ax_cxx_compile_cxx11_required=false
3484
+
3485
+
3486
+
3487
+
3488
+ ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=true
3467
3489
  ac_ext=cpp
3468
3490
  ac_cpp='$CXXCPP $CPPFLAGS'
3469
3491
  ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3470
3492
  ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3471
3493
  ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
3472
3494
  ac_success=no
3473
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
3474
- $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
3475
- if ${ax_cv_cxx_compile_cxx11+:} false; then :
3495
+
3496
+
3497
+
3498
+ if test x$ac_success = xno; then
3499
+ for alternative in ${ax_cxx_compile_alternatives}; do
3500
+ for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
3501
+ cachevar=`$as_echo "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh`
3502
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5
3503
+ $as_echo_n "checking whether $CXX supports C++14 features with $switch... " >&6; }
3504
+ if eval \${$cachevar+:} false; then :
3476
3505
  $as_echo_n "(cached) " >&6
3477
3506
  else
3478
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3507
+ ac_save_CXX="$CXX"
3508
+ CXX="$CXX $switch"
3509
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3479
3510
  /* end confdefs.h. */
3480
3511
 
3481
- template <typename T>
3512
+
3513
+ // If the compiler admits that it is not ready for C++11, why torture it?
3514
+ // Hopefully, this will speed up the test.
3515
+
3516
+ #ifndef __cplusplus
3517
+
3518
+ #error "This is not a C++ compiler"
3519
+
3520
+ #elif __cplusplus < 201103L
3521
+
3522
+ #error "This is not a C++11 compiler"
3523
+
3524
+ #else
3525
+
3526
+ namespace cxx11
3527
+ {
3528
+
3529
+ namespace test_static_assert
3530
+ {
3531
+
3532
+ template <typename T>
3482
3533
  struct check
3483
3534
  {
3484
3535
  static_assert(sizeof(int) <= sizeof(T), "not big enough");
3485
3536
  };
3486
3537
 
3487
- struct Base {
3488
- virtual void f() {}
3538
+ }
3539
+
3540
+ namespace test_final_override
3541
+ {
3542
+
3543
+ struct Base
3544
+ {
3545
+ virtual ~Base() {}
3546
+ virtual void f() {}
3489
3547
  };
3490
- struct Child : public Base {
3491
- virtual void f() override {}
3548
+
3549
+ struct Derived : public Base
3550
+ {
3551
+ virtual ~Derived() override {}
3552
+ virtual void f() override {}
3492
3553
  };
3493
3554
 
3494
- typedef check<check<bool>> right_angle_brackets;
3555
+ }
3495
3556
 
3496
- int a;
3497
- decltype(a) b;
3557
+ namespace test_double_right_angle_brackets
3558
+ {
3498
3559
 
3499
- typedef check<int> check_type;
3500
- check_type c;
3501
- check_type&& cr = static_cast<check_type&&>(c);
3560
+ template < typename T >
3561
+ struct check {};
3502
3562
 
3503
- auto d = a;
3504
- auto l = [](){};
3563
+ typedef check<void> single_type;
3564
+ typedef check<check<void>> double_type;
3565
+ typedef check<check<check<void>>> triple_type;
3566
+ typedef check<check<check<check<void>>>> quadruple_type;
3505
3567
 
3506
- _ACEOF
3507
- if ac_fn_cxx_try_compile "$LINENO"; then :
3508
- ax_cv_cxx_compile_cxx11=yes
3509
- else
3510
- ax_cv_cxx_compile_cxx11=no
3511
- fi
3512
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3513
- fi
3514
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
3515
- $as_echo "$ax_cv_cxx_compile_cxx11" >&6; }
3516
- if test x$ax_cv_cxx_compile_cxx11 = xyes; then
3517
- ac_success=yes
3518
- fi
3568
+ }
3519
3569
 
3520
- if test x$ac_success = xno; then
3521
- for switch in -std=gnu++11 -std=gnu++0x; do
3522
- cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
3523
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
3524
- $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
3525
- if eval \${$cachevar+:} false; then :
3526
- $as_echo_n "(cached) " >&6
3527
- else
3528
- ac_save_CXXFLAGS="$CXXFLAGS"
3529
- CXXFLAGS="$CXXFLAGS $switch"
3530
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3531
- /* end confdefs.h. */
3570
+ namespace test_decltype
3571
+ {
3532
3572
 
3533
- template <typename T>
3534
- struct check
3573
+ int
3574
+ f()
3535
3575
  {
3536
- static_assert(sizeof(int) <= sizeof(T), "not big enough");
3576
+ int a = 1;
3577
+ decltype(a) b = 2;
3578
+ return a + b;
3579
+ }
3580
+
3581
+ }
3582
+
3583
+ namespace test_type_deduction
3584
+ {
3585
+
3586
+ template < typename T1, typename T2 >
3587
+ struct is_same
3588
+ {
3589
+ static const bool value = false;
3537
3590
  };
3538
3591
 
3539
- struct Base {
3540
- virtual void f() {}
3592
+ template < typename T >
3593
+ struct is_same<T, T>
3594
+ {
3595
+ static const bool value = true;
3541
3596
  };
3542
- struct Child : public Base {
3543
- virtual void f() override {}
3597
+
3598
+ template < typename T1, typename T2 >
3599
+ auto
3600
+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
3601
+ {
3602
+ return a1 + a2;
3603
+ }
3604
+
3605
+ int
3606
+ test(const int c, volatile int v)
3607
+ {
3608
+ static_assert(is_same<int, decltype(0)>::value == true, "");
3609
+ static_assert(is_same<int, decltype(c)>::value == false, "");
3610
+ static_assert(is_same<int, decltype(v)>::value == false, "");
3611
+ auto ac = c;
3612
+ auto av = v;
3613
+ auto sumi = ac + av + 'x';
3614
+ auto sumf = ac + av + 1.0;
3615
+ static_assert(is_same<int, decltype(ac)>::value == true, "");
3616
+ static_assert(is_same<int, decltype(av)>::value == true, "");
3617
+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
3618
+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
3619
+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
3620
+ return (sumf > 0.0) ? sumi : add(c, v);
3621
+ }
3622
+
3623
+ }
3624
+
3625
+ namespace test_noexcept
3626
+ {
3627
+
3628
+ int f() { return 0; }
3629
+ int g() noexcept { return 0; }
3630
+
3631
+ static_assert(noexcept(f()) == false, "");
3632
+ static_assert(noexcept(g()) == true, "");
3633
+
3634
+ }
3635
+
3636
+ namespace test_constexpr
3637
+ {
3638
+
3639
+ template < typename CharT >
3640
+ unsigned long constexpr
3641
+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
3642
+ {
3643
+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
3644
+ }
3645
+
3646
+ template < typename CharT >
3647
+ unsigned long constexpr
3648
+ strlen_c(const CharT *const s) noexcept
3649
+ {
3650
+ return strlen_c_r(s, 0UL);
3651
+ }
3652
+
3653
+ static_assert(strlen_c("") == 0UL, "");
3654
+ static_assert(strlen_c("1") == 1UL, "");
3655
+ static_assert(strlen_c("example") == 7UL, "");
3656
+ static_assert(strlen_c("another\0example") == 7UL, "");
3657
+
3658
+ }
3659
+
3660
+ namespace test_rvalue_references
3661
+ {
3662
+
3663
+ template < int N >
3664
+ struct answer
3665
+ {
3666
+ static constexpr int value = N;
3544
3667
  };
3545
3668
 
3546
- typedef check<check<bool>> right_angle_brackets;
3669
+ answer<1> f(int&) { return answer<1>(); }
3670
+ answer<2> f(const int&) { return answer<2>(); }
3671
+ answer<3> f(int&&) { return answer<3>(); }
3547
3672
 
3548
- int a;
3549
- decltype(a) b;
3673
+ void
3674
+ test()
3675
+ {
3676
+ int i = 0;
3677
+ const int c = 0;
3678
+ static_assert(decltype(f(i))::value == 1, "");
3679
+ static_assert(decltype(f(c))::value == 2, "");
3680
+ static_assert(decltype(f(0))::value == 3, "");
3681
+ }
3550
3682
 
3551
- typedef check<int> check_type;
3552
- check_type c;
3553
- check_type&& cr = static_cast<check_type&&>(c);
3683
+ }
3554
3684
 
3555
- auto d = a;
3556
- auto l = [](){};
3685
+ namespace test_uniform_initialization
3686
+ {
3557
3687
 
3558
- _ACEOF
3559
- if ac_fn_cxx_try_compile "$LINENO"; then :
3560
- eval $cachevar=yes
3561
- else
3562
- eval $cachevar=no
3563
- fi
3564
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3565
- CXXFLAGS="$ac_save_CXXFLAGS"
3566
- fi
3567
- eval ac_res=\$$cachevar
3568
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3569
- $as_echo "$ac_res" >&6; }
3570
- if eval test x\$$cachevar = xyes; then
3571
- CXXFLAGS="$CXXFLAGS $switch"
3572
- ac_success=yes
3573
- break
3574
- fi
3575
- done
3576
- fi
3688
+ struct test
3689
+ {
3690
+ static const int zero {};
3691
+ static const int one {1};
3692
+ };
3577
3693
 
3578
- if test x$ac_success = xno; then
3579
- for switch in -std=c++11 -std=c++0x; do
3580
- cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
3581
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
3582
- $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
3583
- if eval \${$cachevar+:} false; then :
3584
- $as_echo_n "(cached) " >&6
3585
- else
3586
- ac_save_CXXFLAGS="$CXXFLAGS"
3587
- CXXFLAGS="$CXXFLAGS $switch"
3588
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3589
- /* end confdefs.h. */
3694
+ static_assert(test::zero == 0, "");
3695
+ static_assert(test::one == 1, "");
3590
3696
 
3591
- template <typename T>
3592
- struct check
3697
+ }
3698
+
3699
+ namespace test_lambdas
3700
+ {
3701
+
3702
+ void
3703
+ test1()
3593
3704
  {
3594
- static_assert(sizeof(int) <= sizeof(T), "not big enough");
3705
+ auto lambda1 = [](){};
3706
+ auto lambda2 = lambda1;
3707
+ lambda1();
3708
+ lambda2();
3709
+ }
3710
+
3711
+ int
3712
+ test2()
3713
+ {
3714
+ auto a = [](int i, int j){ return i + j; }(1, 2);
3715
+ auto b = []() -> int { return '0'; }();
3716
+ auto c = [=](){ return a + b; }();
3717
+ auto d = [&](){ return c; }();
3718
+ auto e = [a, &b](int x) mutable {
3719
+ const auto identity = [](int y){ return y; };
3720
+ for (auto i = 0; i < a; ++i)
3721
+ a += b--;
3722
+ return x + identity(a + b);
3723
+ }(0);
3724
+ return a + b + c + d + e;
3725
+ }
3726
+
3727
+ int
3728
+ test3()
3729
+ {
3730
+ const auto nullary = [](){ return 0; };
3731
+ const auto unary = [](int x){ return x; };
3732
+ using nullary_t = decltype(nullary);
3733
+ using unary_t = decltype(unary);
3734
+ const auto higher1st = [](nullary_t f){ return f(); };
3735
+ const auto higher2nd = [unary](nullary_t f1){
3736
+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
3737
+ };
3738
+ return higher1st(nullary) + higher2nd(nullary)(unary);
3739
+ }
3740
+
3741
+ }
3742
+
3743
+ namespace test_variadic_templates
3744
+ {
3745
+
3746
+ template <int...>
3747
+ struct sum;
3748
+
3749
+ template <int N0, int... N1toN>
3750
+ struct sum<N0, N1toN...>
3751
+ {
3752
+ static constexpr auto value = N0 + sum<N1toN...>::value;
3753
+ };
3754
+
3755
+ template <>
3756
+ struct sum<>
3757
+ {
3758
+ static constexpr auto value = 0;
3595
3759
  };
3596
3760
 
3597
- struct Base {
3598
- virtual void f() {}
3761
+ static_assert(sum<>::value == 0, "");
3762
+ static_assert(sum<1>::value == 1, "");
3763
+ static_assert(sum<23>::value == 23, "");
3764
+ static_assert(sum<1, 2>::value == 3, "");
3765
+ static_assert(sum<5, 5, 11>::value == 21, "");
3766
+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
3767
+
3768
+ }
3769
+
3770
+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
3771
+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
3772
+ // because of this.
3773
+ namespace test_template_alias_sfinae
3774
+ {
3775
+
3776
+ struct foo {};
3777
+
3778
+ template<typename T>
3779
+ using member = typename T::member_type;
3780
+
3781
+ template<typename T>
3782
+ void func(...) {}
3783
+
3784
+ template<typename T>
3785
+ void func(member<T>*) {}
3786
+
3787
+ void test();
3788
+
3789
+ void test() { func<foo>(0); }
3790
+
3791
+ }
3792
+
3793
+ } // namespace cxx11
3794
+
3795
+ #endif // __cplusplus >= 201103L
3796
+
3797
+
3798
+
3799
+
3800
+ // If the compiler admits that it is not ready for C++14, why torture it?
3801
+ // Hopefully, this will speed up the test.
3802
+
3803
+ #ifndef __cplusplus
3804
+
3805
+ #error "This is not a C++ compiler"
3806
+
3807
+ #elif __cplusplus < 201402L
3808
+
3809
+ #error "This is not a C++14 compiler"
3810
+
3811
+ #else
3812
+
3813
+ namespace cxx14
3814
+ {
3815
+
3816
+ namespace test_polymorphic_lambdas
3817
+ {
3818
+
3819
+ int
3820
+ test()
3821
+ {
3822
+ const auto lambda = [](auto&&... args){
3823
+ const auto istiny = [](auto x){
3824
+ return (sizeof(x) == 1UL) ? 1 : 0;
3825
+ };
3826
+ const int aretiny[] = { istiny(args)... };
3827
+ return aretiny[0];
3828
+ };
3829
+ return lambda(1, 1L, 1.0f, '1');
3830
+ }
3831
+
3832
+ }
3833
+
3834
+ namespace test_binary_literals
3835
+ {
3836
+
3837
+ constexpr auto ivii = 0b0000000000101010;
3838
+ static_assert(ivii == 42, "wrong value");
3839
+
3840
+ }
3841
+
3842
+ namespace test_generalized_constexpr
3843
+ {
3844
+
3845
+ template < typename CharT >
3846
+ constexpr unsigned long
3847
+ strlen_c(const CharT *const s) noexcept
3848
+ {
3849
+ auto length = 0UL;
3850
+ for (auto p = s; *p; ++p)
3851
+ ++length;
3852
+ return length;
3853
+ }
3854
+
3855
+ static_assert(strlen_c("") == 0UL, "");
3856
+ static_assert(strlen_c("x") == 1UL, "");
3857
+ static_assert(strlen_c("test") == 4UL, "");
3858
+ static_assert(strlen_c("another\0test") == 7UL, "");
3859
+
3860
+ }
3861
+
3862
+ namespace test_lambda_init_capture
3863
+ {
3864
+
3865
+ int
3866
+ test()
3867
+ {
3868
+ auto x = 0;
3869
+ const auto lambda1 = [a = x](int b){ return a + b; };
3870
+ const auto lambda2 = [a = lambda1(x)](){ return a; };
3871
+ return lambda2();
3872
+ }
3873
+
3874
+ }
3875
+
3876
+ namespace test_digit_separators
3877
+ {
3878
+
3879
+ constexpr auto ten_million = 100'000'000;
3880
+ static_assert(ten_million == 100000000, "");
3881
+
3882
+ }
3883
+
3884
+ namespace test_return_type_deduction
3885
+ {
3886
+
3887
+ auto f(int& x) { return x; }
3888
+ decltype(auto) g(int& x) { return x; }
3889
+
3890
+ template < typename T1, typename T2 >
3891
+ struct is_same
3892
+ {
3893
+ static constexpr auto value = false;
3599
3894
  };
3600
- struct Child : public Base {
3601
- virtual void f() override {}
3895
+
3896
+ template < typename T >
3897
+ struct is_same<T, T>
3898
+ {
3899
+ static constexpr auto value = true;
3602
3900
  };
3603
3901
 
3604
- typedef check<check<bool>> right_angle_brackets;
3902
+ int
3903
+ test()
3904
+ {
3905
+ auto x = 0;
3906
+ static_assert(is_same<int, decltype(f(x))>::value, "");
3907
+ static_assert(is_same<int&, decltype(g(x))>::value, "");
3908
+ return x;
3909
+ }
3910
+
3911
+ }
3912
+
3913
+ } // namespace cxx14
3605
3914
 
3606
- int a;
3607
- decltype(a) b;
3915
+ #endif // __cplusplus >= 201402L
3608
3916
 
3609
- typedef check<int> check_type;
3610
- check_type c;
3611
- check_type&& cr = static_cast<check_type&&>(c);
3612
3917
 
3613
- auto d = a;
3614
- auto l = [](){};
3615
3918
 
3616
3919
  _ACEOF
3617
3920
  if ac_fn_cxx_try_compile "$LINENO"; then :
@@ -3620,14 +3923,21 @@ else
3620
3923
  eval $cachevar=no
3621
3924
  fi
3622
3925
  rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3623
- CXXFLAGS="$ac_save_CXXFLAGS"
3926
+ CXX="$ac_save_CXX"
3624
3927
  fi
3625
3928
  eval ac_res=\$$cachevar
3626
3929
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3627
3930
  $as_echo "$ac_res" >&6; }
3628
- if eval test x\$$cachevar = xyes; then
3629
- CXXFLAGS="$CXXFLAGS $switch"
3630
- ac_success=yes
3931
+ if eval test x\$$cachevar = xyes; then
3932
+ CXX="$CXX $switch"
3933
+ if test -n "$CXXCPP" ; then
3934
+ CXXCPP="$CXXCPP $switch"
3935
+ fi
3936
+ ac_success=yes
3937
+ break
3938
+ fi
3939
+ done
3940
+ if test x$ac_success = xyes; then
3631
3941
  break
3632
3942
  fi
3633
3943
  done
@@ -3638,22 +3948,19 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3638
3948
  ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3639
3949
  ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
3640
3950
 
3641
- if test x$ax_cxx_compile_cxx11_required = xtrue; then
3951
+ if test x$ax_cxx_compile_cxx14_required = xtrue; then
3642
3952
  if test x$ac_success = xno; then
3643
- as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
3953
+ as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5
3644
3954
  fi
3955
+ fi
3956
+ if test x$ac_success = xno; then
3957
+ HAVE_CXX14=0
3958
+ { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5
3959
+ $as_echo "$as_me: No compiler with C++14 support was found" >&6;}
3645
3960
  else
3646
- if test x$ac_success = xno; then
3647
- HAVE_CXX11=0
3648
- { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
3649
- $as_echo "$as_me: No compiler with C++11 support was found" >&6;}
3650
- else
3651
- HAVE_CXX11=1
3652
-
3653
- $as_echo "#define HAVE_CXX11 1" >>confdefs.h
3654
-
3655
- fi
3961
+ HAVE_CXX14=1
3656
3962
 
3963
+ $as_echo "#define HAVE_CXX14 1" >>confdefs.h
3657
3964
 
3658
3965
  fi
3659
3966
 
@@ -3668,6 +3975,7 @@ $as_echo "#define HAVE_CXX11 1" >>confdefs.h
3668
3975
 
3669
3976
 
3670
3977
 
3978
+
3671
3979
  # Check whether --with-ruby was given.
3672
3980
  if test "${with_ruby+set}" = set; then :
3673
3981
  withval=$with_ruby; RUBY=$withval
@@ -5919,7 +6227,7 @@ esac
5919
6227
  #echo DX_ENV=$DX_ENV
5920
6228
 
5921
6229
 
5922
- RICE_SAMPLES="enum map inheritance"
6230
+ RICE_SAMPLES="enum map inheritance callbacks"
5923
6231
 
5924
6232
 
5925
6233
  RICE_ROOT=`pwd`
@@ -6730,7 +7038,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
6730
7038
  #
6731
7039
  # INIT-COMMANDS
6732
7040
  #
6733
- AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
7041
+ AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
6734
7042
 
6735
7043
  _ACEOF
6736
7044
 
@@ -7350,29 +7658,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
7350
7658
  # Older Autoconf quotes --file arguments for eval, but not when files
7351
7659
  # are listed without --file. Let's play safe and only enable the eval
7352
7660
  # if we detect the quoting.
7353
- case $CONFIG_FILES in
7354
- *\'*) eval set x "$CONFIG_FILES" ;;
7355
- *) set x $CONFIG_FILES ;;
7356
- esac
7661
+ # TODO: see whether this extra hack can be removed once we start
7662
+ # requiring Autoconf 2.70 or later.
7663
+ case $CONFIG_FILES in #(
7664
+ *\'*) :
7665
+ eval set x "$CONFIG_FILES" ;; #(
7666
+ *) :
7667
+ set x $CONFIG_FILES ;; #(
7668
+ *) :
7669
+ ;;
7670
+ esac
7357
7671
  shift
7358
- for mf
7672
+ # Used to flag and report bootstrapping failures.
7673
+ am_rc=0
7674
+ for am_mf
7359
7675
  do
7360
7676
  # Strip MF so we end up with the name of the file.
7361
- mf=`echo "$mf" | sed -e 's/:.*$//'`
7362
- # Check whether this is an Automake generated Makefile or not.
7363
- # We used to match only the files named 'Makefile.in', but
7364
- # some people rename them; so instead we look at the file content.
7365
- # Grep'ing the first line is not enough: some people post-process
7366
- # each Makefile.in and add a new line on top of each file to say so.
7367
- # Grep'ing the whole file is not good either: AIX grep has a line
7677
+ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
7678
+ # Check whether this is an Automake generated Makefile which includes
7679
+ # dependency-tracking related rules and includes.
7680
+ # Grep'ing the whole file directly is not great: AIX grep has a line
7368
7681
  # limit of 2048, but all sed's we know have understand at least 4000.
7369
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
7370
- dirpart=`$as_dirname -- "$mf" ||
7371
- $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
7372
- X"$mf" : 'X\(//\)[^/]' \| \
7373
- X"$mf" : 'X\(//\)$' \| \
7374
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
7375
- $as_echo X"$mf" |
7682
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
7683
+ || continue
7684
+ am_dirpart=`$as_dirname -- "$am_mf" ||
7685
+ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
7686
+ X"$am_mf" : 'X\(//\)[^/]' \| \
7687
+ X"$am_mf" : 'X\(//\)$' \| \
7688
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
7689
+ $as_echo X"$am_mf" |
7376
7690
  sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
7377
7691
  s//\1/
7378
7692
  q
@@ -7390,53 +7704,50 @@ $as_echo X"$mf" |
7390
7704
  q
7391
7705
  }
7392
7706
  s/.*/./; q'`
7393
- else
7394
- continue
7395
- fi
7396
- # Extract the definition of DEPDIR, am__include, and am__quote
7397
- # from the Makefile without running 'make'.
7398
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
7399
- test -z "$DEPDIR" && continue
7400
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
7401
- test -z "$am__include" && continue
7402
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
7403
- # Find all dependency output files, they are included files with
7404
- # $(DEPDIR) in their names. We invoke sed twice because it is the
7405
- # simplest approach to changing $(DEPDIR) to its actual value in the
7406
- # expansion.
7407
- for file in `sed -n "
7408
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
7409
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
7410
- # Make sure the directory exists.
7411
- test -f "$dirpart/$file" && continue
7412
- fdir=`$as_dirname -- "$file" ||
7413
- $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
7414
- X"$file" : 'X\(//\)[^/]' \| \
7415
- X"$file" : 'X\(//\)$' \| \
7416
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
7417
- $as_echo X"$file" |
7418
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
7419
- s//\1/
7420
- q
7421
- }
7422
- /^X\(\/\/\)[^/].*/{
7707
+ am_filepart=`$as_basename -- "$am_mf" ||
7708
+ $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
7709
+ X"$am_mf" : 'X\(//\)$' \| \
7710
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
7711
+ $as_echo X/"$am_mf" |
7712
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
7423
7713
  s//\1/
7424
7714
  q
7425
7715
  }
7426
- /^X\(\/\/\)$/{
7716
+ /^X\/\(\/\/\)$/{
7427
7717
  s//\1/
7428
7718
  q
7429
7719
  }
7430
- /^X\(\/\).*/{
7720
+ /^X\/\(\/\).*/{
7431
7721
  s//\1/
7432
7722
  q
7433
7723
  }
7434
7724
  s/.*/./; q'`
7435
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
7436
- # echo "creating $dirpart/$file"
7437
- echo '# dummy' > "$dirpart/$file"
7438
- done
7725
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
7726
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
7727
+ | $MAKE -f - am--depfiles" >&5
7728
+ (cd "$am_dirpart" \
7729
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
7730
+ | $MAKE -f - am--depfiles) >&5 2>&5
7731
+ ac_status=$?
7732
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
7733
+ (exit $ac_status); } || am_rc=$?
7439
7734
  done
7735
+ if test $am_rc -ne 0; then
7736
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
7737
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
7738
+ as_fn_error $? "Something went wrong bootstrapping makefile fragments
7739
+ for automatic dependency tracking. If GNU make was not used, consider
7740
+ re-running the configure script with MAKE=\"gmake\" (or whatever is
7741
+ necessary). You can also try re-running configure with the
7742
+ '--disable-dependency-tracking' option to at least be able to build
7743
+ the package (albeit without support for automatic dependency tracking).
7744
+ See \`config.log' for more details" "$LINENO" 5; }
7745
+ fi
7746
+ { am_dirpart=; unset am_dirpart;}
7747
+ { am_filepart=; unset am_filepart;}
7748
+ { am_mf=; unset am_mf;}
7749
+ { am_rc=; unset am_rc;}
7750
+ rm -f conftest-deps.mk
7440
7751
  }
7441
7752
  ;;
7442
7753