side effect of constructor call from global variable initialization ignored
ID0002002: This issue was created automatically from Mantis Issue 2002. Further discussion may take place here.
|ID0002002||Frama-Clang||Plug-in > clang||public||2014-12-01||2015-02-16|
|Product Version||-||Target Version||-||Fixed in Version||-|
The attached program can be verified by "frama-c -wp 177.cpp", although printing x's value after line 11 reveals that the proven assertion there is false.
The reason is that x was set to 42 by the constructor call cls() from the declaration in line 8, but Frama-C doesn't consider the body code of line 5 when determining the value of x in line 11.
On the other hand, it seems that Frama-C is well aware about the declaration in line 8 calling the constructor in line 5: annotating the latter with "requires \false" produces an unproven obligation that vanishes again if line 8 is deleted.