Giter Club home page Giter Club logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
Seems to work fine with gcc, but clang is definitely not happy.  Since this 
uses tr1 things, does this code need a C11 refresh or something?

Original comment by [email protected] on 29 Oct 2013 at 9:36

from sparsehash.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
I'm getting compile error on FreeBSD 10 release with clang 3.3 too ( have you 
solved the problem yet? ) :
./src/sparsehash/internal/sparsehashtable.h:161:8: note: candidate constructor 
(the implicit copy constructor) not viable: requires 1
      argument, but 3 were provided
struct sparse_hashtable_iterator {
       ^
In file included from src/hashtable_test.cc:63:
./src/hash_test_interface.h:88:15: error: type 'typename 
sparse_hash_map<basic_string<char>, basic_string<char>, Hasher, Hasher,
      Alloc<basic_string<char>, unsigned long, 18446744073709551615> >::iterator' (aka 'sparse_hashtable_iterator<std::__1::pair<const
      std::__1::basic_string<char>, std::__1::basic_string<char> >, std::__1::basic_string<char>, <anonymous>::Hasher,
      google::sparse_hash_map<std::__1::basic_string<char>, std::__1::basic_string<char>, <anonymous>::Hasher, <anonymous>::Hasher,
      <anonymous>::Alloc<std::__1::basic_string<char>, unsigned long, 18446744073709551615> >::SelectKey,
      google::sparse_hash_map<std::__1::basic_string<char>, std::__1::basic_string<char>, <anonymous>::Hasher, <anonymous>::Hasher,
      <anonymous>::Alloc<std::__1::basic_string<char>, unsigned long, 18446744073709551615> >::SetKey, <anonymous>::Hasher,
      <anonymous>::Alloc<std::__1::basic_string<char>, unsigned long, 18446744073709551615> >') is not a direct or virtual base of
      'google::BaseHashtableInterface<google::sparse_hash_map<std::__1::basic_string<char>, std::__1::basic_string<char>,
      <anonymous>::Hasher, <anonymous>::Hasher, <anonymous>::Alloc<std::__1::basic_string<char>, unsigned long, 18446744073709551615> >
      >::iterator'
        : HT::iterator(it), parent_(parent) { }
              ^~~~~~~~
./src/hash_test_interface.h:144:12: note: in instantiation of member function
      'google::BaseHashtableInterface<google::sparse_hash_map<std::__1::basic_string<char>, std::__1::basic_string<char>,
      <anonymous>::Hasher, <anonymous>::Hasher, <anonymous>::Alloc<std::__1::basic_string<char>, unsigned long, 18446744073709551615> >
      >::iterator::iterator' requested here
    return iterator(ht_.begin(), this);
           ^
src/hashtable_test.cc:620:25: note: in instantiation of member function
      'google::BaseHashtableInterface<google::sparse_hash_map<std::__1::basic_string<char>, std::__1::basic_string<char>,
      <anonymous>::Hasher, <anonymous>::Hasher, <anonymous>::Alloc<std::__1::basic_string<char>, unsigned long, 18446744073709551615> >
      >::begin' requested here
  EXPECT_TRUE(this->ht_.begin() == this->ht_.end());
                        ^
./src/testutil.h:51:9: note: expanded from macro 'EXPECT_TRUE'
  if (!(cond)) {                                        \
        ^
src/hashtable_test.cc:619:1: note: in instantiation of member function 
'<anonymous
      namespace>::TEST_onetype_HashtableAllTest_NormalIterators<google::HashtableInterface_SparseHashMap<std::__1::basic_string<char>,
      std::__1::basic_string<char>, <anonymous>::Hasher, <anonymous>::Hasher, <anonymous>::Alloc<std::__1::basic_string<char>, unsigned
      long, 18446744073709551615> > >::Run' requested here
TYPED_TEST(HashtableAllTest, NormalIterators) {
^
./src/testutil.h:171:7: note: expanded from macro 'TYPED_TEST'
      Run();                                                            \
      ^
src/hashtable_test.cc:619:1: note: in instantiation of member function 
'<anonymous
      namespace>::TEST_onetype_HashtableAllTest_NormalIterators<google::HashtableInterface_SparseHashMap<std::__1::basic_string<char>,
      std::__1::basic_string<char>, <anonymous>::Hasher, <anonymous>::Hasher, <anonymous>::Alloc<std::__1::basic_string<char>, unsigned
      long, 18446744073709551615> > >::TEST_onetype_HashtableAllTest_NormalIterators' requested here
TYPED_TEST(HashtableAllTest, NormalIterators) {
^
./src/testutil.h:205:68: note: expanded from macro 'TYPED_TEST'
        TEST_onetype_##superclass##_##testname<superclass##_type7> t;   \
                                                                   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
3 warnings and 20 errors generated.
*** Error code 1


Original comment by [email protected] on 27 Aug 2014 at 10:16

from sparsehash.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
Seems clang is a bit more stringent - some of the allocators used in the test 
are wrong. Seems hashmap allocators need to return pairs. Separately looks like 
there's something wonky going on in libc++ or sparsehash itself - the first 
element of the pair needs to be const. Not sure why.

Either way - here's a patch to fix the compile with clang.

Original comment by [email protected] on 27 Oct 2014 at 7:17

Attachments:

from sparsehash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.