contract of template function specialization taken to refer to next plain function below
ID0002042: This issue was created automatically from Mantis Issue 2042. Further discussion may take place here.
|ID0002042||Frama-Clang||Plug-in > clang||public||2015-01-05||2015-02-15|
|Product Version||-||Target Version||-||Fixed in Version||-|
Using "frama-c -wp 424.cpp" the attached program can be verified, although e.g. foo(0) yields 2 whereas its contract says it should yield 4.
Apparently, Frama-C thinks the contract belongs to the plain function bar(). That would also be an explanation for issue #2034.
Moving the contract from line 4 down to line 6, or to line 8, keeps that behavior. After moving it up to line 1 (i.e. before the generic template), no obligation at all is generated (which is ok since foo<>() isn't called anywhere).