[cfe-dev] [Feature request] Enable libclang to report specific diagnostic error

Jørgen Kvalsvik jorgekva at stud.ntnu.no
Fri Mar 21 06:32:09 PDT 2014


Hi,

Please see this discussion as well
http://clang-developers.42468.n3.nabble.com/Proposal-Add-diagnostic-enumeration-to-libclang-tt3627785.html

I'm looking to implement some features in an IDE project using libclang.
In particular I'm investigating a feature allowing the IDE to suggest a
missing #include or forward declaration when stumbling upon a
"undeclared identifier" error.

Unfortunately, libclang does not expose any way of determining the
specific failure that triggers a problem, and clang itself does not
suggest any diagnostic. The only solution I've been able to find with
the current state of libclang is to parse the diagnostic message and try
to determine if it is because of an unknown declaration. This is of
course not a good solution - it is brittle and subject to breakage on
translation.

Are there any chance of getting a diagnostic enumeration to libclang? I
think the use case is obvious - in many tools it would be desirable to
suggest solutions to problems clang cannot figure out.

Thanks

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140321/e8bdaf01/attachment.sig>


More information about the cfe-dev mailing list