Skip to content

Commit 9cbe40b

Browse files
authored
Merge pull request #299 from vizzuhq/fast_clang_tidy
Remove clang analyzer from auto_struct and qtscheduler
2 parents 97c7391 + 4ac3acc commit 9cbe40b

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
@@ -826,24 +826,28 @@ struct GetterVisitor<Visitor,
826826

827827
template <class T, class Visitor>
828828
constexpr inline __attribute__((always_inline)) auto visit(
829-
Visitor &&visitor)
830-
-> decltype(Functors::Applier<T, Visitor>{}(visitor))
829+
[[maybe_unused]] Visitor &&visitor)
831830
{
831+
#ifndef __clang_analyzer__
832832
return Functors::Applier<T, Visitor>{}(visitor);
833+
#endif
833834
}
834835

835836
template <class Visitor, class T, class... Ts>
836-
constexpr inline auto
837-
visit(Visitor &&visitor, T &visitable, Ts &&...ts)
837+
constexpr inline auto visit([[maybe_unused]] Visitor &&visitor,
838+
[[maybe_unused]] T &visitable,
839+
[[maybe_unused]] Ts &&...ts)
838840
-> std::enable_if_t<(std::is_same_v<std::remove_cvref_t<T>,
839841
std::remove_cvref_t<Ts>>
840842
&& ...)>
841843
{
844+
#ifndef __clang_analyzer__
842845
using TT = std::remove_cvref_t<T>;
843846
visit<TT>(
844847
Functors::GetterVisitor<Visitor, std::tuple<T &, Ts &...>>{
845848
std::forward<Visitor>(visitor),
846849
{visitable, ts...}});
850+
#endif
847851
}
848852

849853
}

0 commit comments

Comments
 (0)