left-hand side of an -> operator is a pointer to class type.
llvm-svn: 360387
FirstIteration = false;
}
- if (OpKind == tok::arrow &&
- (BaseType->isPointerType() || BaseType->isObjCObjectPointerType()))
- BaseType = BaseType->getPointeeType();
+ if (OpKind == tok::arrow) {
+ if (BaseType->isPointerType())
+ BaseType = BaseType->getPointeeType();
+ else if (auto *AT = Context.getAsArrayType(BaseType))
+ BaseType = AT->getElementType();
+ }
}
// Objective-C properties allow "." access on Objective-C pointer types,
#endif
}
+namespace ArrayMemberAccess {
+ struct A {
+ int x;
+ template<typename T> int f() const;
+ };
+ void f(const A (&a)[]) {
+ // OK: not a template-id.
+ bool cond = a->x < 10 && a->x > 0;
+ // OK: a template-id.
+ a->f<int>();
+ }
+}
+
// PR11109 must appear at the end of the source file
class pr11109r3 { // expected-note{{to match this '{'}}
public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}}