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
PR c++/86728 - C variadic generic lambda.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
expr
/
cast4.C
blob
e9f529b11c6270b86a67b0cf0d647a927db39f07
1
// { dg-do run }
2
// PR c++/22132
3
4
extern "C" void abort ();
5
6
struct foo {
7
int a;
8
int b;
9
};
10
11
class Foobar : public foo {
12
public:
13
Foobar() { a = 1; b = 2; }
14
virtual ~Foobar() {}
15
};
16
17
Foobar obj;
18
const Foobar* objPtr = &obj;
19
foo* f = (foo*)objPtr;
20
21
int main () {
22
if (f->a != 1 || f->b != 2)
23
abort ();
24
}
25