Skip to content

Commit

Permalink
Fix bugzilla issue 24153 - Inliner breaks -betterC by requiring TypeI…
Browse files Browse the repository at this point in the history
…nfo (#17049)
  • Loading branch information
bangbangsheshotmedown authored Nov 3, 2024
1 parent 2b89c29 commit c1a753b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compiler/src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -17184,8 +17184,11 @@ void semanticTypeInfo(Scope* sc, Type t)
Scope scx;
scx.eSink = global.errorSink;
scx._module = sd.getModule();
getTypeInfoType(sd.loc, t, &scx);
sd.requestTypeInfo = true;
if (global.params.useTypeInfo)
{
getTypeInfoType(sd.loc, t, &scx);
sd.requestTypeInfo = true;
}
}
else if (!sc.minst)
{
Expand Down
22 changes: 22 additions & 0 deletions compiler/test/compilable/betterCinline.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* REQUIRED_ARGS: -betterC -inline
PERMUTE_ARGS:
*/

struct InvBoneBindInfo
{
}


struct Test(Value)
{
void test()
{
auto t = Value.init;
}
}

extern(C) void main()
{
Test!(InvBoneBindInfo[32]) test;
test.test();
}

0 comments on commit c1a753b

Please sign in to comment.