Add invalid deref tests.

This commit is contained in:
CristinaCristescu 2015-12-16 10:21:10 +01:00 committed by sftnight
parent 21b342105b
commit b8d475fd0c

24
test/NullDeref/Iterator.C Normal file
View File

@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -Xclang -verify
// This test verifies that we do not produce a warning when an iterator is derefed.
#include <vector>
class MyClass {
public:
MyClass() {}
};
std::vector<MyClass*> vect(3);
for (auto it = vect.begin(), end = vect.end(); it != end; ++it)
printf("%s\n", *it);
.q