Home | History | Annotate | Download | only in diagnostics
      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 
      8 void testList_pop_front(std::list<int> list) {
      9   while(!list.empty())
     10     list.pop_front();  // no-warning
     11 }
     12 
     13 void testBasicStringSuppression() {
     14   std::basic_string<uint8_t> v;
     15   v.push_back(1); // no-warning
     16 }
     17 
     18 void testBasicStringSuppression_append() {
     19   std::basic_string<char32_t> v;
     20   v += 'c'; // no-warning
     21 }
     22 
     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;
     29 void testSuppression_independent_bits_engine(MyEngine& e) {
     30   std::__independent_bits_engine<MyEngine, unsigned int> x(e, 64); // no-warning
     31 }
     32 
     33 void testSuppression_std_shared_pointer() {
     34   std::shared_ptr<int> p(new int(1));
     35 
     36   p = nullptr; // no-warning
     37 }
     38