[cfe-dev] Missing info from TypeLoc?

Richard Smith richard at metafoo.co.uk
Tue Mar 12 16:00:39 PDT 2013

On Tue, Mar 12, 2013 at 12:28 PM, Vane, Edwin <edwin.vane at intel.com> wrote:

> Hi all,
> Given this c++ code:
> const MyType *a;
> The TypeSourceInfo from the VarDecl provides a TypeLoc that claims the
> type starts at "MyType" not "const". Is this by design or is there a bug
> here?

QualifiedTypeLoc does not store location information for the type
qualifiers. This is "intentional" but clearly not ideal for tooling clients
of type location information. Since the decl-specifiers for such a
declaration can be in any order, the source range for such a type isn't
necessarily going to be useful, and you may be able to get the information
you're looking for by just looking at the start location of the Decl.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130312/eb6ab458/attachment.html>

More information about the cfe-dev mailing list