GrammaTech / clang-mutate

Manipulate C-family ASTs with Clang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error compiling via `make` on OSX v10.12.6, clang v5.0.1

evandrix opened this issue · comments

clang++ -Wno-unknown-warning-option -I/usr/local/Cellar/llvm/5.0.1/include  -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -DNDEBUG   -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -fno-rtti -I third-party/picojson-1.3.0 -D PICOJSON_USE_INT64 -I third-party/elfio-3.2 -I ../third-party/llvm/include/ -DLLVM_DWARFDUMP='"llvm-dwarfdump"'   -c -o TypeDBEntry.o TypeDBEntry.cpp
TypeDBEntry.cpp:39:5: warning: default label in switch which covers all enumeration values
      [-Wcovered-switch-default]
    default:
    ^
In file included from TypeDBEntry.cpp:2:
In file included from ./TypeDBEntry.h:4:
In file included from ./Utils.h:5:
In file included from ./AstRef.h:5:
In file included from ./Json.h:4:
In file included from ./third-party/picojson-1.3.0/picojson.h:38:
In file included from /usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:442:
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:1819:22: warning: the specified comparator type
      does not provide a const call operator [-Wuser-defined-warnings]
                     __trigger_diagnostics()), "");
                     ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:736:77: note: in instantiation of member function
      'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::~__tree' requested here
    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
                                                                            ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:970:7: note: from 'diagnose_if' attribute on
      '__trigger_diagnostics':
      _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
      ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__config:1095:20: note: expanded from macro
      '_LIBCPP_DIAGNOSE_WARNING'
    __attribute__((diagnose_if(__VA_ARGS__, "warning")))
                   ^           ~~~~~~~~~~~
