This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82541] New: Wduplicated-branches triggers in template context
- From: "andreas.pokorny at siemens dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 13 Oct 2017 11:05:07 +0000
- Subject: [Bug c++/82541] New: Wduplicated-branches triggers in template context
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82541
Bug ID: 82541
Summary: Wduplicated-branches triggers in template context
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: andreas.pokorny at siemens dot com
Target Milestone: ---
template<int N>
struct AR
{
char bla[N > 0 ? N : 1];
};
int main() {
AR<1> warning;
}
When built with -Wduplicated-branches this triggers a warning. This is most
visible with fmtlib:
https://github.com/fmtlib/fmt/blob/master/fmt/format.h#L2328
There is currently a workaround in place but the fact that this workaround
(using +1 instead of 1) works seems to be another bug.