Custom Query (146 matches)
Results (61 - 63 of 146)
Ticket | Owner | Reporter | Resolution | Summary |
---|---|---|---|---|
#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') |
|||
#204 | fixed | Conversion cost ignores type parameters | ||
Description |
The conversionCost function incorrectly produces a cost of zero between parametric types. with declaration forall (dtype DT) struct A; A(int) aint; the invalid cast (A(char)) aint is accepted by the compiler. There is an algorithmic error in conversionCost: struct types are already handled in typesCompatible call, which correctly considers type parameters. However, incompatible structs are passed into ConversionCost? pass again which only consider names and not parameters. |