[cfe-dev] Adding -add-override functionality to cpp11-migrate tool

Vane, Edwin edwin.vane at intel.com
Tue Feb 5 11:11:17 PST 2013


In the past I found that the semi-colon for lines doesn't seem to be included in the source range for statements. I ended up using an instance of the lexer to locate it. You might be able to do something similar to find the right-most parenthesis. Alternatively, clang should probably just be improved to provide that sort of info.

From: Philip Dunstan [mailto:phil at philipdunstan.com]
Sent: Tuesday, February 05, 2013 2:02 PM
To: Dmitri Gribenko
Cc: cfe-dev at cs.uiuc.edu; Matthieu Monrocq; Vane, Edwin
Subject: Re: [cfe-dev] Adding -add-override functionality to cpp11-migrate tool

I've attached patches that include this new test:



Phil
--
Philip Dunstan
phil at philipdunstan.com<mailto:phil at philipdunstan.com>
www.philipdunstan.com<http://www.philipdunstan.com>

On Tue, Feb 5, 2013 at 7:23 PM, Dmitri Gribenko <gribozavr at gmail.com<mailto:gribozavr at gmail.com>> wrote:
On Tue, Feb 5, 2013 at 7:44 PM, Philip Dunstan <phil at philipdunstan.com<mailto:phil at philipdunstan.com>> wrote:
> I haven't modified yet how the insertion point for the override keyword is
> calculated. Dmitri suggested FunctionTypeLoc::getRParenLoc() but I don't
> think that this will work if there is a trailing const keyword or deferred
> return type.
Could you please add a test with a trailing return type anyway?

class A {
public:
  virtual int h();
};

class B {
public:
  auto h() -> int;
};

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com<mailto:gribozavr at gmail.com>>*/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130205/a69f2ffa/attachment.html>


More information about the cfe-dev mailing list