diff --git a/examples/14_json_template.cpp b/examples/14_json_template.cpp index 073c77426d..7a6a0cca48 100644 --- a/examples/14_json_template.cpp +++ b/examples/14_json_template.cpp @@ -3,10 +3,12 @@ int main() { std::string config = R"( -iteration_encoding = "variable_based" - -[json] -mode = "template" +{ + "iteration_encoding": "variable_based", + "json": { + "mode": "template" + } +} )"; openPMD::Series writeTemplate( diff --git a/src/IO/JSON/JSONIOHandlerImpl.cpp b/src/IO/JSON/JSONIOHandlerImpl.cpp index fd96b9b0b5..0634f6e8e2 100644 --- a/src/IO/JSON/JSONIOHandlerImpl.cpp +++ b/src/IO/JSON/JSONIOHandlerImpl.cpp @@ -72,7 +72,20 @@ namespace { return T{}; } +#if defined(__INTEL_COMPILER) +/* + * ICPC has trouble with if constexpr, thinking that return statements are + * missing afterwards. Deactivate the warning. + * Note that putting a statement here will not help to fix this since it will + * then complain about unreachable code. + * https://community.intel.com/t5/Intel-C-Compiler/quot-if-constexpr-quot-and-quot-missing-return-statement-quot-in/td-p/1154551 + */ +#pragma warning(disable : 1011) + } +#pragma warning(default : 1011) +#else } +#endif static constexpr char const *errorMsg = "JSON default value"; };