aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaPseudoObject.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-04-16 22:32:04 +0000
committerJohn McCall <rjmccall@apple.com>2013-04-16 22:32:04 +0000
commitd314abeffba04dffc101e4e71cc3a32ddeed4ae6 (patch)
treedaea7d7116123105158e53cd26dce153a48475eb /lib/Sema/SemaPseudoObject.cpp
parentfb599a4cc5665afe8da11d438ae021a5cd8cfdbd (diff)
Don't put too much thought into whether or not to capture a
type-dependent intermediate result in a postfix ++ pseudo- object operation. Test case by Tong Shen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179637 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaPseudoObject.cpp')
-rw-r--r--lib/Sema/SemaPseudoObject.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp
index 560efa5a4e..795cfbacfb 100644
--- a/lib/Sema/SemaPseudoObject.cpp
+++ b/lib/Sema/SemaPseudoObject.cpp
@@ -441,7 +441,8 @@ PseudoOpBuilder::buildIncDecOperation(Scope *Sc, SourceLocation opcLoc,
QualType resultType = result.get()->getType();
// That's the postfix result.
- if (UnaryOperator::isPostfix(opcode) && CanCaptureValueOfType(resultType)) {
+ if (UnaryOperator::isPostfix(opcode) &&
+ (result.get()->isTypeDependent() || CanCaptureValueOfType(resultType))) {
result = capture(result.take());
setResultToLastSemantic();
}