Inlining temporary destructors in the analyzer

Message: 4
Date: Wed, 30 Jul 2014 17:14:44 +0200
From: Manuel Klimek<>
To: Jordan Rose<>
Cc: clang-dev Developers<>
Subject: [cfe-dev] Inlining temporary destructors in the analyzer
Content-Type: text/plain; charset="utf-8"

Hi Jordan,

I made some progress on inlining temporary destructors. My main problem
currently is that somehow the initializer values in my constructor get lost
if I don't also reference 'this' via some other way.

An examples shows that best. Consider:
struct A {
   A(int* y) : z(y) {}
   ~A() { *z = 23; }
   int *z;
void f() {
   int x = 0;

This leads to a "Dereference of undefined pointer value" warning on *z = 23.

This is a great warning, well done to the authors and designers! Apparently the compiler is detecting this will crash if y == 0. It seems pretty good as is to me. It's an open question how far to go to process questionable coding practices. Example the (void) this; below, would that ever happen in the wild?