From c0244c5c351db18c6c35c1594872dde072b90df9 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 8 Sep 2011 17:56:33 +0000 Subject: [PATCH] Look through SubstNonTypeTemplateParmExpr nodes in the various Expr::Ignore* methods that also look through implicit casts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139303 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Expr.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 26ff6f3b7d..a3df189a61 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -2042,7 +2042,11 @@ Expr *Expr::IgnoreParenCasts() { E = Materialize->GetTemporaryExpr(); continue; } - + if (SubstNonTypeTemplateParmExpr *NTTP + = dyn_cast(E)) { + E = NTTP->getReplacement(); + continue; + } return E; } } @@ -2076,6 +2080,10 @@ Expr *Expr::IgnoreParenLValueCasts() { = dyn_cast(E)) { E = Materialize->GetTemporaryExpr(); continue; + } else if (SubstNonTypeTemplateParmExpr *NTTP + = dyn_cast(E)) { + E = NTTP->getReplacement(); + continue; } break; } @@ -2110,6 +2118,11 @@ Expr *Expr::IgnoreParenImpCasts() { E = Materialize->GetTemporaryExpr(); continue; } + if (SubstNonTypeTemplateParmExpr *NTTP + = dyn_cast(E)) { + E = NTTP->getReplacement(); + continue; + } return E; } } @@ -2167,6 +2180,12 @@ Expr *Expr::IgnoreParenNoopCasts(ASTContext &Ctx) { } } + if (SubstNonTypeTemplateParmExpr *NTTP + = dyn_cast(E)) { + E = NTTP->getReplacement(); + continue; + } + return E; } }