Sign in
gnu
/
gcc
/
d769c5040874bf9546f2524f3f1d2a894165f92a
/
.
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wdiv-by-zero-bogus-2.C
blob: b7556eaac30badc06c2d16e98db16bdbc19976ea [
file
] [
log
] [
blame
]
// PR c++/57132
template
<
unsigned
m
,
unsigned
a
>
struct
mod
{
static
unsigned
calc
(
unsigned
x
)
{
unsigned
res
=
a
*
x
;
if
(
m
)
res
%=
m
;
return
res
;
}
};
int
main
()
{
mod
<
3
,
2
>::
calc
(
7
);
mod
<
0
,
2
>::
calc
(
7
);
}