thierry-martinez / clangml

OCaml bindings for Clang
BSD 2-Clause "Simplified" License
13 stars 2 forks source link

"const" unseen in LValueReference with libclang-16. #13

Open ttamttam opened 3 weeks ago

ttamttam commented 3 weeks ago

Hello.

I managed to install clangml with libclang-16 on a bookworm debian (WSL) with ocaml 5.1.1:

Compared to libclang-11, "const" are not seen by the parser in LValueReferences: do you know if something changed between those version that would explain this behaviour?

Example: in the following code, the two "const" are missed.

    class AFM_API tfm_acquisition_PE_specification : public acquisition_specification
    {
    public:
        struct implementation;
        tfm_acquisition_PE_specification(const tfm_acquisition_PE_specification& other);
        tfm_acquisition_PE_specification& operator=(const tfm_acquisition_PE_specification& other);
        ~tfm_acquisition_PE_specification();

If i dump the AST, I obtain something like that:

 desc =
                                                LValueReference
                                                ({ cxtype = <opaque>;
                                                   type_loc = <opaque>;
                                                   const = false;
                                                   volatile = false;
                                                   restrict = false;
                                                   desc =
                                                   Record
                                                   ({ nested_name_specifier =
                                                      None;
                                                      name =
                                                      IdentifierName
                                                      ("tfm_acquisition_PE_specification");
                                                      template_arguments = []
                                                      })
                                                   })
                                                };

while I have const = true with libclang-11.

I hope my question is understandable.

ttamttam commented 3 weeks ago

Solved after I switched to libclang-15.