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

fix: compilation with clang >=18 #204

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

deepak1556
Copy link
Contributor

LLVM >= 18 has deprecated and removed char_trait implementation for non char types in llvm/llvm-project@c366877, for VSCode we build the native modules using libc++ and clang to align with the runtime, building current node-tree-sitter leads to the following error

/mnt/vss/_work/1/s/.build/libcxx_headers/include/__string/char_traits.h:617:23: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
  617 |   const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
      |                       ^
/mnt/vss/_work/1/s/.build/libcxx_headers/include/string:3375:15: note: in instantiation of function template specialization 'std::__str_find<unsigned short, unsigned long, std::char_traits<unsigned short>, 18446744073709551615UL>' requested here
 3375 |   return std::__str_find<value_type, size_type, traits_type, npos>(data(), size(), __c, __pos);
      |               ^
../src/node.cc:484:51: note: in instantiation of member function 'std::basic_string<unsigned short>::find' requested here
  484 |   bool contains(TSSymbol symbol) { return symbols.find(symbol) != symbols.npos; }
      |                                                   ^
/mnt/vss/_work/1/s/.build/libcxx_headers/include/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;

@amaanq amaanq merged commit a90b361 into tree-sitter:master Jun 19, 2024
7 checks passed
@amaanq
Copy link
Member

amaanq commented Jun 19, 2024

thanks!

@deepak1556 deepak1556 deleted the robo/fix_libcxx_errors branch June 19, 2024 16:16
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

Successfully merging this pull request may close these issues.

2 participants