View | Details | Return to bug 88738
Collapse All | Expand All

(-)a/libstdc++-v3/include/bits/c++config (+8 lines)
Lines 99-104 Link Here
99
# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
99
# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
100
#endif
100
#endif
101
101
102
// Macro to warn about unused results.
103
#if __cplusplus >= 201703L
104
# define _GLIBCXX_NODISCARD [[__nodiscard__]]
105
#else
106
# define _GLIBCXX_NODISCARD __attribute__ ((__warn_unused_result__))
107
#endif
108
109
102
110
103
#if __cplusplus
111
#if __cplusplus
104
112
(-)a/libstdc++-v3/include/bits/shared_ptr.h (-18 / +18 lines)
Lines 380-416 _GLIBCXX_BEGIN_NAMESPACE_VERSION Link Here
380
380
381
  // 20.7.2.2.7 shared_ptr comparisons
381
  // 20.7.2.2.7 shared_ptr comparisons
382
  template<typename _Tp, typename _Up>
382
  template<typename _Tp, typename _Up>
383
    inline bool
383
    _GLIBCXX_NODISCARD inline bool
384
    operator==(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
384
    operator==(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
385
    { return __a.get() == __b.get(); }
385
    { return __a.get() == __b.get(); }
386
386
387
  template<typename _Tp>
387
  template<typename _Tp>
388
    inline bool
388
    _GLIBCXX_NODISCARD inline bool
389
    operator==(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
389
    operator==(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
390
    { return !__a; }
390
    { return !__a; }
391
391
392
  template<typename _Tp>
392
  template<typename _Tp>
393
    inline bool
393
    _GLIBCXX_NODISCARD inline bool
394
    operator==(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
394
    operator==(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
395
    { return !__a; }
395
    { return !__a; }
396
396
397
  template<typename _Tp, typename _Up>
397
  template<typename _Tp, typename _Up>
398
    inline bool
398
    _GLIBCXX_NODISCARD inline bool
399
    operator!=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
399
    operator!=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
400
    { return __a.get() != __b.get(); }
400
    { return __a.get() != __b.get(); }
401
401
402
  template<typename _Tp>
402
  template<typename _Tp>
403
    inline bool
403
    _GLIBCXX_NODISCARD inline bool
404
    operator!=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
404
    operator!=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
405
    { return (bool)__a; }
405
    { return (bool)__a; }
406
406
407
  template<typename _Tp>
407
  template<typename _Tp>
408
    inline bool
408
    _GLIBCXX_NODISCARD inline bool
409
    operator!=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
409
    operator!=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
410
    { return (bool)__a; }
410
    { return (bool)__a; }
411
411
412
  template<typename _Tp, typename _Up>
412
  template<typename _Tp, typename _Up>
413
    inline bool
413
    _GLIBCXX_NODISCARD inline bool
414
    operator<(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
414
    operator<(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
415
    {
415
    {
416
      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
416
      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
Lines 420-426 _GLIBCXX_BEGIN_NAMESPACE_VERSION Link Here
420
    }
420
    }
421
421
422
  template<typename _Tp>
422
  template<typename _Tp>
423
    inline bool
423
    _GLIBCXX_NODISCARD inline bool
424
    operator<(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
424
    operator<(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
425
    {
425
    {
426
      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
426
      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
Lines 428-434 _GLIBCXX_BEGIN_NAMESPACE_VERSION Link Here
428
    }
428
    }
429
429
430
  template<typename _Tp>
430
  template<typename _Tp>
431
    inline bool
431
    _GLIBCXX_NODISCARD inline bool
432
    operator<(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
432
    operator<(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
433
    {
433
    {
434
      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
434
      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
Lines 436-482 _GLIBCXX_BEGIN_NAMESPACE_VERSION Link Here
436
    }
436
    }
437
437
438
  template<typename _Tp, typename _Up>
438
  template<typename _Tp, typename _Up>
439
    inline bool
439
    _GLIBCXX_NODISCARD inline bool
440
    operator<=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
440
    operator<=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
441
    { return !(__b < __a); }
441
    { return !(__b < __a); }
442
442
443
  template<typename _Tp>
443
  template<typename _Tp>
444
    inline bool
444
    _GLIBCXX_NODISCARD inline bool
445
    operator<=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
445
    operator<=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
446
    { return !(nullptr < __a); }
446
    { return !(nullptr < __a); }
447
447
448
  template<typename _Tp>
448
  template<typename _Tp>
449
    inline bool
449
    _GLIBCXX_NODISCARD inline bool
450
    operator<=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
450
    operator<=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
451
    { return !(__a < nullptr); }
451
    { return !(__a < nullptr); }
452
452
453
  template<typename _Tp, typename _Up>
453
  template<typename _Tp, typename _Up>
454
    inline bool
454
    _GLIBCXX_NODISCARD inline bool
455
    operator>(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
455
    operator>(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
456
    { return (__b < __a); }
456
    { return (__b < __a); }
457
457
458
  template<typename _Tp>
458
  template<typename _Tp>
459
    inline bool
459
    _GLIBCXX_NODISCARD inline bool
460
    operator>(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
460
    operator>(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
461
    { return nullptr < __a; }
461
    { return nullptr < __a; }
462
462
463
  template<typename _Tp>
463
  template<typename _Tp>
464
    inline bool
464
    _GLIBCXX_NODISCARD inline bool
465
    operator>(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
465
    operator>(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
466
    { return __a < nullptr; }
466
    { return __a < nullptr; }
467
467
468
  template<typename _Tp, typename _Up>
468
  template<typename _Tp, typename _Up>
469
    inline bool
469
    _GLIBCXX_NODISCARD inline bool
470
    operator>=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
470
    operator>=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
471
    { return !(__a < __b); }
471
    { return !(__a < __b); }
472
472
473
  template<typename _Tp>
473
  template<typename _Tp>
474
    inline bool
474
    _GLIBCXX_NODISCARD inline bool
475
    operator>=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
475
    operator>=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
476
    { return !(__a < nullptr); }
476
    { return !(__a < nullptr); }
477
477
478
  template<typename _Tp>
478
  template<typename _Tp>
479
    inline bool
479
    _GLIBCXX_NODISCARD inline bool
480
    operator>=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
480
    operator>=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
481
    { return !(nullptr < __a); }
481
    { return !(nullptr < __a); }
482
482
(-)a/libstdc++-v3/include/bits/unique_ptr.h (-18 / +18 lines)
Lines 707-747 _GLIBCXX_BEGIN_NAMESPACE_VERSION Link Here
707
707
708
  template<typename _Tp, typename _Dp,
708
  template<typename _Tp, typename _Dp,
709
	   typename _Up, typename _Ep>
709
	   typename _Up, typename _Ep>
710
    inline bool
710
    _GLIBCXX_NODISCARD inline bool
711
    operator==(const unique_ptr<_Tp, _Dp>& __x,
711
    operator==(const unique_ptr<_Tp, _Dp>& __x,
712
	       const unique_ptr<_Up, _Ep>& __y)
712
	       const unique_ptr<_Up, _Ep>& __y)
713
    { return __x.get() == __y.get(); }
713
    { return __x.get() == __y.get(); }
714
714
715
  template<typename _Tp, typename _Dp>
715
  template<typename _Tp, typename _Dp>
716
    inline bool
716
    _GLIBCXX_NODISCARD inline bool
717
    operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
717
    operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
718
    { return !__x; }
718
    { return !__x; }
719
719
720
  template<typename _Tp, typename _Dp>
720
  template<typename _Tp, typename _Dp>
721
    inline bool
721
    _GLIBCXX_NODISCARD inline bool
722
    operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
722
    operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
723
    { return !__x; }
723
    { return !__x; }
724
724
725
  template<typename _Tp, typename _Dp,
725
  template<typename _Tp, typename _Dp,
726
	   typename _Up, typename _Ep>
726
	   typename _Up, typename _Ep>
727
    inline bool
727
    _GLIBCXX_NODISCARD inline bool
728
    operator!=(const unique_ptr<_Tp, _Dp>& __x,
728
    operator!=(const unique_ptr<_Tp, _Dp>& __x,
729
	       const unique_ptr<_Up, _Ep>& __y)
729
	       const unique_ptr<_Up, _Ep>& __y)
730
    { return __x.get() != __y.get(); }
730
    { return __x.get() != __y.get(); }
731
731
732
  template<typename _Tp, typename _Dp>
732
  template<typename _Tp, typename _Dp>
733
    inline bool
733
    _GLIBCXX_NODISCARD inline bool
734
    operator!=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
734
    operator!=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
735
    { return (bool)__x; }
735
    { return (bool)__x; }
736
736
737
  template<typename _Tp, typename _Dp>
737
  template<typename _Tp, typename _Dp>
738
    inline bool
738
    _GLIBCXX_NODISCARD inline bool
739
    operator!=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
739
    operator!=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
740
    { return (bool)__x; }
740
    { return (bool)__x; }
741
741
742
  template<typename _Tp, typename _Dp,
742
  template<typename _Tp, typename _Dp,
743
	   typename _Up, typename _Ep>
743
	   typename _Up, typename _Ep>
744
    inline bool
744
    _GLIBCXX_NODISCARD inline bool
745
    operator<(const unique_ptr<_Tp, _Dp>& __x,
745
    operator<(const unique_ptr<_Tp, _Dp>& __x,
746
	      const unique_ptr<_Up, _Ep>& __y)
746
	      const unique_ptr<_Up, _Ep>& __y)
747
    {
747
    {
Lines 752-818 _GLIBCXX_BEGIN_NAMESPACE_VERSION Link Here
752
    }
752
    }
753
753
754
  template<typename _Tp, typename _Dp>
754
  template<typename _Tp, typename _Dp>
755
    inline bool
755
    _GLIBCXX_NODISCARD inline bool
756
    operator<(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
756
    operator<(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
757
    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
757
    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
758
								 nullptr); }
758
								 nullptr); }
759
759
760
  template<typename _Tp, typename _Dp>
760
  template<typename _Tp, typename _Dp>
761
    inline bool
761
    _GLIBCXX_NODISCARD inline bool
762
    operator<(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
762
    operator<(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
763
    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
763
    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
764
								 __x.get()); }
764
								 __x.get()); }
765
765
766
  template<typename _Tp, typename _Dp,
766
  template<typename _Tp, typename _Dp,
767
	   typename _Up, typename _Ep>
767
	   typename _Up, typename _Ep>
768
    inline bool
768
    _GLIBCXX_NODISCARD inline bool
769
    operator<=(const unique_ptr<_Tp, _Dp>& __x,
769
    operator<=(const unique_ptr<_Tp, _Dp>& __x,
770
	       const unique_ptr<_Up, _Ep>& __y)
770
	       const unique_ptr<_Up, _Ep>& __y)
771
    { return !(__y < __x); }
771
    { return !(__y < __x); }
772
772
773
  template<typename _Tp, typename _Dp>
773
  template<typename _Tp, typename _Dp>
774
    inline bool
774
    _GLIBCXX_NODISCARD inline bool
775
    operator<=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
775
    operator<=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
776
    { return !(nullptr < __x); }
776
    { return !(nullptr < __x); }
777
777
778
  template<typename _Tp, typename _Dp>
778
  template<typename _Tp, typename _Dp>
779
    inline bool
779
    _GLIBCXX_NODISCARD inline bool
780
    operator<=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
780
    operator<=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
781
    { return !(__x < nullptr); }
781
    { return !(__x < nullptr); }
782
782
783
  template<typename _Tp, typename _Dp,
783
  template<typename _Tp, typename _Dp,
784
	   typename _Up, typename _Ep>
784
	   typename _Up, typename _Ep>
785
    inline bool
785
    _GLIBCXX_NODISCARD inline bool
786
    operator>(const unique_ptr<_Tp, _Dp>& __x,
786
    operator>(const unique_ptr<_Tp, _Dp>& __x,
787
	      const unique_ptr<_Up, _Ep>& __y)
787
	      const unique_ptr<_Up, _Ep>& __y)
788
    { return (__y < __x); }
788
    { return (__y < __x); }
789
789
790
  template<typename _Tp, typename _Dp>
790
  template<typename _Tp, typename _Dp>
791
    inline bool
791
    _GLIBCXX_NODISCARD inline bool
792
    operator>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
792
    operator>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
793
    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
793
    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
794
								 __x.get()); }
794
								 __x.get()); }
795
795
796
  template<typename _Tp, typename _Dp>
796
  template<typename _Tp, typename _Dp>
797
    inline bool
797
    _GLIBCXX_NODISCARD inline bool
798
    operator>(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
798
    operator>(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
799
    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
799
    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
800
								 nullptr); }
800
								 nullptr); }
801
801
802
  template<typename _Tp, typename _Dp,
802
  template<typename _Tp, typename _Dp,
803
	   typename _Up, typename _Ep>
803
	   typename _Up, typename _Ep>
804
    inline bool
804
    _GLIBCXX_NODISCARD inline bool
805
    operator>=(const unique_ptr<_Tp, _Dp>& __x,
805
    operator>=(const unique_ptr<_Tp, _Dp>& __x,
806
	       const unique_ptr<_Up, _Ep>& __y)
806
	       const unique_ptr<_Up, _Ep>& __y)
807
    { return !(__x < __y); }
807
    { return !(__x < __y); }
808
808
809
  template<typename _Tp, typename _Dp>
809
  template<typename _Tp, typename _Dp>
810
    inline bool
810
    _GLIBCXX_NODISCARD inline bool
811
    operator>=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
811
    operator>=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
812
    { return !(__x < nullptr); }
812
    { return !(__x < nullptr); }
813
813
814
  template<typename _Tp, typename _Dp>
814
  template<typename _Tp, typename _Dp>
815
    inline bool
815
    _GLIBCXX_NODISCARD inline bool
816
    operator>=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
816
    operator>=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
817
    { return !(nullptr < __x); }
817
    { return !(nullptr < __x); }
818
818

Return to bug 88738