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
* c-common.c (catenate_strings): New.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
ref9.C
blob
db442628090cc6c6e58a07f2aece61d71e7fe35a
1
// { dg-do run }
2
// Bug: g++ re-evaluates the initializer for r before calling f(); since i has
3
// changed to an invalid index, this breaks.
4
5
class C
6
{
7
public:
8
void f () { }
9
};
10
11
void foo (C * objs[])
12
{
13
int i = 0;
14
C & r = * objs[i]; /* make reference to element */
15
16
i = 666;
17
r.f (); /* core dumps here */
18
}
19
20
int
21
main ()
22
{
23
C * objs[1] = { new C };
24
25
foo (objs);
26
}