Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / diagnostics / implicit-cxx-std-suppression.cpp
blob35f8798c81ae1d2b81bcfdd37b3d3f471c9ffab9
1 // 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
3 // 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
6 // expected-no-diagnostics
8 #include "../Inputs/system-header-simulator-cxx-std-suppression.h"
10 void testList_pop_front(std::list<int> list) {
11 while(!list.empty())
12 list.pop_front(); // no-warning
15 void testBasicStringSuppression() {
16 std::basic_string<uint8_t> v;
17 v.push_back(1); // no-warning
20 void testBasicStringSuppression_append() {
21 std::basic_string<char32_t> v;
22 v += 'c'; // no-warning
25 void testBasicStringSuppression_assign(std::basic_string<char32_t> &v,
26 const std::basic_string<char32_t> &v2) {
27 v = v2; // no-warning
30 class MyEngine;
31 void testSuppression_independent_bits_engine(MyEngine& e) {
32 std::__independent_bits_engine<MyEngine, unsigned int> x(e, 64); // no-warning
35 void testSuppression_std_shared_pointer() {
36 std::shared_ptr<int> p(new int(1));
38 p = nullptr; // no-warning