summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-06 21:41:04 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-06 21:41:04 +0000
commite0e9630e0776d4692aadda33b3d23bef470efa56 (patch)
treef3d40e3472570939898e4a37542032f8057660de /clang/lib/AST/Expr.cpp
parent1762d7cc356e4337692fa007eaadf7347f8ebc8e (diff)
downloadbcm5719-llvm-e0e9630e0776d4692aadda33b3d23bef470efa56.tar.gz
bcm5719-llvm-e0e9630e0776d4692aadda33b3d23bef470efa56.zip
When extracting the callee declaration from a call expression, be sure
to look through SubstNonTypeTemplateParmExprs. Then, update the IR generation of CallExprs to actually use CallExpr::getCalleeDecl() rather than attempting to mimick its behavior (badly). Fixes <rdar://problem/10063539>. llvm-svn: 139185
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 41fa850184e..26ff6f3b7d5 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -771,6 +771,12 @@ CallExpr::CallExpr(ASTContext &C, StmtClass SC, unsigned NumPreArgs,
Decl *CallExpr::getCalleeDecl() {
Expr *CEE = getCallee()->IgnoreParenCasts();
+
+ while (SubstNonTypeTemplateParmExpr *NTTP
+ = dyn_cast<SubstNonTypeTemplateParmExpr>(CEE)) {
+ CEE = NTTP->getReplacement()->IgnoreParenCasts();
+ }
+
// If we're calling a dereference, look at the pointer instead.
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(CEE)) {
if (BO->isPtrMemOp())
OpenPOWER on IntegriCloud