blob: 35f8798c81ae1d2b81bcfdd37b3d3f471c9ffab9 [file] [log] [blame]
Dominic Chen184c6242017-03-03 18:02:02 +00001// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -std=c++11 -verify %s
2// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -std=c++11 -verify %s
Artem Dergachevd3c54312018-01-24 21:24:10 +00003// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -std=c++11 -DTEST_INLINABLE_ALLOCATORS -verify %s
4// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -std=c++11 -DTEST_INLINABLE_ALLOCATORS -verify %s
Devin Coughlin0a53fdf2016-07-06 21:52:55 +00005
6// expected-no-diagnostics
7
8#include "../Inputs/system-header-simulator-cxx-std-suppression.h"
9
10void testList_pop_front(std::list<int> list) {
11 while(!list.empty())
12 list.pop_front(); // no-warning
13}
14
15void testBasicStringSuppression() {
16 std::basic_string<uint8_t> v;
17 v.push_back(1); // no-warning
18}
19
20void testBasicStringSuppression_append() {
21 std::basic_string<char32_t> v;
22 v += 'c'; // no-warning
23}
24
25void testBasicStringSuppression_assign(std::basic_string<char32_t> &v,
26 const std::basic_string<char32_t> &v2) {
27 v = v2; // no-warning
28}
29
30class MyEngine;
31void testSuppression_independent_bits_engine(MyEngine& e) {
32 std::__independent_bits_engine<MyEngine, unsigned int> x(e, 64); // no-warning
33}
34
35void testSuppression_std_shared_pointer() {
36 std::shared_ptr<int> p(new int(1));
37
38 p = nullptr; // no-warning
39}