llvm-project/compiler-rt/test/tysan/derrived_default_constructor.cpp
gbMattN 067067580f
[TySan] Fix false positives with derived classes (#126260)
Fixes issue #125079 as well as another case I discovered while trying to
build LLVM with TySan.
2025-04-25 10:55:20 +01:00

26 lines
346 B
C++

// RUN: %clangxx_tysan %s -o %t && %run %t 2>&1 | FileCheck --implicit-check-not ERROR %s
#include <stdio.h>
class Inner {
public:
void *ptr = nullptr;
};
class Base {
public:
void *buffer1;
Inner inside;
void *buffer2;
};
class Derrived : public Base {};
Derrived derr;
int main() {
printf("%p", derr.inside.ptr);
return 0;
}