Fix Build: propagate_const under GCC
authorYedidya Feldblum <yfeldblum@fb.com>
Wed, 20 Dec 2017 06:31:53 +0000 (22:31 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 20 Dec 2017 06:37:05 +0000 (22:37 -0800)
Summary: [Folly] Fix Build: `propagate_const` under GCC.

Reviewed By: aary

Differential Revision: D6609722

fbshipit-source-id: 47d8b0f2d54e0e5834383ea64c93af30927c921d

folly/lang/PropagateConst.h

index 5b359dc788fcff1c05b4a61c11596509a20c884c..235db85aa139ebf46711dcebf240b93306e27d17 100644 (file)
@@ -126,8 +126,10 @@ class propagate_const {
     pointer_ = static_cast<OtherPointer&&>(other);
   }
 
-  FOLLY_CPP14_CONSTEXPR void swap(propagate_const& other) noexcept(noexcept(
-      detail::propagate_const_adl::adl_swap(pointer_, other.pointer_))) {
+  FOLLY_CPP14_CONSTEXPR void swap(propagate_const& other) noexcept(
+      noexcept(detail::propagate_const_adl::adl_swap(
+          std::declval<Pointer&>(),
+          other.pointer_))) {
     detail::propagate_const_adl::adl_swap(pointer_, other.pointer_);
   }