rust-lang / rust-bindgen

Automatically generates Rust FFI bindings to C (and some C++) libraries.
https://rust-lang.github.io/rust-bindgen/
BSD 3-Clause "New" or "Revised" License
4.23k stars 679 forks source link

can not get the non-type template arg? #2825

Open isbest opened 2 months ago

isbest commented 2 months ago

Input C/C++ Header

#pragma once

#include <stdint.h>
#include <string.h>

#include <string.h>

namespace hello
{
        template <typename T, std::size_t N>
        struct Array final
        {
            using iterator = T *;
            using size_type = std::size_t;
            void fill(const T &u) {}
            constexpr Array() { this->len = 0; }
            iterator begin() noexcept {}

        private:
            T container[N];
            size_type len;
        };

        void test_template_array(Array<int, 10> &arr);
    }
}

Bindgen Invocation

I hacked bindgen ir mod, and this function sig TemplateInstantiation can not found 10 in Array<int, 10>

Expected Results

i want to got test_template_array func correctly