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
/
opt
/
typeinfo1.C
blob
efac4cbd1e3a49a54a327bc755a2f5e6e8a444d8
1
// PR c++/61020
2
// { dg-options "-O2" }
3
// { dg-do run }
4
5
#include <typeinfo>
6
7
struct Base {
8
virtual ~Base() { }
9
};
10
11
struct Derived : public Base {
12
};
13
14
int compare(const Base& base)
15
{
16
return typeid(base) == typeid(typeid(Derived));
17
}
18
19
int main()
20
{
21
Base base;
22
Derived derived;
23
24
if (compare(base)) return 1;
25
if (compare(derived)) return 2;
26
return 0;
27
}