diff options
-rw-r--r-- | lib/AST/Expr.cpp | 3 | ||||
-rw-r--r-- | test/SemaCXX/unused.cpp | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index acf119ab79..d89290bbb9 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -500,7 +500,8 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1, 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 0000000000..55f959de0f --- /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; +} |