Skip to content

Commit 87b8d20

Browse files
committed
[Heavy] Fix base class alias
1 parent 10c1b39 commit 87b8d20

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

heavy/lib/Nbdl/NbdlWriter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,9 @@ class ContextWriter : public NbdlWriter<ContextWriter> {
571571
OS << "class " << ClassName << " : nbdl::context_alias<";
572572
OS << ImplName;
573573
OS << ", /*is_moveable=*/false> {\n"
574-
"using Base = ";
574+
"using Base = nbdl::context_alias<";
575575
OS << ImplName;
576-
OS << ";\n using Base::Base;\n";
576+
OS << ">;\n using Base::Base;\n";
577577
OS << "};\n";
578578
Flush();
579579
}
@@ -619,9 +619,9 @@ class DefineStoreWriter : public NbdlWriter<DefineStoreWriter> {
619619
OS << "class " << Name << " : public nbdl::strong_alias<";
620620
VisitType(V);
621621
OS << "> {\n"
622-
"using Base = ";
622+
"using Base = nbdl::strong_alias<";
623623
VisitType(V);
624-
OS << ";\n using Base::Base;\n";
624+
OS << ">;\n using Base::Base;\n";
625625
OS << "};\n";
626626
}
627627

heavy/test/Nbdl/context.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@
110110
(unless (verify current-nbdl-module)
111111
(error "mlir verification failed"))
112112

113-
(translate-cpp my_context)
114-
115113
; CHECK: class my_store {
116114
; CHECK: ::moo::foo_t foo;
117115
; CHECK-NEXT: ::moo::bar_t bar;
118116
; CHECK-NEXT: ::moo::baz_t baz;
119117
; CHECK: my_store(auto&& arg_0)
120118
; CHECK-NEXT: : foo(42), bar(), baz(arg_0), baz2(static_cast<decltype(arg_0)>(arg_0))
121119
(translate-cpp my_store)
120+
(translate-cpp my_context)
121+
122122
(newline)

0 commit comments

Comments
 (0)