Suppress clang-tidy warnings in format-inl.h
In non-header-only mode, format.cc includes format-inl.h which defines a number of functions without the `inline` keyword. This triggers a clang-tidy warning (misc-definitions-in-headers) about non-inline functions defined in a header file. This commit adds a directive to stop clang-tidy 14+ from emitting those warnings in format-inl.h.
This commit is contained in:
parent
e2408f37c8
commit
e341175300
@ -28,6 +28,14 @@
|
|||||||
|
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
|
|
||||||
|
// In non-header-only mode, functions in this file are compiled by format.cc
|
||||||
|
// once and exclusively, so we define functions without `inline`;
|
||||||
|
// this triggers a clang-tidy warning (misc-definitions-in-headers).
|
||||||
|
// If the user is using clang-tidy 14+, we can suppress it.
|
||||||
|
#ifndef FMT_HEADER_ONLY
|
||||||
|
// NOLINTBEGIN(misc-definitions-in-headers)
|
||||||
|
#endif
|
||||||
|
|
||||||
FMT_BEGIN_NAMESPACE
|
FMT_BEGIN_NAMESPACE
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
@ -2590,4 +2598,8 @@ FMT_FUNC auto is_printable(uint32_t cp) -> bool {
|
|||||||
|
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
|
||||||
|
#ifndef FMT_HEADER_ONLY
|
||||||
|
// NOLINTEND(misc-definitions-in-headers)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // FMT_FORMAT_INL_H_
|
#endif // FMT_FORMAT_INL_H_
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user