diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-09-28 17:15:12 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-09-28 17:15:12 +0000 |
commit | e7126582a457b377df095ea2234d1206aaf9a4da (patch) | |
tree | 61f6ee39514da521511cc7b2f8c914ec079d051a /clang/test/Analysis/reference.cpp | |
parent | 5721daae02c7b0b9e9d399c5b9897e57325cbcf0 (diff) | |
download | bcm5719-llvm-e7126582a457b377df095ea2234d1206aaf9a4da.tar.gz bcm5719-llvm-e7126582a457b377df095ea2234d1206aaf9a4da.zip |
[analyzer] Create a temporary region for rvalue structs when accessing fields
Struct rvalues are represented in the analyzer by CompoundVals,
LazyCompoundVals, or plain ConjuredSymbols -- none of which have associated
regions. If the entire structure is going to persist, this is not a
problem -- either the rvalue will be assigned to an existing region, or
a MaterializeTemporaryExpr will be present to create a temporary region.
However, if we just need a field from the struct, we need to create the
temporary region ourselves.
This is inspired by the way CodeGen handles calls to temporaries;
support for that in the analyzer is coming next.
Part of <rdar://problem/12137950>
llvm-svn: 164828
Diffstat (limited to 'clang/test/Analysis/reference.cpp')
-rw-r--r-- | clang/test/Analysis/reference.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/test/Analysis/reference.cpp b/clang/test/Analysis/reference.cpp index 374f3f7261c..ce0ee8ed57d 100644 --- a/clang/test/Analysis/reference.cpp +++ b/clang/test/Analysis/reference.cpp @@ -116,10 +116,8 @@ void testReferenceAddress(int &x) { struct S { int &x; }; - // FIXME: Should be TRUE. Fields of return-by-value structs are not yet - // symbolicated. Tracked by <rdar://problem/12137950>. extern S getS(); - clang_analyzer_eval(&getS().x != 0); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(&getS().x != 0); // expected-warning{{TRUE}} extern S *getSP(); clang_analyzer_eval(&getSP()->x != 0); // expected-warning{{TRUE}} |