diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-06-21 17:22:09 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-06-21 17:22:09 +0000 |
commit | 14d251cd62942bf7d56bb87a267ba2ca2f7fae3e (patch) | |
tree | 5ae5636ba702ce6cd8d00353f01dee91cb020ebe /lib/AST/Expr.cpp | |
parent | 03e80030515c800d1ab44125b9052dfffd1bd04c (diff) |
Fix a crash when a pointer-to-member function is called in the condition
expression of '?:'. Add a test case for this pattern, and also test the
code that led to the crash in a "working" case as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 31972bdd23..1faceb9425 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -2045,7 +2045,7 @@ Expr *Expr::IgnoreParenImpCasts() { Expr *Expr::IgnoreConversionOperator() { if (CXXMemberCallExpr *MCE = dyn_cast<CXXMemberCallExpr>(this)) { - if (isa<CXXConversionDecl>(MCE->getMethodDecl())) + if (MCE->getMethodDecl() && isa<CXXConversionDecl>(MCE->getMethodDecl())) return MCE->getImplicitObjectArgument(); } return this; |