Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to prepare for ubuntu 22.04 CI #6635

Merged
merged 8 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/gui/core/event/dispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ class dispatcher
} else if constexpr(cat == event_category::text_input) {
return signal_text_input_queue_;
} else {
static_assert(utils::dependent_false_v<cat>, "No matching signal queue for category");
// "No matching signal queue for category"
utils::static_assert_false();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a negative change, as it loses the error message…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was either this or remove it entirely, since Clang was rejecting the version that allowed an error message.

Copy link
Member

@Vultraz Vultraz Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a clang bug. You're supposed to be able to use a message. Or did it have a problem with dependent_false_v?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like it could have been solved with decltype(cat).

}
}
};
Expand Down
5 changes: 2 additions & 3 deletions src/utils/general.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ inline constexpr bool decayed_is_same = std::is_same_v<std::decay_t<T1>, std::de

/**
* Workaround for the fact that static_assert(false) is invalid.
* See https://devblogs.microsoft.com/oldnewthing/20200311-00/?p=103553
*/
template<typename>
inline constexpr bool dependent_false_v = false;
template<bool flag = false>
void static_assert_false() { static_assert(flag); }

namespace detail
{
Expand Down