Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/compilerplugins/clang/test/   (LibreOffice Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 11 kB image not shown  

Quellcode-Bibliothek stringview.cxx   Sprache: C

 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */*  java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 48
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to * License, v. 2.0. If a copy of the MPL was java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 70
 * .2.0.  acopy   MPLnot distributedwith java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
 * file  , can  athttp/mozilla.//0.
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

#include <sal/config.h>

 ijava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 18

#include <rtl/#include <sal/typesjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
#include <rtlstring.hxx>
#java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 26
#clude </>
//java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 101

void call_view(std::u16string_view) {}
call_view(::) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
struct 
{//rror@ { with   )oplugins}
      tdjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 45
    ConstructWithViewjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
};

namespace test1
{
    (1)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
{
      warning java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
s;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 s: s1)
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
    // no warning expected
    call_view(s1java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 29
}
void f1(OUString
{
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}(1 );
    (.)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    
    ConstructWithView(void f1(OStringBuffer s1
    
    ConstructWithView(s()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}java.lang.StringIndexOutOfBoundsException: Range [42, 13) out of bounds for length 42
    call_view(s1.copy(1,)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    call_view    call_view().(.)
    /@{rather  copy  witha subView [:}
    ConstructWithView    call_view(std::move()java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
 copy,  a  using ()loplugin:tringview]}
    ConstructWithView(s1.copy(    java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
void (java.lang.StringIndexOutOfBoundsException: Range [25, 22) out of bounds for length 26
{
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}

    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    call_view(java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 101
    java.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101
        // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    void f3(OString}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
call_view1()
d-error@+(1 2)[java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
s.(;
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
{
    // expected-error@+1 {{rather than call toString, pass with a view [loplugin:stringview]}}// expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString', pass a 'std::string_view' [loplugin:stringview]}}
    1.(;
    x=s2.1,)12;
    ConstructWithView(21 ) )
}
 O
{
    call_view(s.(;
   (.java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 46
    call_view((&s)call_view    ((";
    call_viewOString(s1);
    // expected-error@+1 {{rather than call makeStringAndClear on an rvalue, pass with a view [loplugin:stringview]}}
    // expectedjava.lang.StringIndexOutOfBoundsException: Range [24, 21) out of bounds for length 229
// expected-error@+1 {{rather than call makeStringAndClear on an rvalue, pass with a view [loplugin:stringview]}}    java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 43
::move)());
atherthan    rvalue pass a [oplugin:}java.lang.StringIndexOutOfBoundsException: Index 117 out of bounds for length 117
(s.()()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    // expected-error@+1 {{rather than call makeStringAndClear on an rvalue, pass with a view [loplugin:stringview]}}
    (.copy1call_viewOStrings+s3)
 / -re+ {of  '(tl:)}'from 'onstchar{ }4'  'std:java.lang.StringIndexOutOfBoundsException: Range [137, 136) out of bounds for length 161
void makeStringAndClear(OStringBuffer";
{
    call_view(s.makeStringAndClear());
    ConstructWithView(s.makeStringAndClear());
    call_view((&call_viewOUString(2,n2);
ConstructWithView-@ {  an {(:)}OUString  a OUStringConcat{(:? UStrings4 +)
    // expected-error@+1 {{rather than call makeStringAndClear on an rvalue, pass with a view [loplugin:stringview]}}
   std:move()makeStringAndClear());
    / expected-@1{ call makeStringAndClear  an rvalue,pass  a  [loplugin    ( s4)
    ConstructWithView(std::move(s)(;
}
}

java.lang.StringIndexOutOfBoundsException: Range [15, 9) out of bounds for length 15
{
void f3(OUString s1)
{
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
        getToken1  'toInt32)
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    s2 = s1.copy(1) + "xxx";
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    s2 = "xxx" + s1.copy(1);
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    s2 += s1.copy(1);
    (void)s2;
}
void f3(OString s1)
{
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    OString s2 = s1.copy(1, 2) + "xxx";
    (void)s2;
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    OString s3 = s1.copy(1) + "xxx";
    (void)s3;
}
}

namespace test3
{
void f4(OUString s1, OUString s2)
{
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    sal_Unicode x = s2.copy(1, 2)[12];
    (void)x;
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    if (s2.copy(1, 2) < s1)
        ;
}
}

void f5(char const* s1, sal_Int32 n1, char16_t const* s2, sal_Int32 n2, OString s3, OUString s4)
{
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString', pass a 'std::string_view' [loplugin:stringview]}}
    call_view(OString());
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'const char{{ ?}}[4]', pass a 'std::string_view' [loplugin:stringview]}}
    call_view(OString("foo"));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'const char', pass a 'std::string_view' (or an 'rtl::OStringChar') [loplugin:stringview]}}
    call_view(OString(*s1));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'const char *', pass a 'std::string_view' [loplugin:stringview]}}
    call_view(OString(s1));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'const char *', pass a 'std::string_view' [loplugin:stringview]}}
    call_view(OString(s1, n1));
    constexpr OStringLiteral l1("foo");
    call_view(OString(l1));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'std::string_view' (aka 'basic_string_view<char>'), pass a 'std::string_view' [loplugin:stringview]}}
    call_view(OString(std::string_view("foo")));
    // expected-error-re@+1 {{instead of an {{'(rtl::)?}}OString' constructed from a {{'(rtl::)?StringNumber<char, 33>'|'OStringNumber<33>' \(aka 'StringNumber<char, 33ULL?>'\)}}, pass a 'std::string_view' [loplugin:stringview]}}
    call_view(OString(OString::number(0)));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'OStringConcat<{{(rtl::)?}}OString, {{(rtl::)?}}OString>' (aka 'StringConcat<char, rtl::OString, rtl::OString>'), pass a 'std::string_view' via 'rtl::Concat2View' [loplugin:stringview]}}
    call_view(OString(s3 + s3));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString', pass a 'std::u16string_view' [loplugin:stringview]}}
    call_view(OUString());
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'const char{{ ?}}[4]', pass a 'std::u16string_view' [loplugin:stringview]}}
    call_view(OUString("foo"));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'const char16_t{{ ?}}[4]', pass a 'std::u16string_view' [loplugin:stringview]}}
    call_view(OUString(u"foo", 3));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'const char', pass a 'std::u16string_view' (or an 'rtl::OUStringChar') [loplugin:stringview]}}
    call_view(OUString(*s1));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'const char16_t', pass a 'std::u16string_view' (or an 'rtl::OUStringChar') [loplugin:stringview]}}
    call_view(OUString(*s2));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'const char16_t *', pass a 'std::u16string_view' [loplugin:stringview]}}
    call_view(OUString(s2));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'const char16_t *', pass a 'std::u16string_view' [loplugin:stringview]}}
    call_view(OUString(s2, n2));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'const char16_t *', pass a 'std::u16string_view' (or an 'rtl::OUStringChar') [loplugin:stringview]}}
    call_view(OUString(s2, 1));
    constexpr OUStringLiteral l2(u"foo");
    call_view(OUString(l2));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'std::u16string_view' (aka 'basic_string_view<char16_t>'), pass a 'std::u16string_view' [loplugin:stringview]}}
    call_view(OUString(std::u16string_view(u"foo")));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a {{'(rtl::)?StringNumber<char16_t, 33>'|'OUStringNumber<33>' \(aka 'StringNumber<char16_t, 33ULL?>'\)}}, pass a 'std::u16string_view' [loplugin:stringview]}}
    call_view(OUString(OUString::number(0)));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'OUStringConcat<{{(rtl::)?}}OUString, {{(rtl::)?}}OUString>' (aka 'StringConcat<char16_t, rtl::OUString, rtl::OUString>'), pass a 'std::u16string_view' via 'rtl::Concat2View' [loplugin:stringview]}}
    call_view(OUString(s4 + s4));

    (void)(s3 == l1);
    (void)(s4 == l2);
}

void f5(OUString s)
{
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    OUStringBuffer buf(s.copy(5));
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    buf = s.copy(5);
    // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}}
    buf.append(s.copy(12));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'std::u16string_view' (aka 'basic_string_view<char16_t>'), pass a 'std::u16string_view' [loplugin:stringview]}}
    buf.append(OUString(std::u16string_view(u"foo")));
    // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'std::u16string_view' (aka 'basic_string_view<char16_t>'), pass a 'std::u16string_view' [loplugin:stringview]}}
    s += OUString(std::u16string_view(u"foo"));
}

void f6(OUString s)
{
    // expected-error@+1 {{rather than getToken, pass with a view using o3tl::getToken() [loplugin:stringview]}}
    s.getToken(1, ' ').toInt32();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


Messung V0.5 in Prozent
C=91 H=94 G=92

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:  ¤

*Bot Zugriff






Wurzel

Bemerkung:

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Anfrage:

Dauer der Verarbeitung:

Sekunden

sprechenden Kalenders