[PATCH] Fix for crash due to g++.old-deja/g++.other/using3.C

Richard Smith richard at metafoo.co.uk
Wed Apr 30 15:12:42 PDT 2014


Committed as r207677.

FIXME for members of base classes fixed in r207680.
Support for typo-correcting to member templates added in r207681.

================
Comment at: lib/Sema/SemaDeclCXX.cpp:7335-7337
@@ -7329,4 +7334,5 @@
+
     if (RequireMember && !isa<FieldDecl>(ND) && !isa<CXXMethodDecl>(ND) &&
         !isa<TypeDecl>(ND))
       return false;
 
----------------
Dinesh Dwivedi wrote:
> Richard Smith wrote:
> > Dinesh Dwivedi wrote:
> > > Richard Smith wrote:
> > > > Is this still necessary?
> > > yes, I have added one test case which fails if we comment these lines. I have kept these lines so that my change just filter out non class member if RequiredMember is true but should not add any other type of class member which it was not considering before my changes.
> > I think your testcase shows that these lines are in fact incorrect -- if the function template were in a base class, rather than in an unrelated class, typo correction *should* find it.
> No, in added test case, function template is not in base class.
> 
> 
Right, that's my point -- the reason we shouldn't find the function template is because it's not in a base class, *not* because it's a template. If it were in a base class but mistyped, typo correction *should* find it, but won't, because of this incorrect check.

http://reviews.llvm.org/D3051






More information about the cfe-commits mailing list