Skip to content

Commit f203d7e

Browse files
committed
fix static_asserts in laplace
1 parent c5b1f40 commit f203d7e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

stan/math/mix/functor/laplace_marginal_density.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ inline void set_zero_adjoint(Output&& output) {
313313
output_i.adj() = 0;
314314
} else {
315315
static_assert(
316-
sizeof(Output*) == 0,
316+
sizeof(std::decay_t<Output>*) == 0,
317317
"INTERNAL ERROR:(laplace_marginal_lpdf) set_zero_adjoints was "
318318
"not able to deduce the actions needed for the given type.");
319319
}
@@ -358,7 +358,7 @@ inline void collect_adjoints(Output& output, Input&& input) {
358358
}
359359
} else {
360360
static_assert(
361-
sizeof(Output*) == 0,
361+
sizeof(std::decay_t<Output>*) == 0,
362362
"INTERNAL ERROR:(laplace_marginal_lpdf) collect_adjoints was not "
363363
"able to deduce the actiopns needed for the given type.");
364364
}
@@ -812,7 +812,7 @@ inline void collect_adjoints(Output&& output, Input&& input) {
812812
output_i += input_i;
813813
} else {
814814
static_assert(
815-
sizeof(Output*) == 0,
815+
sizeof(std::decay_t<Output>*) == 0,
816816
"INTERNAL ERROR:(laplace_marginal_lpdf) collect_adjoints was not "
817817
"able to deduce the actiopns needed for the given type.");
818818
}
@@ -862,7 +862,7 @@ inline void copy_compute_s2(Output&& output, Input&& input) {
862862
}
863863
} else {
864864
static_assert(
865-
sizeof(Output*) == 0,
865+
sizeof(std::decay_t<Output>*) == 0,
866866
"INTERNAL ERROR:(laplace_marginal_lpdf) copy_compute_s2 was not "
867867
"able to deduce the actiopns needed for the given type.");
868868
}

stan/math/prim/fun/promote_scalar.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ inline constexpr auto promote_scalar(UnPromotedTypes&& x) {
4545
} else if constexpr (is_stan_scalar_v<UnPromotedTypes>) {
4646
return PromotionScalars(std::forward<UnPromotedTypes>(x));
4747
} else {
48-
static_assert(sizeof(UnPromotedTypes*) == 0,
48+
static_assert(sizeof(std::decay_t<UnPromotedTypes>*) == 0,
4949
"Missed type in promote_scalar!");
5050
}
5151
}

stan/math/prim/fun/scalar_seq_view.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class scalar_seq_view<C, require_t<std::is_pointer<C>>> {
126126
*/
127127
inline auto operator[](size_t i) const { return c_[i]; }
128128
inline auto size() const noexcept {
129-
static_assert(sizeof(C*) == 0,
129+
static_assert(sizeof(std::decay_t<C>*) == 0,
130130
"Cannot Return Size of scalar_seq_view with pointer type");
131131
}
132132
inline const auto* data() const noexcept { return &c_[0]; }

0 commit comments

Comments
 (0)