fail_nested_incomplete.carbon 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. class Incomplete;
  7. // CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:24: ERROR: Variable has incomplete type `(i32, Incomplete)`.
  8. // CHECK:STDERR: var t: (i32, Incomplete);
  9. // CHECK:STDERR: ^
  10. // CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: Class was forward declared here.
  11. // CHECK:STDERR: class Incomplete;
  12. // CHECK:STDERR: ^
  13. var t: (i32, Incomplete);
  14. // CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+3]]:27: ERROR: Cannot implicitly convert from `<error>*` to `Incomplete*`.
  15. // CHECK:STDERR: var p: Incomplete* = &t[1];
  16. // CHECK:STDERR: ^
  17. var p: Incomplete* = &t[1];
  18. // CHECK:STDOUT: file "fail_nested_incomplete.carbon" {
  19. // CHECK:STDOUT: class_declaration @Incomplete, ()
  20. // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete
  21. // CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference "Incomplete", %Incomplete
  22. // CHECK:STDOUT: %.loc15_24.1: type = tuple_type (type, type)
  23. // CHECK:STDOUT: %.loc15_24.2: (type, type) = tuple_literal (i32, %Incomplete.ref.loc15)
  24. // CHECK:STDOUT: %.loc15_24.3: type = tuple_type (i32, Incomplete)
  25. // CHECK:STDOUT: %t: ref <error> = var "t"
  26. // CHECK:STDOUT: %Incomplete.ref.loc20: type = name_reference "Incomplete", %Incomplete
  27. // CHECK:STDOUT: %.loc20_18: type = ptr_type Incomplete
  28. // CHECK:STDOUT: %p: ref Incomplete* = var "p"
  29. // CHECK:STDOUT: %t.ref: ref <error> = name_reference "t", %t
  30. // CHECK:STDOUT: %.loc20_25: i32 = int_literal 1
  31. // CHECK:STDOUT: %.loc20_22.1: type = ptr_type <error>
  32. // CHECK:STDOUT: %.loc20_22.2: <error>* = address_of <error>
  33. // CHECK:STDOUT: assign %p, <error>
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: class @Incomplete;