brintos

brintos / llvm-project-archived public Read only

0
0
Text · 879 B · 3a904da Raw
25 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=false -verify %s2// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=true -DSUPPRESSED=1 -verify %s3// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -DSUPPRESSED=1 -verify %s4 5#ifdef SUPPRESSED6// expected-no-diagnostics7#endif8 9#include "../Inputs/system-header-simulator-cxx.h"10 11void clang_analyzer_eval(bool);12 13class C {14  // The virtual function is to make C not trivially copy assignable so that we call the15  // variant of std::copy() that does not defer to memmove().16  virtual int f();17};18 19void testCopyNull(C *I, C *E) {20  std::copy(I, E, (C *)0);21#ifndef SUPPRESSED22  // expected-warning@#system_header_simulator_cxx_std_copy_impl_loop {{Called C++ object pointer is null}}23#endif24}25