mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
30 lines
471 B
C++
30 lines
471 B
C++
|
|
// This tickled a bug where the destructor call for 'c' in 'f' could be
|
|
// followed by leaving the '~Inner' function, rather than leaving 'f'.
|
|
|
|
class Class2 {
|
|
public:
|
|
Class2();
|
|
~Class2();
|
|
};
|
|
|
|
Class2 getClass2();
|
|
|
|
class Outer {
|
|
public:
|
|
class Inner {
|
|
public:
|
|
Inner(const Class2 &c) { }
|
|
~Inner() { }
|
|
};
|
|
|
|
void f2(int i) {
|
|
Class2 c = getClass2();
|
|
if(i) {
|
|
return;
|
|
}
|
|
Inner inner(c);
|
|
}
|
|
};
|
|
|