Skip to content

Commit

Permalink
Fix virtual destructor; should be default.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanaya-mankad committed Jan 22, 2025
1 parent fddff51 commit df744ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lattice/cpp/header_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ class VirtualDestructor(FunctionalHeaderEntry):
_explicit_definition: Optional[str] = None

def __post_init__(self):
self._closure = f" = {self._explicit_definition};" if self._explicit_definition else ";"
self._f_ret = "virtual"
self._f_name = f"~{self._f_name}"
self._f_args = []
super().__post_init__()
self._closure = f" = {self._explicit_definition};" if self._explicit_definition else ";"
self.trace()
2 changes: 1 addition & 1 deletion lattice/cpp/header_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _translate(self,
# TODO: Check naming assumptions and rules for pre-defined base class files
if not base_class_file.exists():
class_entry = Struct(base_level_tag, self._namespace)
dtor = VirtualDestructor("", class_entry, "", base_level_tag, [])
dtor = VirtualDestructor("", class_entry, "", base_level_tag, [], "default")
else:
# Copy contents into tree? Or copy whole file into build?
shutil.copyfile(base_class_file, output_path / f"{hyphen_separated_lowercase_style(base_level_tag)}.h")
Expand Down

0 comments on commit df744ae

Please sign in to comment.