repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merged revisions 209304,209307,209332,209338-209339,209343,209346,209351,209354,20936...
[official-gcc.git]
/
gcc-4_9
/
gcc
/
testsuite
/
g++.dg
/
vect
/
pr60836.cc
blob
83bb1837531f280e22ccf38d59b1219c49e00387
1
// { dg-do compile }
2
3
int
a
,
b
;
4
typedef
double
(*
NormFunc
) (
const int
&);
5
int
&
6
max
(
int
&
p1
,
int
&
p2
)
7
{
8
if
(
p1
<
p2
)
9
return
p2
;
10
return
p1
;
11
}
12
13
struct
A
14
{
15
int
operator
() (
int
p1
,
int
p2
)
16
{
17
return
max
(
p1
,
p2
);
18
}
19
};
20
template
<
class
,
class
>
double
21
norm_
(
const int
&)
22
{
23
char
c
,
d
;
24
A e
;
25
for
(;
a
;
a
++)
26
{
27
b
=
e
(
b
,
d
);
28
b
=
e
(
b
,
c
);
29
}
30
}
31
32
void
33
norm
()
34
{
35
static
NormFunc f
=
norm_
<
int
,
A
>;
36
f
=
0
;
37
}
38
39
// { dg-final { cleanup-tree-dump "vect" } }