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.**
---
| **Id** | **Project** | **Category** | **View** | **Due Date** | **Updated** |
| --- | --- | --- | --- | --- | --- |
| ID0002002 | Frama-Clang | Plug-in > clang | public | 2014-12-01 | 2015-02-16 |
| | | | | | |
| --- | --- | --- | --- | --- | --- |
| **Reporter** | Jochen | **Assigned To** | virgile | **Resolution** | duplicate |
| **Priority** | normal | **Severity** | minor | **Reproducibility** | always |
| **Platform** | frama-c-Neon-20140301+dev-stance | **OS** | - | **OS Version** | xubuntu-cfe13.10 |
| **Product Version** | - | **Target Version** | - | **Fixed in Version** | - |
### Description :
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.
## Attachments
- [177.cpp](/uploads/723d9cb3d39ae9300cad25f31ece596a/177.cpp)
issue