Skip to content

Commit

Permalink
Try to fix compiler errors
Browse files Browse the repository at this point in the history
  • Loading branch information
raccog committed Nov 3, 2023
1 parent 6a38d27 commit 1dc105b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/isa/instruction.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include <climits>
#include <experimental/type_traits>
#include <memory>
#include <string_view>
#include <type_traits>
#include <vector>

#include <QList>
Expand Down Expand Up @@ -56,17 +56,15 @@ using IsField =
std::declval<LineTokens &>()));

template <typename MaybeBitRange>
constexpr bool VerifyBitRange =
std::experimental::is_detected_v<IsBitRange, MaybeBitRange>;
constexpr bool VerifyBitRange = qxp::is_detected_v<IsBitRange, MaybeBitRange>;
template <typename MaybeField>
constexpr bool VerifyField =
std::experimental::is_detected_v<IsField, MaybeField>;
constexpr bool VerifyField = qxp::is_detected_v<IsField, MaybeField>;

template <template <typename...> class Op, typename...>
struct VerifyValidTypes {};
template <template <typename...> class Op, typename Type, typename... NextTypes>
struct VerifyValidTypes<Op, Type, NextTypes...> {
static_assert(std::experimental::is_detected_v<Op, Type>, "Invalid type");
static_assert(qxp::is_detected_v<Op, Type>, "Invalid type");

constexpr static VerifyValidTypes<Op, NextTypes...> VerifyRest{};
};
Expand Down Expand Up @@ -833,12 +831,12 @@ constexpr inline static void _enableInstructions(InstrVecType &instructions) {

template <typename... Instructions>
constexpr inline static void enableInstructions(InstrVec &instructions) {
(
[&] {
static_assert((InstrVerify<Instructions>::value),
"Could not verify instruction");
}(),
...);
// (
// [&] {
// static_assert((InstrVerify<Instructions>::value),
// "Could not verify instruction");
// }(),
// ...);
// TODO(raccog): Ensure no duplicate instruction definitions (will be
// difficult, since enableInstructions can be called multiple times)
return _enableInstructions<InstrVec, Instructions...>(instructions);
Expand Down
1 change: 1 addition & 0 deletions src/isa/isa_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <iostream>
#include <map>
#include <set>
#include <vector>

#include <QList>
#include <QString>
Expand Down

0 comments on commit 1dc105b

Please sign in to comment.