[libclang] A consistent API for template parameters

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[libclang] A consistent API for template parameters

Romanenkov Kirill via cfe-dev
Hi,

So a while ago I submitted [1] in order to be able to introspect type
alias declarations' template arguments from libclang.

That worked, and it's consistent, but caused some regressions that
people relied on, like default template parameters not being reported
where they were before (see [2]).

I thought that fixing this was going to be as easy as checking first
what libclang 3.9 used to check[3], but Richard Smith pointed out that
that was inconsistent (which I agree with), so for now we've reverted
back to the libclang 4.0 behavior at[4].

I think this is ok, because the changes that people that depended on the
original behavior of that API need to do are minimal AIUI (you only need
to get the canonical type), and if you relied on that behavior on
template aliases it's pretty likely you have bugs when introspecting
template alias that desugar into a record declaration.

But that leaves the question of whether there should be a nicer/more
explicit API, and how that would look like, so I'm sending this mail in
case anyone has any opinion on the matter.

Thanks in advance.

 -- Emilio

[1]: https://reviews.llvm.org/D26663
[2]: https://bugs.llvm.org//show_bug.cgi?id=32539
[3]: https://reviews.llvm.org/D32348
[4]: https://reviews.llvm.org/D32566

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

signature.asc (499 bytes) Download Attachment