File indexing completed on 2024-05-19 16:44:35

0001 #include <QtCore/QString>
0002 #include <QtCore/QList>
0003 #include <QtCore/QDateTime>
0004 
0005 // clazy:excludeall=foreach
0006 // clazy:excludeall=qdatetime-utc comment with junk
0007 
0008 void suppress_qstring_allocation()
0009 {
0010     QString s = "foo"; // clazy:exclude=qstring-allocations
0011     if (s == "foo") {} // clazy:exclude=qstring-allocations
0012     if (s == "foo") {} // clazy:exclude=qstring-allocations comment with other junk
0013     if (s == "foo") {}
0014 }
0015 
0016 struct BigTrivial
0017 {
0018     int a, b, c, d, e;
0019 };
0020 
0021 void suppress_foreach()
0022 {
0023     QList<BigTrivial> list;
0024     foreach (BigTrivial b, list) { }
0025 }
0026 
0027 void qdatetimeutc()
0028 {
0029     QDateTime::currentDateTime().toTime_t();
0030 }