Commit 160eb4d2 authored by Pranjal Raihan's avatar Pranjal Raihan Committed by Facebook GitHub Bot

Don't use typeid without RTTI in UniqueInstance

Summary: The class depends on RTTI. It's a sanity check that crashes if two instances of a singleton are created. So doing nothing in `-fno-rtti` code is fine.

Reviewed By: yfeldblum

Differential Revision: D29630207

fbshipit-source-id: 4976f72394086afe12e224e40fe955636108e713
parent 55033066
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <typeinfo> #include <typeinfo>
#include <folly/CppAttributes.h> #include <folly/CppAttributes.h>
#include <folly/Portability.h>
#include <folly/detail/StaticSingletonManager.h> #include <folly/detail/StaticSingletonManager.h>
namespace folly { namespace folly {
...@@ -27,7 +28,7 @@ namespace detail { ...@@ -27,7 +28,7 @@ namespace detail {
class UniqueInstance { class UniqueInstance {
public: public:
#if __GNUC__ && __GNUC__ < 7 && !__clang__ #if !FOLLY_HAS_RTTI || (__GNUC__ && __GNUC__ < 7 && !__clang__)
explicit UniqueInstance(...) noexcept {} explicit UniqueInstance(...) noexcept {}
#else #else
template <template <typename...> class Z, typename... Key, typename... Mapped> template <template <typename...> class Z, typename... Key, typename... Mapped>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment