Add lambda test for null deref.

This commit is contained in:
CristinaCristescu
2016-02-04 14:52:22 +01:00
committed by sftnight
parent 66736733d9
commit 2906250d08

View File

@ -7,7 +7,9 @@
//------------------------------------------------------------------------------
// RUN: cat %s | %cling -Xclang -verify
// This test verifies that we do not produce a warning when an iterator is derefed.
// This test verifies that we do not produce a warning when
// - an iterator is derefed;
// - a lambda function is derefed.
#include <vector>
@ -16,4 +18,10 @@ class MyClass;
std::vector<MyClass*> vect(3);
for (auto it = vect.begin(); it != vect.end(); ++it) MyClass* ptr = *it;
// expected-no-diagnostics
auto lamb =[](int x){return x;};
*lamb;
// expected-no-diagnostics
.q