In file included from TypeDBEntry.cpp:2:
In file included from ./TypeDBEntry.h:4:
In file included from ./Utils.h:5:
In file included from ./AstRef.h:5:
In file included from ./Json.h:4:
In file included from ./third-party/picojson-1.3.0/picojson.h:38:
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:479:17: error: no matching function for call to object
      of type 'const QualTypeComparator'
        {return static_cast<const _Compare&>(*this)(__x, __y.__cc.first);}
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:2007:17: note: in instantiation of member function
      'std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>::operator()' requested here
            if (value_comp()(__v, __nd->__value_))
                ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:2131:36: note: in instantiation of function
      template specialization 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::__find_equal<clang::QualType>' requested here
    __node_base_pointer& __child = __find_equal(__parent, __k);
                                   ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:1319:20: note: in instantiation of function template
      specialization 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::__emplace_unique_key_args<clang::QualType, const std::__1::piecewise_construct_t &,
      std::__1::tuple<const clang::QualType &>, std::__1::tuple<> >' requested here
    return __tree_.__emplace_unique_key_args(__k,
                   ^
TypeDBEntry.cpp:146:21: note: in instantiation of member function 'std::__1::map<clang::QualType,
      Hash, QualTypeComparator, std::__1::allocator<std::__1::pair<const clang::QualType, Hash> >
      >::operator[]' requested here
                seen[t] = hash;
                    ^
TypeDBEntry.cpp:12:10: note: candidate function not viable: 'this' argument has type
      'const QualTypeComparator', but method is not marked const
    bool operator()(const QualType &lhs, const QualType &rhs) {
         ^
In file included from TypeDBEntry.cpp:2:
In file included from ./TypeDBEntry.h:4:
In file included from ./Utils.h:5:
In file included from ./AstRef.h:5:
In file included from ./Json.h:4:
In file included from ./third-party/picojson-1.3.0/picojson.h:38:
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:476:17: error: no matching function for call to object
      of type 'const QualTypeComparator'
        {return static_cast<const _Compare&>(*this)(__x.__cc.first, __y);}
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:2017:22: note: in instantiation of member function
      'std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>::operator()' requested here
            else if (value_comp()(__nd->__value_, __v))
                     ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:2131:36: note: in instantiation of function
      template specialization 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::__find_equal<clang::QualType>' requested here
    __node_base_pointer& __child = __find_equal(__parent, __k);
                                   ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:1319:20: note: in instantiation of function template
      specialization 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::__emplace_unique_key_args<clang::QualType, const std::__1::piecewise_construct_t &,
      std::__1::tuple<const clang::QualType &>, std::__1::tuple<> >' requested here
    return __tree_.__emplace_unique_key_args(__k,
                   ^
TypeDBEntry.cpp:146:21: note: in instantiation of member function 'std::__1::map<clang::QualType,
      Hash, QualTypeComparator, std::__1::allocator<std::__1::pair<const clang::QualType, Hash> >
      >::operator[]' requested here
                seen[t] = hash;
                    ^
TypeDBEntry.cpp:12:10: note: candidate function not viable: 'this' argument has type
      'const QualTypeComparator', but method is not marked const
    bool operator()(const QualType &lhs, const QualType &rhs) {
         ^
In file included from TypeDBEntry.cpp:2:
In file included from ./TypeDBEntry.h:4:
In file included from ./Utils.h:5:
In file included from ./AstRef.h:5:
In file included from ./Json.h:4:
In file included from ./third-party/picojson-1.3.0/picojson.h:38:
In file included from /usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:442:
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:2413:26: error: no matching function for call to
      object of type 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::value_compare' (aka 'std::__1::__map_value_compare<clang::QualType,
      std::__1::__value_type<clang::QualType, Hash>, QualTypeComparator, true>')
    if (__p != end() && !value_comp()(__v, *__p))
                         ^~~~~~~~~~~~
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:1210:68: note: in instantiation of function template
      specialization 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::find<clang::QualType>' requested here
    iterator find(const key_type& __k)             {return __tree_.find(__k);}
                                                                   ^
TypeDBEntry.cpp:154:19: note: in instantiation of member function 'std::__1::map<clang::QualType,
      Hash, QualTypeComparator, std::__1::allocator<std::__1::pair<const clang::QualType, Hash> >
      >::find' requested here
    search = seen.find(t);
                  ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:472:10: note: candidate function not viable: no known
      conversion from 'const clang::QualType' to 'const std::__1::__value_type<clang::QualType, Hash>'
      for 1st argument
    bool operator()(const _CP& __x, const _CP& __y) const
         ^
In file included from TypeDBEntry.cpp:2:
In file included from ./TypeDBEntry.h:4:
In file included from ./Utils.h:5:
In file included from ./AstRef.h:5:
In file included from ./Json.h:4:
In file included from ./third-party/picojson-1.3.0/picojson.h:38:
In file included from /usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:442:
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:2483:14: error: no matching function for call to
      object of type 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::value_compare' (aka 'std::__1::__map_value_compare<clang::QualType,
      std::__1::__value_type<clang::QualType, Hash>, QualTypeComparator, true>')
        if (!value_comp()(__root->__value_, __v))
             ^~~~~~~~~~~~
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/__tree:2412:20: note: in instantiation of function
      template specialization 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::__lower_bound<clang::QualType>' requested here
    iterator __p = __lower_bound(__v, __root(), __end_node());
                   ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:1210:68: note: in instantiation of function template
      specialization 'std::__1::__tree<std::__1::__value_type<clang::QualType, Hash>,
      std::__1::__map_value_compare<clang::QualType, std::__1::__value_type<clang::QualType, Hash>,
      QualTypeComparator, true>, std::__1::allocator<std::__1::__value_type<clang::QualType, Hash> >
      >::find<clang::QualType>' requested here
    iterator find(const key_type& __k)             {return __tree_.find(__k);}
                                                                   ^
TypeDBEntry.cpp:154:19: note: in instantiation of member function 'std::__1::map<clang::QualType,
      Hash, QualTypeComparator, std::__1::allocator<std::__1::pair<const clang::QualType, Hash> >
      >::find' requested here
    search = seen.find(t);
                  ^
/usr/local/Cellar/llvm/5.0.1/include/c++/v1/map:472:10: note: candidate function not viable: no known
      conversion from 'const clang::QualType' to 'const std::__1::__value_type<clang::QualType, Hash>'
      for 2nd argument
    bool operator()(const _CP& __x, const _CP& __y) const
         ^
In file included from TypeDBEntry.cpp:2:
In file included from ./TypeDBEntry.h:4:
In file included from ./Utils.h:5:
In file included from ./AstRef.h:5:
./Json.h:25:10: error: ambiguous conversion for functional-style cast from 'const unsigned long long'
      to 'picojson::value'
{ return picojson::value(t); }
         ^~~~~~~~~~~~~~~~~
TypeDBEntry.cpp:692:27: note: in instantiation of function template specialization
      'to_json<unsigned long long>' requested here
        jsonObj["size"] = to_json(m_size / 8);
                          ^
./third-party/picojson-1.3.0/picojson.h:187:17: note: candidate constructor
  inline value::value(bool b) : type_(boolean_type) {
                ^
./third-party/picojson-1.3.0/picojson.h:192:17: note: candidate constructor
  inline value::value(int64_t i) : type_(int64_type) {
                ^
./third-party/picojson-1.3.0/picojson.h:197:17: note: candidate constructor
  inline value::value(double n) : type_(number_type) {
                ^
2 warnings and 5 errors generated.
make: *** [TypeDBEntry.o] Error 1

@evandrix This has been addressed in f1a962a. Let us know if there are additional concerns.