xref: /minix3/external/bsd/llvm/dist/clang/test/Analysis/diagnostics/explicit-suppression.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=false -verify %s
2 // RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=true -DSUPPRESSED=1 -verify %s
3 
4 #ifdef SUPPRESSED
5 // expected-no-diagnostics
6 #endif
7 
8 #include "../Inputs/system-header-simulator-cxx.h"
9 
10 void clang_analyzer_eval(bool);
11 
testCopyNull(int * I,int * E)12 void testCopyNull(int *I, int *E) {
13   std::copy(I, E, (int *)0);
14 #ifndef SUPPRESSED
15   // expected-warning@../Inputs/system-header-simulator-cxx.h:110 {{Dereference of null pointer}}
16 #endif
17 }
18