cxx-method-names.cpp revision 8e8fb3be5bd78f0564444eca02b404566a5f3b5d
1// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s
2// expected-no-diagnostics
3
4class Evil {
5public:
6  void system(int); // taint checker
7  void malloc(void *); // taint checker, malloc checker
8  void free(); // malloc checker, keychain checker
9  void fopen(); // stream checker
10  void feof(int, int); // stream checker
11  void open(); // unix api checker
12};
13
14void test(Evil &E) {
15  // no warnings, no crashes
16  E.system(0);
17  E.malloc(0);
18  E.free();
19  E.fopen();
20  E.feof(0,1);
21  E.open();
22}
23