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

Project does not build with clang #6

Open
per-gron opened this issue Aug 23, 2020 · 0 comments
Open

Project does not build with clang #6

per-gron opened this issue Aug 23, 2020 · 0 comments

Comments

@per-gron
Copy link

When building CBAG with clang 9.0.1-12 I get the following error

In file included from external/com_bcanalog_cbag/src/cbag/gdsii/write.cpp:52:
In file included from external/com_bcanalog_cbag/include/cbag/gdsii/write.h:63:
In file included from external/com_bcanalog_cbag/include/cbag/layout/cellview_fwd.h:56:
In file included from external/com_bcanalog_cbag/include/cbag/layout/instance.h:56:
In file included from external/com_bcanalog_cbag/include/cbag/common/param_map.h:51:
external/com_bcanalog_cbag/include/cbag/util/sorted_map.h:85:9: error: no member 'key_compare' in 'cbag::util::sorted_map<std::__cxx11::basic_string<char>, std::variant<long, double, bool, std::__cxx11::basic_string<char>, cbag::time_struct, cbag::binary_t>, std::less<std::__cxx11::basic_string<char> > >'; it has not yet been instantiated
        key_compare key_comp_;
        ^
external/com_bcanalog_cbag/include/cbag/util/sorted_vector.h:77:13: note: in instantiation of member class 'cbag::util::sorted_map<std::__cxx11::basic_string<char>, std::variant<long, double, bool, std::__cxx11::basic_string<char>, cbag::time_struct, cbag::binary_t>, std::less<std::__cxx11::basic_string<char> > >::value_compare' requested here
    Compare comp_;
            ^
external/com_bcanalog_cbag/include/cbag/util/sorted_map.h:64:32: note: in instantiation of template class 'cbag::util::sorted_vector<std::pair<std::__cxx11::basic_string<char>, std::variant<long, double, bool, std::__cxx11::basic_string<char>, cbag::time_struct, cbag::binary_t> >, cbag::util::sorted_map<std::__cxx11::basic_string<char>, std::variant<long, double, bool, std::__cxx11::basic_string<char>, cbag::time_struct, cbag::binary_t>, std::less<std::__cxx11::basic_string<char> > >::value_compare>' requested here
    using size_type = typename vector_type::size_type;
                               ^
external/com_bcanalog_cbag/include/cbag/layout/instance.h:70:15: note: in instantiation of template class 'cbag::util::sorted_map<std::__cxx11::basic_string<char>, std::variant<long, double, bool, std::__cxx11::basic_string<char>, cbag::time_struct, cbag::binary_t>, std::less<std::__cxx11::basic_string<char> > >' requested here
    param_map params;
              ^
external/com_bcanalog_cbag/include/cbag/util/sorted_map.h:66:11: note: not-yet-instantiated member is declared here
    using key_compare = Compare;
          ^
1 error generated.

The following patch fixes it

diff --git include/cbag/util/sorted_map.h include/cbag/util/sorted_map.h
index 8d41ae6..6b8ef4d 100644
--- include/cbag/util/sorted_map.h
+++ include/cbag/util/sorted_map.h
@@ -60,10 +60,10 @@ template <class Key, class T, class Compare = std::less<Key>> class sorted_map {
     using key_type = Key;
     using mapped_type = T;
     using value_type = std::pair<key_type, mapped_type>;
+    using key_compare = Compare;
     using vector_type = sorted_vector<value_type, value_compare>;
     using size_type = typename vector_type::size_type;
     using difference_type = typename vector_type::difference_type;
-    using key_compare = Compare;
     using reference = value_type &;
     using const_reference = const value_type &;
     using iterator = typename vector_type::iterator;
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

1 participant