Skip to content

Commit c66d9de

Browse files
committed
Remove clang analyzer from auto_struct and qtscheduler
1 parent 25750a1 commit c66d9de

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/apps/qutils/qtscheduler.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
using namespace std::chrono;
66

7-
void QtScheduler::schedule(const GUI::Scheduler::Task &task,
7+
void QtScheduler::schedule(
8+
[[maybe_unused]] const GUI::Scheduler::Task &task,
89
steady_clock::time_point time)
910
{
1011
auto actTime = steady_clock::now();
1112
auto duration = time - actTime;
12-
int msecs = 0;
13+
[[maybe_unused]] int msecs = 0;
1314
if (time > actTime)
1415
msecs = duration_cast<milliseconds>(duration).count();
15-
16+
#ifndef __clang_analyzer__
1617
return QTimer::singleShot(msecs, task);
18+
#endif
1719
}

src/base/refl/auto_struct.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,24 +824,28 @@ struct GetterVisitor<Visitor,
824824

825825
template <class T, class Visitor>
826826
constexpr inline __attribute__((always_inline)) auto visit(
827-
Visitor &&visitor)
828-
-> decltype(Functors::Applier<T, Visitor>{}(visitor))
827+
[[maybe_unused]] Visitor &&visitor)
829828
{
829+
#ifndef __clang_analyzer__
830830
return Functors::Applier<T, Visitor>{}(visitor);
831+
#endif
831832
}
832833

833834
template <class Visitor, class T, class... Ts>
834-
constexpr inline auto
835-
visit(Visitor &&visitor, T &visitable, Ts &&...ts)
835+
constexpr inline auto visit([[maybe_unused]] Visitor &&visitor,
836+
[[maybe_unused]] T &visitable,
837+
[[maybe_unused]] Ts &&...ts)
836838
-> std::enable_if_t<(std::is_same_v<std::remove_cvref_t<T>,
837839
std::remove_cvref_t<Ts>>
838840
&& ...)>
839841
{
842+
#ifndef __clang_analyzer__
840843
using TT = std::remove_cvref_t<T>;
841844
visit<TT>(
842845
Functors::GetterVisitor<Visitor, std::tuple<T &, Ts &...>>{
843846
std::forward<Visitor>(visitor),
844847
{visitable, ts...}});
848+
#endif
845849
}
846850

847851
}

0 commit comments

Comments
 (0)