| // RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core -analyzer-output=plist-multi-file -o %t.plist -verify -analyzer-config eagerly-assume=false %s |
| // RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/cxx-for-range.cpp.plist - |
| *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}} |
| *(volatile int *)0 = 1; // no-warning |
| MagicVector get(bool fail = false) { |
| *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}} |
| void testLoopOpaqueCollection() { |
| *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}} |
| *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}} |
| bool operator==(const iterator &); |
| bool operator!=(const iterator &); |
| void testLoopOpaqueIterator() { |
| *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}} |
| *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}} |
| void testLoopErrorInRange() { |
| for (int y : get(true)) { // error inside get() |
| *(volatile int *)0 = 1; // no-warning |
| *(volatile int *)0 = 1; // no-warning |
| void testForRangeInit() { |
| for (int *arr[3] = {nullptr, nullptr, nullptr}; int *p : arr) // expected-warning {{extension}} |
| *p = 1; // expected-warning {{Dereference of null pointer}} |