[ET Trac] #2818: failing tests with gcc-14

Erik Schnetter trac-noreply at einsteintoolkit.org
Mon Nov 4 10:36:19 CST 2024


#2818: failing tests with gcc-14

 Reporter: Roland Haas
   Status: new
Milestone: 
  Version: 
     Type: bug
 Priority: major
Component: EinsteinToolkit thorn

Comment (by Erik Schnetter):

`vect` objects are created via this mechanism \(see \`vect.hxx1\):

```c++
template <typename T, std::size_t N, typename F>
constexpr ARITH_INLINE ARITH_DEVICE ARITH_HOST std::array<T, N>
construct_array(const F &f) {
  if constexpr (N == 0)
    return std::array<T, N>();
  if constexpr (N > 0)
    return array_push<T>(construct_array<T, N - 1>(f), f(N - 1));
}
```

Maybe the compiler is getting confused by the `constexpr` expressions and accidentally evaluates the second `if` statement? That’s the only `- 1` that I see.

If so, you could try splitting the function into two, with an `enable_if` condition checking `N==0` and `N>0`, and removing the `if constexpr` statements from the bodies.

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2818/failing-tests-with-gcc-14
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20241104/8e77a672/attachment.htm>


More information about the Trac mailing list