================
@@ -1,44 +1,40 @@
 #ifndef 
LLVM_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_CHECKERS_INPUTS_BDE_TYPES_OPTIONAL_H_
 #define 
LLVM_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_CHECKERS_INPUTS_BDE_TYPES_OPTIONAL_H_
 
-/// Mock of `bsl::optional`.
+#include "../../std/types/optional.h"
+
 namespace bsl {
+  class string {};
+}
 
-// clang-format off
-template <typename T> struct remove_reference      { using type = T; };
-template <typename T> struct remove_reference<T&>  { using type = T; };
-template <typename T> struct remove_reference<T&&> { using type = T; };
-// clang-format on
+/// Mock of `BloombergLP::bslstl::Optional_Base`
+namespace BloombergLP::bslstl {
 
-template <typename T>
-using remove_reference_t = typename remove_reference<T>::type;
+template <class T>
+constexpr bool isAllocatorAware() {
+  return false;
+}
 
-template <typename T>
-constexpr T &&forward(remove_reference_t<T> &t) noexcept;
+template <>
+constexpr bool isAllocatorAware<bsl::string>() {
+  return true;
+}
 
-template <typename T>
-constexpr T &&forward(remove_reference_t<T> &&t) noexcept;
+// Note: real `Optional_Base` uses `BloombergLP::bslma::UsesBslmaAllocator`
+// to check if type is alocator-aware.
+// This is simplified mock to illustrate similar behaviour.
+template <class T, bool AA = isAllocatorAware<T>()>
----------------
BaLiKfromUA wrote:

https://github.com/bloomberg/bde/blob/f8b09a9298a5a76741c0820344c8850bf0b2e177/groups/bsl/bslstl/bslstl_optional.h#L799

https://github.com/llvm/llvm-project/pull/168863
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to