First of all many thanks for this work, it is an extremely helpful resource.
// minimal test case https://en.cppreference.com/w/cpp/numeric/bit_cast
#include <cstdint>
// this works until <bit> is included
// uncomment to see libclang error
// #include <bit>
constexpr double f64v = 19880124.0;
constexpr auto u64v = std::bit_cast<std::uint64_t>(f64v);
static_assert( std::bit_cast<double>(u64v) == f64v ); // round-trip
constexpr std::uint64_t u64v2 = 0x3fe9000000000000ull;
constexpr auto f64v2 = std::bit_cast<double>(u64v2);
static_assert( std::bit_cast<std::uint64_t>(f64v2) == u64v2 ); // round-trip
int main()
{
return 0;
}
python cindex-dump.py test.cpp -std=c++20
('diags', [])
Traceback (most recent call last):
File "cindex-dump.py", line 86, in <module>
main()
File "cindex-dump.py", line 83, in main
pprint(('nodes', get_info(tu.cursor)))
File "cindex-dump.py", line 43, in get_info
for c in node.get_children()]
File "cindex-dump.py", line 43, in <listcomp>
for c in node.get_children()]
File "cindex-dump.py", line 43, in get_info
for c in node.get_children()]
File "cindex-dump.py", line 43, in <listcomp>
for c in node.get_children()]
File "cindex-dump.py", line 43, in get_info
for c in node.get_children()]
File "cindex-dump.py", line 43, in <listcomp>
for c in node.get_children()]
File "cindex-dump.py", line 43, in get_info
for c in node.get_children()]
File "cindex-dump.py", line 43, in <listcomp>
for c in node.get_children()]
File "cindex-dump.py", line 43, in get_info
for c in node.get_children()]
File "cindex-dump.py", line 43, in <listcomp>
for c in node.get_children()]
File "cindex-dump.py", line 45, in get_info
'kind' : node.kind,
File "R:\apps\python3\lib\site-packages\clang\cindex.py", line 1541, in kind
return CursorKind.from_id(self._kind_id)
File "R:\apps\python3\lib\site-packages\clang\cindex.py", line 650, in from_id
raise ValueError('Unknown template argument kind %d' % id)
ValueError: Unknown template argument kind 280
clang -v
clang version 13.0.1
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: r:\apps\llvm\bin
pip show libclang
Name: libclang
Version: 13.0.0
Summary: Clang Python Bindings, mirrored from the official LLVM repo: https://github.com/llvm/llvm-project/tree/main/clang/bindings/python, to make the installation process easier.
Home-page: https://github.com/sighingnow/libclang
Author: Tao He
Author-email: [email protected]
License: Apache License 2.0
Location: r:\apps\python3\lib\site-packages