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
AVR: avr.cc - Drop a superfluous sub-condition in avr_out_compare.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
net2.C
blob
ffb52d2b7f3841e31d813c75ef807ec1459ac196
1
// { dg-do run }
2
// Test of various ?: problems.
3
4
class D
5
{
6
public:
7
void a();
8
void b();
9
D(int i):x(i) {}
10
private:
11
int x;
12
};
13
14
void D::a() {++x;}
15
void D::b() {--x;}
16
17
18
int aa=1, bb=0;
19
20
int fa() {return 0;}
21
int fb() {return 2;}
22
23
int main(int argc, char* argv[])
24
{
25
typedef int* pi;
26
int* p = (argc == 1)? &aa: &bb;
27
*p = 0;
28
29
typedef int (*ifptr)();
30
ifptr fp = (argc == 1)? fa: fb;
31
aa = fp();
32
33
D d(0);
34
typedef void (D::*dmem)();
35
dmem mfp = (argc == 1)? &D::a: &D::b;
36
(d.*mfp)();
37
return 0;
38
}