treat it as a unary operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88938
91177308-0d34-0410-b5e6-
96231b3b80d8
return getSema().CreateBuiltinArraySubscriptExpr(move(First),
DRE->getLocStart(),
move(Second), OpLoc);
+ } else if (Op == OO_Arrow) {
+ // -> is never a builtin operation.
+ return SemaRef.BuildOverloadedArrowExpr(0, move(First), OpLoc);
} else if (SecondExpr == 0 || isPostIncDec) {
if (!FirstExpr->getType()->isOverloadableType()) {
// The argument is not of overloadable type, so try to create a
--- /dev/null
+// RUN: clang-cc -fsyntax-only -verify %s
+// PR5488
+
+struct X {
+ int x;
+};
+
+struct Iter {
+ X* operator->();
+};
+
+template <typename T>
+void Foo() {
+ (void)Iter()->x;
+}
+
+void Func() {
+ Foo<int>();
+}
+