Skip to content

Fix stencil include guard problem (clang17 / c++20)

Clang <= 17 (and, derived from it, OneAPI <= 2024) have a bug where in C++20 mode a #pragma once located directly after an #ifndef is ignored, causing headers to be read multiple times: https://github.com/llvm/llvm-project/issues/73023

Such a situation arises in almost all files of the stencil module; if any of them is included twice while in C++20 mode, compilation fails with multiple-definition errors.

This is fixed by moving the #pragma once before the preprocessor directive.

Edited by Frederik Hennig

Merge request reports