2021-01-25 14:32 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002396Frama-CPlug-in > clangpublic2018-08-24 00:25
Assigned Tovirgile 
PlatformOSmanjaroOS Version8/23/3018
Product VersionFrama-C 17-Chlorine 
Target VersionFixed in Version 
Summary0002396: cast error with reference fields
Descriptionclass B {

template <typename T>
class A {
  T &x;
  A(T &y): x(y) {}

int main()
    B b;
    B & y=b;
    A a(y);

I get the following error:
root@27db7a69b96a:/hostshare# frama-c -print refFieldBug.cpp
[kernel] Parsing refFieldBug.cpp (external front-end)
Now output intermediate result
[kernel] refFieldBug.cpp:8: Failure: castTo struct _Z1B -> struct _Z1B *
[kernel] User Error: stopping on file "refFieldBug.cpp" that has errors.
[kernel] Frama-C aborted: invalid user inp

I don't see what could be the problem because the following succeeds:

class A {
  T &x;
  A(T &y): x(y) {}

int main()
    int x=0;
    int & y=x;
    A<int> a(y);
TagsNo tags attached.
Attached Files


There are no notes attached to this issue.

-Issue History
Date Modified Username Field Change
2018-08-24 00:25 abhishek.anand.iitg@gmail.com New Issue
2018-08-24 00:25 abhishek.anand.iitg@gmail.com Status new => assigned
2018-08-24 00:25 abhishek.anand.iitg@gmail.com Assigned To => virgile
+Issue History