summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-26 00:44:06 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-26 00:44:06 +0000
commitff790f15c4ec28062ef2cdec9674a6284c29c819 (patch)
tree16f225ee467790e61ab262c87a2de0d8423a2e38 /clang/lib/Sema/SemaExprCXX.cpp
parenta4c986cbddac04d7bc496d977e32cfeee0f3d7ab (diff)
downloadbcm5719-llvm-ff790f15c4ec28062ef2cdec9674a6284c29c819.tar.gz
bcm5719-llvm-ff790f15c4ec28062ef2cdec9674a6284c29c819.zip
Refactor our handling of expression evaluation contexts, so that Sema
maintains a stack of evaluation contexts rather than having the parser do it. This change made it simpler to track in which contexts temporaries were created, so that we could... "Forget" about temporaries created within unevaluated contexts, so that we don't build a CXXExprWithTemporaries and, therefore, destroy the integral-constness of our expressions. Fixes PR5609. llvm-svn: 89908
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 3b18b3a1ba9..af7a56fb7b0 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -63,10 +63,11 @@ Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc,
}
}
- // If this is an unevaluated operand, clear out the set of declaration
- // references we have been computing.
+ // If this is an unevaluated operand, clear out the set of
+ // declaration references we have been computing and eliminate any
+ // temporaries introduced in its computation.
if (isUnevaluatedOperand)
- PotentiallyReferencedDeclStack.back().clear();
+ ExprEvalContexts.back().Context = Unevaluated;
}
return Owned(new (Context) CXXTypeidExpr(isType, TyOrExpr,
OpenPOWER on IntegriCloud