repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ubsan
/
pr66977.C
blob
3ab8d902f10f5f2c1b0fb1f1ca8d47511f9b707a
1
// PR sanitizer/66977
2
// { dg-do compile }
3
// { dg-options "-fsanitize=shift -Wmaybe-uninitialized -O" }
4
5
class Foo {
6
7
private:
8
9
int a_;
10
11
public:
12
13
Foo (int a) : a_(a) {};
14
15
inline int get_a () { return a_; };
16
};
17
18
int bar (int (Foo::*get)()) {
19
Foo *A = new Foo(1);
20
int result = (A->*get)();
21
delete (A);
22
return result;
23
}
24
25
int main () {
26
return bar (&Foo::get_a);
27
}