PR4103: Silence bogus unused expression warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70384 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index acf119a..d89290b 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -500,7 +500,8 @@
return true;
case CallExprClass:
- case CXXOperatorCallExprClass: {
+ case CXXOperatorCallExprClass:
+ case CXXMemberCallExprClass: {
// If this is a direct call, get the callee.
const CallExpr *CE = cast<CallExpr>(this);
const Expr *CalleeExpr = CE->getCallee()->IgnoreParenCasts();
diff --git a/test/SemaCXX/unused.cpp b/test/SemaCXX/unused.cpp
new file mode 100644
index 0000000..55f959d
--- /dev/null
+++ b/test/SemaCXX/unused.cpp
@@ -0,0 +1,15 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+// PR4103 : Make sure we don't get a bogus unused expression warning
+class APInt {
+ char foo;
+};
+class APSInt : public APInt {
+ char bar;
+public:
+ APSInt &operator=(const APSInt &RHS);
+};
+
+APSInt& APSInt::operator=(const APSInt &RHS) {
+ APInt::operator=(RHS);
+ return *this;
+}