Closed
Description
Hi,
The following line triggers the following GCC 7.1 -Wduplicated-branches warning:
Line 2326 in 2a619d9
fmt/include/fmt/format.h: In instantiation of 'struct fmt::internal::ArgArray<1, true>':
fmt/include/fmt/format.h:3467:1: required from 'std::__cxx11::string fmt::format(fmt::CStringRef, const Args& ...) [with Args = {unsigned int, char [5]}; std::__cxx11::string = std::__cxx11::basic_string<char>; fmt::CStringRef = fmt::BasicCStringRef<char>]'
cc1plus: warning: this condition has identical branches [-Wduplicated-branches]
I am pretty sure this is a false positive scenario for this warning (partial evaluation of compile time expression for this warning doesn't seams right), workaround could be:
static constexpr size_t shut_up_gcc = N;
typedef Value Type[N > 0 ? shut_up_gcc : 1];
// or just:
typedef Value Type[N > 0 ? N + 0 : 1];
I will file a gcc issue for this behavior (and also for the fact that I am including fmt as system headers so I should not get any warnings). My head hurts and I am sorry that I even raised this issue.
Metadata
Assignees
Labels
No labels
Activity