aboutsummaryrefslogtreecommitdiffstats
path: root/tests/clazy/suppressions.cpp
blob: 7b42d31c8ffabdc985fa2ac309e046103483ff9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QDateTime>

// clazy:excludeall=foreach
// clazy:excludeall=qdatetime-utc comment with junk

void suppress_qstring_allocation()
{   
    // NOLINTNEXTLINE
    QString s = "foo";
    if (s == "foo") {} // clazy:exclude=qstring-allocations
    if (s == "foo") {} // clazy:exclude=qstring-allocations comment with other junk
    if (s == "foo") {}
}

struct BigTrivial
{
    int a, b, c, d, e;
};

void suppress_foreach()
{
    QList<BigTrivial> list;
    foreach (BigTrivial b, list) { }
}

void qdatetimeutc()
{
    QDateTime::currentDateTime().toSecsSinceEpoch();
}