Commit 6116c0a1 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[!7] Improve handling of user defined literal warning in clang

Merge branch 'feature/improve-handling-of-literal-warning-in-clang' into 'master'

ref:staging/dune-logging CMake does not correctly detect whether the compiler
supports disabling a given warning, as no diagnostic is emitted by default for
an unknown disabled warning flag.

So disable the warning directly in the header when clang is detected.

See merge request [!7]

  [!7]: gitlab.dune-project.org/staging/dune-logging/merge_requests/7
parents d27a6487 0a556e54
Pipeline #19473 passed with stage
in 1 minute and 11 seconds
# File for module specific CMake tests. # File for module specific CMake tests.
include(CheckSymbolExists) include(CheckSymbolExists)
include(CheckCXXCompilerFlag)
option(DUNE_VENDOR_FMT_FORCE "Force vendoring of libfmt even if an installed version was found") option(DUNE_VENDOR_FMT_FORCE "Force vendoring of libfmt even if an installed version was found")
...@@ -13,4 +12,3 @@ endif() ...@@ -13,4 +12,3 @@ endif()
check_symbol_exists(localtime_r time.h DUNE_HAVE_LOCALTIME_R) check_symbol_exists(localtime_r time.h DUNE_HAVE_LOCALTIME_R)
check_cxx_compiler_flag(-Wno-gnu-string-literal-operator-template DUNE_HAVE_CXX_FLAG_DISABLE_STRING_LITERAL_OPERATOR_WARNING)
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
#include <dune/logging/checks.hh> #include <dune/logging/checks.hh>
// disable clang warning about the compiler extension used in our user-defined _fmt literal
#ifdef __clang__
#pragma GCC diagnostic ignored "-Wgnu-string-literal-operator-template"
#endif
namespace Dune::Logging { namespace Dune::Logging {
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment