bump product version to 6.3.0.0.beta1
[LibreOffice.git] / compilerplugins / clang / test / loopvartoosmall.cxx
blobbebf88c79610a7f7aef311746378a0bce9ca68be
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * Based on LLVM/Clang.
7 * This file is distributed under the University of Illinois Open Source
8 * License. See LICENSE.TXT for details.
12 #include <cstdint>
14 std::int32_t size() { return 1; }
16 int main() {
17 for (std::int16_t i = 0; i < size(); ++i) {} // expected-error {{[loplugin:loopvartoosmall]}}
18 for (std::int16_t i = 0; i <= size(); ++i) {} // expected-error {{[loplugin:loopvartoosmall]}}
19 for (std::int16_t i = 0; i != size(); ++i) {} // expected-error {{[loplugin:loopvartoosmall]}}
20 std::int16_t j;
21 for (j = 0; j < size(); ++j) {} // expected-error {{[loplugin:loopvartoosmall]}}
22 for (j = 0; j <= size(); ++j) {} // expected-error {{[loplugin:loopvartoosmall]}}
23 for (j = 0; j != size(); ++j) {} // expected-error {{[loplugin:loopvartoosmall]}}
26 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */