Author: faisalv Date: Sun Aug 27 12:00:08 2017 New Revision: 311855 URL: http://llvm.org/viewvc/llvm-project?rev=311855&view=rev Log: revert changes from r311851.
The right answers here (and how clang needs to be tweaked) require further analysis (ongoing cwg thread). sorry. Modified: cfe/trunk/lib/Sema/SemaExprMember.cpp cfe/trunk/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp Modified: cfe/trunk/lib/Sema/SemaExprMember.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprMember.cpp?rev=311855&r1=311854&r2=311855&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprMember.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprMember.cpp Sun Aug 27 12:00:08 2017 @@ -102,15 +102,15 @@ static IMAKind ClassifyImplicitMemberAcc bool hasNonInstance = false; bool isField = false; BaseSet Classes; - for (const NamedDecl *const D : R) { + for (NamedDecl *D : R) { + // Look through any using decls. + D = D->getUnderlyingDecl(); + if (D->isCXXInstanceMember()) { - // Look through any using decls. - const NamedDecl *const UnderlyingDecl = D->getUnderlyingDecl(); - isField |= isa<FieldDecl>(UnderlyingDecl) || - isa<MSPropertyDecl>(UnderlyingDecl) || - isa<IndirectFieldDecl>(UnderlyingDecl); + isField |= isa<FieldDecl>(D) || isa<MSPropertyDecl>(D) || + isa<IndirectFieldDecl>(D); - const CXXRecordDecl *R = cast<CXXRecordDecl>(D->getDeclContext()); + CXXRecordDecl *R = cast<CXXRecordDecl>(D->getDeclContext()); Classes.insert(R->getCanonicalDecl()); } else hasNonInstance = true; Modified: cfe/trunk/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp?rev=311855&r1=311854&r2=311855&view=diff ============================================================================== --- cfe/trunk/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp (original) +++ cfe/trunk/test/CXX/class/class.mfct/class.mfct.non-static/p3.cpp Sun Aug 27 12:00:08 2017 @@ -64,26 +64,17 @@ namespace test2 { template <class T> struct A { void foo(); - void foo2(); - static void static_foo(); - static void static_foo2(); - + void test0() { Unrelated::foo(); // expected-error {{call to non-static member function without an object argument}} } void test1() { B<T>::foo(); - B<T>::foo2(); // expected-error {{call to non-static member function without an object argument}} - B<T>::static_foo(); - B<T>::static_foo2(); } static void test2() { B<T>::foo(); // expected-error {{call to non-static member function without an object argument}} - B<T>::foo2(); // expected-error {{call to non-static member function without an object argument}} - B<T>::static_foo(); - B<T>::static_foo2(); } void test3() { @@ -92,17 +83,15 @@ namespace test2 { }; template <class T> struct B : A<T> { - using A<T>::foo2; - using A<T>::static_foo2; }; - + template <class T> struct C { }; int test() { A<int> a; a.test0(); // no instantiation note here, decl is ill-formed - a.test1(); // expected-note {{in instantiation}} + a.test1(); a.test2(); // expected-note {{in instantiation}} a.test3(); // expected-note {{in instantiation}} } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits