-
Notifications
You must be signed in to change notification settings - Fork 4k
[c++] Compilation on Linux fails with newer Clang #7204
Description
Compilation on modern Ubuntu Linux with Clang fails. Compilation on the same machine by GCC is successful.
Compilation produce a lot of mistakes:
CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake ..
make
....
/usr/bin/../lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/bits/stl_iterator.h:1337:19: error: member access into incomplete type 'const __normal_iterator<Json *, vector>'
1337 | -> decltype(__lhs.base() - __rhs.base())
| ^
/home/denplusplus/Programming/LightGBM/include/LightGBM/utils/json11.h:101:37: note: in instantiation of template class '__gnu_cxx::__normal_iterator<json11_internal_lightgbm::Json *, std::vector<json11_internal_lightgbm::Json>>' requested here
101 | std::string, decltype(std::declval().begin()->first)>::value &&
| ^
/home/denplusplus/Programming/LightGBM/include/LightGBM/utils/json11.h:105:12: note: while substituting prior template arguments into non-type template parameter [with M = array]
105 | explicit Json(const M &m) : Json(object(m.begin(), m.end())) {}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/denplusplus/Programming/LightGBM/include/LightGBM/utils/json11.h:113:31: note: while substituting deduced template arguments into function template 'Json' [with M = array, $1 = (no value)]
113 | explicit Json(const V &v) : Json(array(v.begin(), v.end())) {}
| ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/bits/stl_iterator.h:1026:11: note: definition of '__gnu_cxx::__normal_iterator<json11_internal_lightgbm::Json *, std::vector<json11_internal_lightgbm::Json>>' is not complete until the closing '}'
1026 | class __normal_iterator
| ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/bits/stl_iterator.h:1337:19: error: member access into incomplete type 'const __normal_iterator<char *, basic_string>'
1337 | -> decltype(__lhs.base() - __rhs.base())
| ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/bits/locale_facets_nonio.tcc:323:27: note: in instantiation of template class '__gnu_cxx::__normal_iterator<char *, std::basic_string>' requested here
323 | __res.insert(__res.begin(), '-');
| ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/bits/stl_iterator.h:1026:11: note: definition of '__gnu_cxx::__normal_iterator<char *, std::basic_string>' is not complete until the closing '}'
1026 | class __normal_iterator
| ^
...