[cfe-commits] r124243 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaCXX/arrow-operator.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Tue Jan 25 15:16:36 PST 2011
Author: akirtzidis
Date: Tue Jan 25 17:16:36 2011
New Revision: 124243
URL: http://llvm.org/viewvc/llvm-project?rev=124243&view=rev
Log:
Fix infinite loop during error diagnostics. Fixes rdar://8875304.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaCXX/arrow-operator.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=124243&r1=124242&r2=124243&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Jan 25 17:16:36 2011
@@ -3814,7 +3814,7 @@
// - 'type' is an Objective C type
// - 'bar' is a pseudo-destructor name which happens to refer to
// the appropriate pointer type
- } else if (Ptr->getPointeeType()->isRecordType() &&
+ } else if (!IsArrow && Ptr->getPointeeType()->isRecordType() &&
MemberName.getNameKind() != DeclarationName::CXXDestructorName) {
Diag(OpLoc, diag::err_typecheck_member_reference_suggestion)
<< BaseType << int(IsArrow) << BaseExpr->getSourceRange()
Modified: cfe/trunk/test/SemaCXX/arrow-operator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/arrow-operator.cpp?rev=124243&r1=124242&r2=124243&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/arrow-operator.cpp (original)
+++ cfe/trunk/test/SemaCXX/arrow-operator.cpp Tue Jan 25 17:16:36 2011
@@ -23,3 +23,16 @@
d->f();
e->f(); // expected-error{{incomplete definition of type}}
}
+
+// rdar://8875304
+namespace rdar8875304 {
+class Point {};
+class Line_Segment{ public: Line_Segment(const Point&){} };
+class Node { public: Point Location(){ Point p; return p; } };
+
+void f()
+{
+ Node** node1;
+ Line_Segment(node1->Location()); // expected-error {{not a structure or union}}
+}
+}
More information about the cfe-commits
mailing list