repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
template
/
const1.C
blob
629c4d4a916ea1016572fd4123a2f140d148954a
1
// PR c++/28385
2
// instantiating op() with void()() was making the compiler think that 'fcn'
3
// was const, so it could eliminate the call.
4
5
// { dg-do run }
6
7
extern "C" void abort (void);
8
9
int barcnt = 0;
10
11
class Foo {
12
public:
13
template<typename T>
14
void operator()(const T& fcn) {
15
fcn();
16
}
17
};
18
19
void bar() {
20
barcnt++;
21
}
22
23
int main() {
24
Foo myFoo;
25
myFoo(bar);
26
myFoo(&bar);
27
if (barcnt != 2)
28
abort ();
29
return 0;
30
}