diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-04-29 16:35:53 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-04-29 16:35:53 +0000 |
commit | 852871abbff45f1c1d3787755a27fce08365b166 (patch) | |
tree | 3ecdecc367a6703f766d82816b07fcd9f00abe36 | |
parent | a3f4540eba16e23e4589e032260ddff06f363e82 (diff) |
PR4103: Silence bogus unused expression warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70384 91177308-0d34-0410-b5e6-96231b3b80d8
-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; +} |