Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-11237

[C++] Compiler error with GLog and unity build enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • C++

    Description

      In file included from src/arrow/CMakeFiles/arrow_objlib.dir/Unity/unity_8_cxx.cxx:7:
      In file included from /home/antoine/arrow/dev/cpp/src/arrow/util/logging.cc:29:
      glog_ep-prefix/src/glog_ep/include/glog/logging.h:640:9: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'const nullptr_t')
        (*os) << v;
        ~~~~~ ^  ~
      glog_ep-prefix/src/glog_ep/include/glog/logging.h:696:3: note: in instantiation of function template specialization 'google::MakeCheckOpValueString<nullptr_t>' requested here
        MakeCheckOpValueString(comb.ForVar2(), v2);
        ^
      glog_ep-prefix/src/glog_ep/include/glog/logging.h:720:1: note: in instantiation of function template specialization 'google::MakeCheckOpString<std::unordered_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::hash<std::string>, std::equal_to<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > > *, nullptr_t>' requested here
      DEFINE_CHECK_OP_IMPL(Check_NE, !=)  // Use CHECK(x == NULL) instead.
      ^
      glog_ep-prefix/src/glog_ep/include/glog/logging.h:709:17: note: expanded from macro 'DEFINE_CHECK_OP_IMPL'
          else return MakeCheckOpString(v1, v2, exprtext); \
                      ^
      /home/antoine/arrow/dev/cpp/src/arrow/util/key_value_metadata.cc:75:3: note: in instantiation of function template specialization 'google::Check_NEImpl<std::unordered_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::hash<std::string>, std::equal_to<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > > *, nullptr_t>' requested here
        DCHECK_NE(out, nullptr);
        ^
      glog_ep-prefix/src/glog_ep/include/glog/logging.h:996:31: note: expanded from macro 'DCHECK_NE'
      #define DCHECK_NE(val1, val2) CHECK_NE(val1, val2)
                                    ^
      glog_ep-prefix/src/glog_ep/include/glog/logging.h:791:30: note: expanded from macro 'CHECK_NE'
      #define CHECK_NE(val1, val2) CHECK_OP(_NE, !=, val1, val2)
                                   ^
      glog_ep-prefix/src/glog_ep/include/glog/logging.h:766:3: note: expanded from macro 'CHECK_OP'
        CHECK_OP_LOG(name, op, val1, val2, google::LogMessageFatal)
        ^
      glog_ep-prefix/src/glog_ep/include/glog/logging.h:746:18: note: expanded from macro 'CHECK_OP_LOG'
               google::Check##name##Impl(                      \
                       ^
      <scratch space>:101:1: note: expanded from here
      Check_NEImpl
      ^
      /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ostream:108:7: note: candidate function
            operator<<(__ostream_type& (*__pf)(__ostream_type&))
            ^
      /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ostream:117:7: note: candidate function
            operator<<(__ios_type& (*__pf)(__ios_type&))
            ^
      /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ostream:127:7: note: candidate function
            operator<<(ios_base& (*__pf) (ios_base&))
            ^
      /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ostream:245:7: note: candidate function
            operator<<(const void* __p)
            ^
      /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ostream:276:7: note: candidate function
            operator<<(__streambuf_type* __sb);
            ^
      

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              apitrou Antoine Pitrou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m