lock3 / cppx

Extensions to Clang for Compiling the Blue & Gold Languages
29 stars 4 forks source link

Late Elaborated Methods are all Inline #85

Closed sdgoodrick closed 3 years ago

sdgoodrick commented 3 years ago

in GoldElaborator.cpp::lateElaborateMethodDef()

  SemaRef.getCxxSema().ActOnFinishInlineFunctionDef(
    cast<clang::FunctionDecl>(Method.D->Cxx));

Assuming any late-elaborated method is inline is an invalid assumption: all inline functions must have a body, and we can have

Typename[T : type] : type = class:
  destructor() = default

The destructor does not have a body.

See also: https://github.com/lock3/cppx/issues/72

sdgoodrick commented 3 years ago

I added a case for functions with no body to bypass the inline function finalization. Waiting for comment from @bbartman before closing

bbartman commented 3 years ago

That seems fine so long as we have a test for it.