Custom Query (145 matches)
Results (19 - 21 of 145)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#196 | fixed | Forward Declaring Generic Types Crash with Dtypes | ||
Description |
So polymorphic types can lead to an assertion failure if there is a reference to a reference to a forward declared polymorphic type where the type parameter is a dtype. Here is the error message: *CFA assertion error* "baseParam == baseParams.end() && param == params.end()" from program "cfa-cpp" in "GenPoly::genericType GenPoly::makeSubstitutions(const std::__cxx11::list<TypeDecl*>&, const std::__cxx11::list<Expression*>&, std::__cxx11::list<TypeExpr*>&)" at line 268 in file "GenPoly/InstantiateGeneric.cc": Type parameters should match type variables Here are two different ways to reproduce the error, both are pretty minimal: forall(dtype T) struct link; forall(dtype T) struct link { link(T) * next; }; forall(dtype T) struct foo; forall(dtype U) struct bar { foo(U) * data; }; forall(dtype T) struct foo {};
Changing the first |
|||
#198 | fixed | Forward Declaration Leads to Bad Function Pointer Types | ||
Description |
So I have encountered a rather convoluted case where a combination of a circular dependency and a polymorphic function pointer leads to an error in the generated code. It appears that a concrete implementation is not getting forward declared. bug.cfa:12:72: warning: 'struct _conc_object0' declared inside parameter list will not be visible outside of this definition or declaration 12 | void (*object_function)(object(T) *); |
Here is the code to produce the error (the forall(otype T) struct object_vtable; forall(otype U) struct object { object_vtable(U) * virtual_table; }; forall(otype T) struct object_vtable { void (*object_function)(object(T) *); }; void func(object(int) * test) {} object_vtable(int) _object_vtable_instance = { func }; The polymorphic variables currently have to be otypes because of #196. Once that bug is fixed they might be able to be changed to dtypes.
In
In
Also if the star is removed from the function pointer argument (and the same star on
The initialization of bug.cfa:19:82: warning: initialization of 'void (*)(struct _conc_object0 *)' from incompatible pointer type 'void (*)(struct _conc_object0 *)' [-Wincompatible-pointer-types] 19 | object_vtable(int) _object_vtable_instance @= { func }; | bug.cfa:19:82: note: (near initialization for '_X23_object_vtable_instanceS13object_vtable_i__1._X15object_functionFv_PS6object_Y12__T_generic____1') |
|||
#217 | fixed | Typedef Attributes Not Expanded In Functions | ||
Description |
Currently we remove all attributes from typedef uses when they are put into a function type. There appears to be an explicate filter that removes them in the ReplaceTypedef? pass. However some attributes actually need to be copied over - even if some of them must not which is probably why they were removed in the first place. A better solution is just to remove the ones that cannot be copied over. The default probably should be to copy them over as that seems like it will be the solution more often and so far extra attributes have raised much more noticeable errors then missing attributes. So far aligned appears to be the only one that should be removed. |