blob: 197fad5d0b7de2ae16b40b0473325a9c915da436 [file] [log] [blame]
Dominic Chen1cb02562017-03-02 22:45:24 +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
Devin Coughlin0a53fdf2016-07-06 21:52:55 +00003
4// expected-no-diagnostics
5
6#include "../Inputs/system-header-simulator-cxx-std-suppression.h"
7
8void testList_pop_front(std::list<int> list) {
9 while(!list.empty())
10 list.pop_front(); // no-warning
11}
12
13void testBasicStringSuppression() {
14 std::basic_string<uint8_t> v;
15 v.push_back(1); // no-warning
16}
17
18void testBasicStringSuppression_append() {
19 std::basic_string<char32_t> v;
20 v += 'c'; // no-warning
21}
22
23void testBasicStringSuppression_assign(std::basic_string<char32_t> &v,
24 const std::basic_string<char32_t> &v2) {
25 v = v2; // no-warning
26}
27
28class MyEngine;
29void testSuppression_independent_bits_engine(MyEngine& e) {
30 std::__independent_bits_engine<MyEngine, unsigned int> x(e, 64); // no-warning
31}
32
33void testSuppression_std_shared_pointer() {
34 std::shared_ptr<int> p(new int(1));
35
36 p = nullptr; // no-warning
37}