2017-03-04 02:02:02 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=false -verify %s
|
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=true -DSUPPRESSED=1 -verify %s
|
2017-03-10 08:33:19 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -DSUPPRESSED=1 -verify %s
|
2013-04-02 08:26:15 +08:00
|
|
|
|
|
|
|
#ifdef SUPPRESSED
|
|
|
|
// expected-no-diagnostics
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "../Inputs/system-header-simulator-cxx.h"
|
|
|
|
|
|
|
|
void clang_analyzer_eval(bool);
|
|
|
|
|
2016-02-08 00:55:44 +08:00
|
|
|
class C {
|
|
|
|
// The virtual function is to make C not trivially copy assignable so that we call the
|
|
|
|
// variant of std::copy() that does not defer to memmove().
|
|
|
|
virtual int f();
|
|
|
|
};
|
|
|
|
|
|
|
|
void testCopyNull(C *I, C *E) {
|
|
|
|
std::copy(I, E, (C *)0);
|
2013-04-02 08:26:15 +08:00
|
|
|
#ifndef SUPPRESSED
|
2017-05-29 23:03:20 +08:00
|
|
|
// expected-warning@../Inputs/system-header-simulator-cxx.h:490 {{Called C++ object pointer is null}}
|
2013-04-02 08:26:15 +08:00
|
|
|
#endif
|
|
|
|
}
|