Skip to content
Snippets Groups Projects
Commit bbe0a97f authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Fix a bunch of clang warnings (including a dangerous one)

parent 0b39eaaa
No related branches found
No related tags found
1 merge request!145git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
...@@ -54,7 +54,7 @@ struct ASTBuilder::rearrange_pre_unary_op : TAO_PEGTL_NAMESPACE::parse_tree::app ...@@ -54,7 +54,7 @@ struct ASTBuilder::rearrange_pre_unary_op : TAO_PEGTL_NAMESPACE::parse_tree::app
{ {
template <typename... States> template <typename... States>
static void static void
transform(std::unique_ptr<ASTNode>& n, States&&... st) transform(std::unique_ptr<ASTNode>& n, States&&...)
{ {
if (n->children.size() == 1) { if (n->children.size() == 1) {
n = std::move(n->children.back()); n = std::move(n->children.back());
......
...@@ -26,7 +26,8 @@ class FunctionExpressionProcessor final : public INodeProcessor ...@@ -26,7 +26,8 @@ class FunctionExpressionProcessor final : public INodeProcessor
} else if constexpr (std::is_same_v<ExpressionValueType, ZeroType>) { } else if constexpr (std::is_same_v<ExpressionValueType, ZeroType>) {
return ReturnType{ZeroType::zero}; return ReturnType{ZeroType::zero};
} else if constexpr (std::is_convertible_v<ExpressionValueType, ReturnType>) { } else if constexpr (std::is_convertible_v<ExpressionValueType, ReturnType>) {
const ExpressionValueType& v = std::get<ExpressionValueType>(m_function_expression.execute(exec_policy)); auto expression_value = m_function_expression.execute(exec_policy);
const ExpressionValueType& v = std::get<ExpressionValueType>(expression_value);
if constexpr (std::is_same_v<ReturnType, uint64_t> and std::is_same_v<ExpressionValueType, int64_t>) { if constexpr (std::is_same_v<ReturnType, uint64_t> and std::is_same_v<ExpressionValueType, int64_t>) {
if (v < 0) { if (v < 0) {
throw std::domain_error("trying to convert negative value (" + stringify(v) + ")"); throw std::domain_error("trying to convert negative value (" + stringify(v) + ")");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment