[cfe-dev] [libclang] A consistent API for template parameters

Emilio Cobos Álvarez via cfe-dev cfe-dev at lists.llvm.org
Tue May 2 01:59:42 PDT 2017


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170502/28aa20e2/attachment.sig>


More information about the cfe-dev mailing list