[cfe-commits] r109682 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaCXX/member-expr.cpp
Douglas Gregor
dgregor at apple.com
Wed Jul 28 15:27:53 PDT 2010
Author: dgregor
Date: Wed Jul 28 17:27:52 2010
New Revision: 109682
URL: http://llvm.org/viewvc/llvm-project?rev=109682&view=rev
Log:
Don't die when a member access refers to a non-class member via a
qualified name. Fixes <rdar://problem/8231724>.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaCXX/member-expr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=109682&r1=109681&r2=109682&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Jul 28 17:27:52 2010
@@ -2632,6 +2632,9 @@
while (DC->isTransparentContext())
DC = DC->getParent();
+ if (!DC->isRecord())
+ continue;
+
llvm::SmallPtrSet<CXXRecordDecl*,4> MemberRecord;
MemberRecord.insert(cast<CXXRecordDecl>(DC)->getCanonicalDecl());
Modified: cfe/trunk/test/SemaCXX/member-expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/member-expr.cpp?rev=109682&r1=109681&r2=109682&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/member-expr.cpp (original)
+++ cfe/trunk/test/SemaCXX/member-expr.cpp Wed Jul 28 17:27:52 2010
@@ -101,3 +101,17 @@
a.PopCleanupScope(); // expected-error{{no member named 'PopCleanupScope' in 'PR7508::A'}}
}
}
+
+namespace rdar8231724 {
+ namespace N {
+ template<typename T> struct X1;
+ int i;
+ }
+
+ struct X { };
+ struct Y : X { };
+
+ void f(Y *y) {
+ y->N::X1<int>; // expected-error{{'rdar8231724::N::X1' is not a member of class 'rdar8231724::Y'}}
+ }
+}
More information about the cfe-commits
mailing list