forked from qt-creator/qt-creator
Make share/qtcreator/cplusplus/examples compilable
Builds now, but does not link (which is fine). And unrelated, unintentional warnings were removed. Change-Id: I6ece33933bc20e6e36fb3859de7c2b774b0e67d5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -71,7 +71,7 @@ public:
|
||||
// misc-noexcept-move-constructor
|
||||
// misc-unconventional-assign-operator
|
||||
// misc-unused-parameters
|
||||
Base operator=(Base &¶m) {}
|
||||
Base operator=(Base &¶m) { return {}; }
|
||||
virtual int function()
|
||||
{
|
||||
// modernize-use-nullptr
|
||||
@@ -116,7 +116,7 @@ void afterMove(Base &&base)
|
||||
Base moved(std::move(base));
|
||||
|
||||
// misc-use-after-move
|
||||
base.value;
|
||||
(void) base.value;
|
||||
}
|
||||
|
||||
// google-runtime-references
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
auto b = {0.5f, 0.5f, 0.5f, 0.5f};
|
||||
|
||||
// misc-fold-init-type
|
||||
std::accumulate(std::begin(b), std::end(b), 0);
|
||||
(void) std::accumulate(std::begin(b), std::end(b), 0);
|
||||
|
||||
// google-readability-casting, misc-incorrect-roundings
|
||||
auto c = (int)(getDouble() + 0.5);
|
||||
@@ -197,6 +197,7 @@ public:
|
||||
std::system("echo ");
|
||||
// cert-err52-cpp
|
||||
setjmp(nullptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// google-default-arguments
|
||||
@@ -251,7 +252,7 @@ int main()
|
||||
// modernize-loop-convert
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
// cppcoreguidelines-pro-bounds-constant-array-index
|
||||
arr[i];
|
||||
(void) arr[i];
|
||||
}
|
||||
|
||||
std::vector<std::pair<int, int>> w;
|
||||
|
Reference in New Issue
Block a user