Initial, rudimentary implementation of operator overloading for binary
operators. For example, one can now write "x + y" where x or y is a
class or enumeration type, and Clang will perform overload resolution
for "+" based on the overloaded operators it finds.
The other kinds of overloadable operators in C++ will follow this same
approach.
Three major issues remain:
1) We don't find member operators
2) Since we don't have user-defined conversion operators, we can't
call any of the built-in overloaded operators in C++ [over.built].
3) Once we've done the semantic checks, we drop the overloaded
operator on the floor; it doesn't get into the AST at all.
llvm-svn: 58821
diff --git a/clang/Driver/PrintParserCallbacks.cpp b/clang/Driver/PrintParserCallbacks.cpp
index 43dbf34..996051a 100644
--- a/clang/Driver/PrintParserCallbacks.cpp
+++ b/clang/Driver/PrintParserCallbacks.cpp
@@ -496,7 +496,8 @@
return 0;
}
- virtual ExprResult ActOnBinOp(SourceLocation TokLoc, tok::TokenKind Kind,
+ virtual ExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
+ tok::TokenKind Kind,
ExprTy *LHS, ExprTy *RHS) {
llvm::cout << __FUNCTION__ << "\n";
return 0;