Closed Gnimuc closed 4 months ago
There are some undocumented behavior changes introduced in Clang16...
typedef struct ImVector_ImDrawCmd {int Size;int Capacity;ImDrawCmd* Data;} ImVector_ImDrawCmd;
typedef struct ImVector_ImDrawIdx {int Size;int Capacity;ImDrawIdx* Data;} ImVector_ImDrawIdx;
struct ImDrawChannel
{
ImVector_ImDrawCmd _CmdBuffer;
ImVector_ImDrawIdx _IdxBuffer;
};
getTypeDeclaration(type) = CLCursor (Clang.CLStructDecl) ImDrawChannel
Clang.CLStructDecl ImDrawChannel
Clang.CLFieldDecl a Clang.CLElaborated ImVector_ImDrawCmd _CmdBuffer
Clang.CLFieldDecl a Clang.CLElaborated ImVector_ImDrawIdx _IdxBuffer
(c, ty, getNamedType(ty)) = (CLCursor (Clang.CLFieldDecl) _CmdBuffer, CLType (Clang.CLElaborated) , CLType (Clang.CLTypedef) )
ERROR: LoadError: AssertionError: jlty isa JuliaCenum || jlty isa JuliaCrecord
Stacktrace:
[1] tojulia(x::Clang.CLElaborated)
@ Clang.Generators ~/.julia/dev/Clang/src/generator/jltypes.jl:151
[2] collect_dependent_system_nodes!(dag::ExprDAG, type::Clang.CLRecord, system_nodes::Dict{ExprNode, Int64})
@ Clang.Generators ~/.julia/dev/Clang/src/generator/system_deps.jl:133
[3] collect_dependent_system_nodes!(dag::ExprDAG, node::ExprNode{Clang.Generators.StructForwardDecl, Clang.CLStructDecl}, system_nodes::Dict{ExprNode, Int64})
@ Clang.Generators ~/.julia/dev/Clang/src/generator/system_deps.jl:124
getTypeDeclaration(type) = CLCursor (Clang.CLStructDecl) ImDrawChannel
Clang.CLStructDecl ImDrawChannel
Clang.CLFieldDecl a Clang.CLTypedef ImVector_ImDrawCmd _CmdBuffer
Clang.CLFieldDecl a Clang.CLTypedef ImVector_ImDrawIdx _IdxBuffer
ERROR: LoadError: MethodError: no method matching getNamedType(::Clang.CLTypedef)
Closest candidates are:
getNamedType(::Clang.CLElaborated)
@ Clang ~/.julia/dev/Clang/src/type.jl:152
getNamedType(::Clang.LibClang.CXType)
@ Clang ~/.julia/dev/Clang/src/type.jl:151
Stacktrace:
[1] macro expansion
@ ./show.jl:1181 [inlined]
[2] collect_dependent_system_nodes!(dag::ExprDAG, type::Clang.CLRecord, system_nodes::Dict{ExprNode, Int64})
@ Clang.Generators ~/.julia/dev/Clang/src/generator/system_deps.jl:132
I dont know why ImVector_ImDrawCmd
needs to be represented as an elaborated
type.
MWE:
typedef int foo;
typedef struct X
{
foo field;
} X;
Also, where is CLElaborated
defined? :thinking: It's used in a couple places but I can't find the definition anywhere.
Oh NVM, I see it's created automatically in cltypes.jl
. Man, this is weird :confused: I might try doing a poor-mans bisect with the available Clang_jll
versions: https://github.com/JuliaRegistries/General/blob/master/jll/C/Clang_jll/Versions.toml
Oh NVM, I see it's created automatically in
cltypes.jl
. Man, this is weird 😕 I might try doing a poor-mans bisect with the availableClang_jll
versions: https://github.com/JuliaRegistries/General/blob/master/jll/C/Clang_jll/Versions.toml
it would be faster to check the source directly. but this is not urgent. one can always run the generator with the old Julia version .
Actually I need it to fix more method ambiguities in 1.11 :sweat_smile: Example failure: https://github.com/JuliaWeb/LibSSH.jl/actions/runs/7698581250/job/20978180881
Similar to #458. But you're right, it's not urgent yet.
fix #464