• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -analyze -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_cc1 -analyze -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
3 
4 // expected-no-diagnostics
5 
6 #include "../Inputs/system-header-simulator-cxx-std-suppression.h"
7 
testList_pop_front(std::list<int> list)8 void testList_pop_front(std::list<int> list) {
9   while(!list.empty())
10     list.pop_front();  // no-warning
11 }
12 
testBasicStringSuppression()13 void testBasicStringSuppression() {
14   std::basic_string<uint8_t> v;
15   v.push_back(1); // no-warning
16 }
17 
testBasicStringSuppression_append()18 void testBasicStringSuppression_append() {
19   std::basic_string<char32_t> v;
20   v += 'c'; // no-warning
21 }
22 
testBasicStringSuppression_assign(std::basic_string<char32_t> & v,const std::basic_string<char32_t> & v2)23 void testBasicStringSuppression_assign(std::basic_string<char32_t> &v,
24                                        const std::basic_string<char32_t> &v2) {
25   v = v2; // no-warning
26 }
27 
28 class MyEngine;
testSuppression_independent_bits_engine(MyEngine & e)29 void testSuppression_independent_bits_engine(MyEngine& e) {
30   std::__independent_bits_engine<MyEngine, unsigned int> x(e, 64); // no-warning
31 }
32 
testSuppression_std_shared_pointer()33 void testSuppression_std_shared_pointer() {
34   std::shared_ptr<int> p(new int(1));
35 
36   p = nullptr; // no-warning
37 }
38