☰
Debian Codegraph
@
15:15.3.rel1-2
15:15.3.rel1-1
/
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wdiv-by-zero-bogus-2.C
☽
☼
gcc/testsuite/g++.dg/warn/Wdiv-by-zero-bogus-2.C
code
plain
raw
1
// PR c++/57132
2
3
template<unsigned m, unsigned a>
4
struct mod
5
{
6
static unsigned calc(unsigned x) {
7
unsigned res = a * x;
8
if (m)
9
res %= m;
10
return res;
11
}
12
};
13
14
int main()
15
{
16
mod<3,2>::calc(7);
17
mod<0,2>::calc(7);
18
}