--===============0286039827049018281== Content-Type: multipart/signed; boundary="nextPart4183614.fQKduhuNbb"; micalg="pgp-sha1"; protocol="application/pgp-signature" --nextPart4183614.fQKduhuNbb Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Hey all, I want to scratch my own itch by fixing the issue that clang_getCanonicalTy= pe=20 does not deduce the type for variables such as `auto i =3D 1;`. See for con= text: https://llvm.org/bugs/show_bug.cgi?id=3D18669 http://clang-developers.42468.n3.nabble.com/API-for-auto-type-deduction-in-= libclang-td4037350.html I added a simple unit test as the first step: $ cat test/Index/cxx11-print-type.cpp auto a =3D 1; // RUN: c-index-test -test-print-type -std=3Dc++11 %s | FileCheck %s // CHECK: VarDecl=3Da:1:6 [type=3Dauto] [typeKind=3DUnexposed] [canonicaltype=3Dint] [canonicaltypekind=3DInt] [isPOD=3D1] Running the first half manually I get: VarDecl=3Da:1:6 (Definition) [type=3Dauto] [typekind=3DUnexposed] [isPO= D=3D0] Sadly, I'm a bit lost as to where I'd have to fix this. Looking at=20 CXType.cpp's clang_getCanonicalType implementation, I tried something like= =20 this: fprintf(stderr, "--------------> undeduced?: %d\n", T->isUndeducedType(= )); if (T->isUndeducedType()) { auto d =3D T->getContainedAutoType()->getDeducedType(); fprintf(stderr, "--------------> deduced valid? %d\n", !d.isNull()); if (!d.isNull()) { T =3D d; } } =20 This shows me that for the above input (i.e. `auto i =3D 1;`), the type is= =20 undeduced, but I also cannot force deduction by getDeducedType (probably me= =20 abusing/misinterpreting the API). So what can be done here - how could it b= e=20 fixed? Where would it be fixed? Thanks =2D-=20 Milian Wolff mail@milianw.de http://milianw.de --nextPart4183614.fQKduhuNbb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlW04SIACgkQDA6yEs0dE5MJnACglge36W4uQts+PoJ/ABFyIjwL /h4An1hd+sxhhXpRvkSnSeJcDrerzUBY =EOkj -----END PGP SIGNATURE----- --nextPart4183614.fQKduhuNbb-- --===============0286039827049018281== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ cfe-dev mailing list cfe-dev@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev --===============0286039827049018281==--