[PATCH] Fix source range of destructor name

Richard Smith metafoo at gmail.com
Wed Jan 15 14:12:45 PST 2014


On Wed Jan 15 2014 at 2:07:59 PM, Olivier Goffart <ogoffart at kde.org> wrote:

> On Wednesday 15 January 2014 21:55:05 Richard Smith wrote:
> > On Wed Jan 15 2014 at 1:51:41 PM, Justin Bogner <mail at justinbogner.com>
> >
> > wrote:
> > > Olivier Goffart <ogoffart at kde.org> writes:
> > > > From d131af55d2dc2cb6b2f7242697eb44d2e5d042da Mon Sep 17 00:00:00
> 2001
> > > > From: Olivier Goffart <ogoffart at woboq.com>
> > > > Date: Wed, 15 Jan 2014 19:45:12 +0100
> > > > Subject: [PATCH] Fix source range of the destructor name.
> > > >
> > > > The problem is that the destructor's DeclarationNameInfo do not have
> > > > a TypeSourceInfo because Sema::GetNameForDeclarator requires the
> > > > ParsedType to be a LocInfoType.
> > > >
> > > > Setting a proper TypeSourceInfo to the destructor changes the way it
> > > > it printed (from '~Foo' to '~struct Foo'.  Hence the change in
> > > > DeclarationName.cpp which also fix a bug when printing operator
> names.
> > > >
> > > > http://llvm.org/bugs/show_bug.cgi?id=15125
> > >
> > > Please add a test with this. Some minor comments below.
>
> Thanks for the comments.
> Any hint on how the test should be?
> Is there already existing tests which tests source locations?
>

test/SemaCXX/sourceranges.cpp seems like a good fit for this test.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140115/5360b594/attachment.html>


More information about the cfe-commits mailing list