This fix was actually not correct. A better fix is coming from Guillaume shortly.
> -----Original Message----- > From: [email protected] [mailto:cfe-commits- > [email protected]] On Behalf Of Rafael EspĂndola > Sent: Monday, May 06, 2013 11:14 AM > To: Bernal, Ariel J > Cc: [email protected] > Subject: Re: Fix for The Add Override transform crashes if Google Test is > #included > > Can you include a test? > > On 29 April 2013 14:53, Bernal, Ariel J <[email protected]> wrote: > > This patch fixes PR15827, add override options was not checking if the > > method declaration was in the main file. > > > > > > > > > > > > > > > > diff --git a/cpp11-migrate/AddOverride/AddOverrideActions.cpp > > b/cpp11-migrate/AddOverride/AddOverrideActions.cpp > > > > index a40f673..3d1f1ff 100644 > > > > --- a/cpp11-migrate/AddOverride/AddOverrideActions.cpp > > > > +++ b/cpp11-migrate/AddOverride/AddOverrideActions.cpp > > > > @@ -30,10 +30,14 @@ void AddOverrideFixer::run(const > > MatchFinder::MatchResult &Result) { > > > > SourceManager &SM = *Result.SourceManager; > > > > const CXXMethodDecl *M = > > Result.Nodes.getDeclAs<CXXMethodDecl>(MethodId); > > > > assert(M && "Bad Callback. No node provided"); > > > > + // Check that the method declaration in the main file > > > > + if (!SM.isFromMainFile(M->getLocStart())) > > > > + return; > > > > + > > > > // First check that there isn't already an override attribute. > > > > if (!M->hasAttr<OverrideAttr>()) { > > > > if (M->getLocStart().isFileID()) { > > > > SourceLocation StartLoc; > > > > if (M->hasInlineBody()) { > > > > > > _______________________________________________ > > cfe-commits mailing list > > [email protected] > > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
