diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-07-17 17:16:33 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-07-17 17:16:33 +0000 |
commit | be2e1b11e3350e3a6e632c71beaab83aae3824d2 (patch) | |
tree | d20327c10f18933f562349da7e3bf7b75da852ef /test/Analysis/Inputs | |
parent | b17a2c119877b47cb3fb68c76a91dfe4d8cc6199 (diff) | |
download | clang-be2e1b11e3350e3a6e632c71beaab83aae3824d2.tar.gz |
[analyzer] Treat std::initializer_list as opaque rather than aborting.
Previously, the use of a std::initializer_list (actually, a
CXXStdInitializerListExpr) would cause the analyzer to give up on the rest
of the path. Now, it just uses an opaque symbolic value for the
initializer_list and continues on.
At some point in the future we can add proper support for initializer_list,
with access to the elements in the InitListExpr.
<rdar://problem/14340207>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186519 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/Inputs')
-rw-r--r-- | test/Analysis/Inputs/system-header-simulator-cxx.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Analysis/Inputs/system-header-simulator-cxx.h b/test/Analysis/Inputs/system-header-simulator-cxx.h index 8e96508ba5..1b6cbd4433 100644 --- a/test/Analysis/Inputs/system-header-simulator-cxx.h +++ b/test/Analysis/Inputs/system-header-simulator-cxx.h @@ -74,6 +74,34 @@ namespace std { extern const nothrow_t nothrow; + // libc++'s implementation + template <class _E> + class initializer_list + { + const _E* __begin_; + size_t __size_; + + initializer_list(const _E* __b, size_t __s) + : __begin_(__b), + __size_(__s) + {} + + public: + typedef _E value_type; + typedef const _E& reference; + typedef const _E& const_reference; + typedef size_t size_type; + + typedef const _E* iterator; + typedef const _E* const_iterator; + + initializer_list() : __begin_(0), __size_(0) {} + + size_t size() const {return __size_;} + const _E* begin() const {return __begin_;} + const _E* end() const {return __begin_ + __size_;} + }; + template<class InputIter, class OutputIter> OutputIter copy(InputIter II, InputIter IE, OutputIter OI) { while (II != IE) |