Skip to content
Snippets Groups Projects
Commit a028eb31 authored by Jö Fahlke's avatar Jö Fahlke
Browse files

[!675] Expect `;` after macro

Merge branch 'fix-macro-not-expecting-semicolon' into 'master'

ref:core/dune-common This avoids certain compiler warnings about unneccessary
;. It plays nicer with automatic editor indentation compared to the the
alternative of dropping the ; from every invocation of the macro (see [!673]
for that).

Alternative to: [!673]

WIP:

-   [x] Waiting for feedback from @gruenich

See merge request [!675]

  [!673]: gitlab.dune-project.org/NoneNone/merge_requests/673
  [!675]: gitlab.dune-project.org/core/dune-common/merge_requests/675
parents b6e34ffb 730c5bce
No related branches found
No related tags found
1 merge request!675Expect `;` after macro
Pipeline #18757 failed
......@@ -54,7 +54,8 @@ namespace Dune {
SYMBOL(*this)[i]; \
} \
return *this; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_PREFIX_OP(++);
DUNE_SIMD_LOOP_PREFIX_OP(--);
......@@ -68,7 +69,8 @@ namespace Dune {
out[i] = SYMBOL((*this)[i]); \
} \
return out; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_UNARY_OP(+);
DUNE_SIMD_LOOP_UNARY_OP(-);
......@@ -89,7 +91,8 @@ namespace Dune {
LoopSIMD<T,S> out = *this; \
SYMBOL(*this); \
return out; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_POSTFIX_OP(++);
DUNE_SIMD_LOOP_POSTFIX_OP(--);
......@@ -108,7 +111,8 @@ namespace Dune {
(*this)[i] SYMBOL v[i]; \
} \
return *this; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_ASSIGNMENT_OP(+=);
DUNE_SIMD_LOOP_ASSIGNMENT_OP(-=);
......@@ -149,7 +153,8 @@ namespace Dune {
out[i] = v[i] SYMBOL w[i]; \
} \
return out; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_BINARY_OP(+);
DUNE_SIMD_LOOP_BINARY_OP(-);
......@@ -181,7 +186,8 @@ namespace Dune {
out[i] = v[i] SYMBOL w[i]; \
} \
return out; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_BITSHIFT_OP(<<);
DUNE_SIMD_LOOP_BITSHIFT_OP(>>);
......@@ -215,6 +221,7 @@ namespace Dune {
} \
return out; \
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_COMPARISON_OP(<);
DUNE_SIMD_LOOP_COMPARISON_OP(>);
......@@ -250,7 +257,8 @@ namespace Dune {
out[i] = v[i] SYMBOL w[i]; \
} \
return out; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_BOOLEAN_OP(&&);
DUNE_SIMD_LOOP_BOOLEAN_OP(||);
......@@ -382,7 +390,8 @@ namespace Dune {
out[i] = expr(v[i]); \
} \
return out; \
}
} \
static_assert(true, "expecting ;")
#define DUNE_SIMD_LOOP_CMATH_UNARY_OP_WITH_RETURN(expr, returnType) \
template<class T, std::size_t S, typename Sfinae = \
......@@ -394,7 +403,8 @@ namespace Dune {
out[i] = expr(v[i]); \
} \
return out; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_CMATH_UNARY_OP(cos);
DUNE_SIMD_LOOP_CMATH_UNARY_OP(sin);
......@@ -483,7 +493,8 @@ namespace Dune {
out[i] = expr(v[i]); \
} \
return out; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_STD_UNARY_OP(real);
DUNE_SIMD_LOOP_STD_UNARY_OP(imag);
......@@ -499,7 +510,8 @@ namespace Dune {
out[i] = expr(v[i],w[i]); \
} \
return out; \
}
} \
static_assert(true, "expecting ;")
DUNE_SIMD_LOOP_STD_BINARY_OP(max);
DUNE_SIMD_LOOP_STD_BINARY_OP(min);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment