Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to compile due to conflict with STL's is_empty #1

Closed
fazalmajid opened this issue Mar 7, 2017 · 1 comment
Closed

Fails to compile due to conflict with STL's is_empty #1

fazalmajid opened this issue Mar 7, 2017 · 1 comment

Comments

@fazalmajid
Copy link

It fails to compile for me using GCC 6.3.0 on SmartOS (Solaris derivative). Renaming the is_empty() function to something else fixes the problem. The conflict seems to be with the STL's std::is_empty

mordac ~/passvet/quotient-filter>gmake
g++     test.cc qf.c   -o test
test.cc: In function ‘void qf_consistent(quotient_filter*)’:
test.cc:103:9: error: reference to ‘is_empty’ is ambiguous
     if (is_empty(elt)) {
         ^~~~~~~~
In file included from test.cc:8:0:
qf.c:127:20: note: candidates are: bool is_empty(uint64_t)
 static inline bool is_empty(uint64_t elt)
                    ^~~~~~~~
In file included from /usr/local/include/c++/6.3.0/bits/move.h:57:0,
                 from /usr/local/include/c++/6.3.0/bits/stl_pair.h:59,
                 from /usr/local/include/c++/6.3.0/bits/stl_algobase.h:64,
                 from /usr/local/include/c++/6.3.0/bits/stl_tree.h:63,
                 from /usr/local/include/c++/6.3.0/set:60,
                 from test.cc:13:
/usr/local/include/c++/6.3.0/type_traits:701:12: note:                 template<class _Tp> struct std::is_empty
     struct is_empty
            ^~~~~~~~
In file included from /usr/local/include/c++/6.3.0/cassert:44:0,
                 from test.cc:15:
test.cc:113:15: error: reference to ‘is_empty’ is ambiguous
       assert(!is_empty(prev));
               ^
In file included from test.cc:8:0:
qf.c:127:20: note: candidates are: bool is_empty(uint64_t)
 static inline bool is_empty(uint64_t elt)
                    ^~~~~~~~
In file included from /usr/local/include/c++/6.3.0/bits/move.h:57:0,
                 from /usr/local/include/c++/6.3.0/bits/stl_pair.h:59,
                 from /usr/local/include/c++/6.3.0/bits/stl_algobase.h:64,
                 from /usr/local/include/c++/6.3.0/bits/stl_tree.h:63,
                 from /usr/local/include/c++/6.3.0/set:60,
                 from test.cc:13:
/usr/local/include/c++/6.3.0/type_traits:701:12: note:                 template<class _Tp> struct std::is_empty
     struct is_empty
            ^~~~~~~~
test.cc:117:10: error: reference to ‘is_empty’ is ambiguous
     if (!is_empty(elt)) {
          ^~~~~~~~
In file included from test.cc:8:0:
qf.c:127:20: note: candidates are: bool is_empty(uint64_t)
 static inline bool is_empty(uint64_t elt)
                    ^~~~~~~~
In file included from /usr/local/include/c++/6.3.0/bits/move.h:57:0,
                 from /usr/local/include/c++/6.3.0/bits/stl_pair.h:59,
                 from /usr/local/include/c++/6.3.0/bits/stl_algobase.h:64,
                 from /usr/local/include/c++/6.3.0/bits/stl_tree.h:63,
                 from /usr/local/include/c++/6.3.0/set:60,
                 from test.cc:13:
/usr/local/include/c++/6.3.0/type_traits:701:12: note:                 template<class _Tp> struct std::is_empty
     struct is_empty
            ^~~~~~~~
test.cc: In function ‘uint64_t genhash(quotient_filter*, bool, std::set<long unsigned int>&)’:
test.cc:145:11: error: reference to ‘is_empty’ is ambiguous
       if (is_empty(get_elem(qf, probe))) {
           ^~~~~~~~
In file included from test.cc:8:0:
qf.c:127:20: note: candidates are: bool is_empty(uint64_t)
 static inline bool is_empty(uint64_t elt)
                    ^~~~~~~~
In file included from /usr/local/include/c++/6.3.0/bits/move.h:57:0,
                 from /usr/local/include/c++/6.3.0/bits/stl_pair.h:59,
                 from /usr/local/include/c++/6.3.0/bits/stl_algobase.h:64,
                 from /usr/local/include/c++/6.3.0/bits/stl_tree.h:63,
                 from /usr/local/include/c++/6.3.0/set:60,
                 from test.cc:13:
/usr/local/include/c++/6.3.0/type_traits:701:12: note:                 template<class _Tp> struct std::is_empty
     struct is_empty
            ^~~~~~~~
gmake: *** [<builtin>: test] Error 1
@vedantk
Copy link
Owner

vedantk commented Aug 26, 2017

Thanks for the report! Sorry I didn't see it earlier. I've fixed the build:
To github.com:vedantk/quotient-filter.git
54539e6..a65a571 master -> master

@vedantk vedantk closed this as completed Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants