Commit 44683993 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.

Redo of D29630207 (https://github.com/facebook/folly/commit/160eb4d284eb67cc2641b6718c964dab8fc6486b)

Reviewed By: dtolnay

Differential Revision: D29684338

fbshipit-source-id: 38355df5297681329f227fd10570a816f4672b9b
parent 3275d892
...@@ -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