Support for converting a function to a C++ function pointer (#7789)

This commit is contained in:
Geoff Romer
2026-09-30 21:13:36 +00:00
committed by GitHub
parent cbdd6cee65
commit c0bd9606de
26 changed files with 1030 additions and 446 deletions
@@ -13,9 +13,9 @@
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_member_of_function.carbon
fn A() {
// CHECK:STDERR: fail_member_of_function.carbon:[[@LINE+4]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue]
// CHECK:STDERR: fail_member_of_function.carbon:[[@LINE+4]]:3: error: type `<type of A>` does not support qualified expressions [QualifiedExprUnsupported]
// CHECK:STDERR: A.y;
// CHECK:STDERR: ^
// CHECK:STDERR: ^~~
// CHECK:STDERR:
A.y;
}
@@ -47,7 +47,6 @@ fn A() {
// CHECK:STDOUT: fn @A() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [concrete = constants.%A]
// CHECK:STDOUT: %y.ref: <error> = name_ref y, <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: