infinit recursion. This patch fixes it. [13.3.1.2]-p2
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83124
91177308-0d34-0410-b5e6-
96231b3b80d8
def err_ident_in_pseudo_dtor_not_a_type : Error<
"identifier %0 in pseudo-destructor expression does not name a type">;
+def err_operator_arrow_circular : Error<
+ "circular pointer delegation detected">;
def err_pseudo_dtor_base_not_scalar : Error<
"object expression of non-scalar type %0 cannot be used in a "
"pseudo-destructor expression">;
BaseExpr = (Expr*)Base.get();
if (BaseExpr == NULL)
return ExprError();
+ if (Context.getCanonicalType(BaseExpr->getType()) ==
+ Context.getCanonicalType(BaseType)) {
+ Diag(OpLoc, diag::err_operator_arrow_circular);
+ return ExprError();
+ }
BaseType = BaseExpr->getType();
}
}
struct AA { bool operator!=(AA&); };
struct BB : AA {};
bool x(BB y, BB z) { return y != z; }
+
+
+struct AX {
+ AX& operator ->();
+ int b;
+};
+
+void m() {
+ AX a;
+ a->b = 0; // expected-error {{circular pointer delegation detected}}
+}