Add invalid deref tests.
This commit is contained in:
parent
21b342105b
commit
b8d475fd0c
24
test/NullDeref/Iterator.C
Normal file
24
test/NullDeref/Iterator.C
Normal 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user