aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Analysis/array-struct-region.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-28 17:15:25 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-28 17:15:25 +0000
commit19ed6748ea2ff303040702cc6043b9a0c6ca9ce1 (patch)
tree22df0f48953de08756ce746d0177bcaf276f7355 /clang/test/Analysis/array-struct-region.cpp
parentb559f185842eef73066382adcdfda9255608ad6f (diff)
downloadllvm-19ed6748ea2ff303040702cc6043b9a0c6ca9ce1.zip
llvm-19ed6748ea2ff303040702cc6043b9a0c6ca9ce1.tar.gz
llvm-19ed6748ea2ff303040702cc6043b9a0c6ca9ce1.tar.bz2
[analyzer] Handle inlined constructors for rvalue temporaries correctly.
Previously the analyzer treated all inlined constructors like lvalues, setting the value of the CXXConstructExpr to the newly-constructed region. However, some CXXConstructExprs behave like rvalues -- in particular, the implicit copy constructor into a pass-by-value argument. In this case, we want only the /contents/ of a temporary object to be passed, so that we can use the same "copy each argument into the parameter region" algorithm that we use for scalar arguments. This may change when we start modeling destructors of temporaries, but for now this is the last part of <rdar://problem/12137950>. llvm-svn: 164830
Diffstat (limited to 'clang/test/Analysis/array-struct-region.cpp')
-rw-r--r--clang/test/Analysis/array-struct-region.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/clang/test/Analysis/array-struct-region.cpp b/clang/test/Analysis/array-struct-region.cpp
index 22fbf2f..e7fbe4d 100644
--- a/clang/test/Analysis/array-struct-region.cpp
+++ b/clang/test/Analysis/array-struct-region.cpp
@@ -61,12 +61,6 @@ int getAssignedField(struct S s) {
void testArgument() {
clang_analyzer_eval(getConstrainedField(getS()) == 42); // expected-warning{{TRUE}}
-#if __cplusplus
- // FIXME: Passing the struct by value seems to be confusing C++.
- // Possibly related to <rdar://problem/12137950>.
- // expected-warning@-4{{UNKNOWN}}
-#endif
-
clang_analyzer_eval(getAssignedField(getS()) == 42); // expected-warning{{TRUE}}
}