Support for class definitions with static member functions. (#3305)

This includes being able to define a class that was previously
forward-declared, and being able to define a member function out-of-line
that was previously declared inside a class.

No support for fields or methods yet, and a class definition doesn't yet
cause the class to be treated as a complete type.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Richard Smith
2023-10-18 19:49:45 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent 3b82ea96db
commit b01dfb3f93
25 changed files with 740 additions and 135 deletions
@@ -20,7 +20,7 @@ var a: [Incomplete; 1];
var p: Incomplete* = &a[0];
// CHECK:STDOUT: file "fail_incomplete_element.carbon" {
// CHECK:STDOUT: %Incomplete: type = class_declaration @Incomplete
// CHECK:STDOUT: %Incomplete: type = class_declaration @Incomplete, ()
// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference "Incomplete", %Incomplete
// CHECK:STDOUT: %.loc15_21: i32 = int_literal 1
// CHECK:STDOUT: %.loc15_22: type = array_type %.loc15_21, Incomplete