Open thradams opened 8 months ago
int f(int condition){
int * _Owner p = 0;
try
{
int * _Owner p2 = p;
if (condition) throw;
p = 0;
}
static_debug(p); //shows "null" - it should be "null or moved"
}
some warning are create in flow analysis ..the problem flow analysis work as second pass on AST were tokens are not present. Each flow analysis runs after the end of function. The the pragma token is consumed then it is not executed on second flow analsys walk. to fix this provisionally we need to add a dumny non null token.
int* _Owner get();
void f() {
int* _Owner p = 0;
p = get();
}
void dummy() {}
#pragma cake diagnostic check "-Wmissing-destructor"
the alternative is to use static_state instead of pragma.. but pragma also works on preprocessor. static_state can work in parser and flow analysis.
static_state ("check", "-Wmissing-destructor")