mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 04:48:15 +00:00
Switch tests to use the rendered form of diagnostics (#8070)
Historically, we disabled the rendered form in tests outside of `toolchain/diagnostics`. The idea was to keep tests shorter and avoid very long chains of autoupdate before stabilizing due to all the line numbers and other artifacts in the rendered form. This PR adds `--diagnostic-line-numbers=[all|first]` and defaults to `first` in tests. This keeps the rendered form so that we can easily code review that form and the visual cues it does or doesn't provide. But it removes all but the first location's line numbers to provide significantly more stability in tests. By default, tests get the full unicode line-drawing form of diagnostics so we can ensure all of the artifacts there make sense with the specific case being diagnosed, but we do retain some focused ASCII-rendering tests to ensure that fallback remains usable. There are some issues here that will be fixed in subsequent PRs. Notably, we try to keep the frame together in the check lines, and so force some parts to use the first location. This largely works, but fails in some edge cases, causing the entire frame to be located incorrectly. There is a TODO about this that we need to fix, and it only occurs 6 times across the test suite, so it didn't seem worth front-loading a fix for here. Assisted-by: Claude Code
This commit is contained in:
1 parent
0b7059a360
commit
d0badecd2a
888 files changed
+39731
-12799
No files matched your search
+211
-56
@@ -18,36 +18,88 @@
|
||||
|
||||
class ForwardDeclaredClass;
|
||||
|
||||
// CHECK:STDERR: ╷ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./decl_value_param_type.h:[[@LINE+16]]:6
|
||||
// CHECK:STDERR: │ class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ forward declaration of 'ForwardDeclaredClass' [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ auto foo_decl_param1(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: · ━━━━━━━┳━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: argument type 'ForwardDeclaredClass' is incomplete
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ fail_import_decl_value_param_type.carbon
|
||||
// CHECK:STDERR: │ Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: · ───────────┬───────────
|
||||
// CHECK:STDERR: · ╰──┤ in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
auto foo_decl_param1(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: ╷ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./decl_value_param_type.h:[[@LINE+16]]:6
|
||||
// CHECK:STDERR: │ class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ forward declaration of 'ForwardDeclaredClass' [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: · ━━━━━━━┳━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: argument type 'ForwardDeclaredClass' is incomplete
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ fail_import_decl_value_param_type.carbon
|
||||
// CHECK:STDERR: │ Cpp.foo_decl_param2(*p);
|
||||
// CHECK:STDERR: · ───────────┬───────────
|
||||
// CHECK:STDERR: · ╰──┤ in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
|
||||
// --- fail_import_decl_value_param_type.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6-20: error: argument type 'ForwardDeclaredClass' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: forward declaration of 'ForwardDeclaredClass' [CppInteropParseNote]
|
||||
import Cpp library "decl_value_param_type.h";
|
||||
|
||||
fn F(p: Cpp.ForwardDeclaredClass*) {
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:3-25: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+19]]:23
|
||||
// CHECK:STDERR: -> │ Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: · ┳━
|
||||
// CHECK:STDERR: · ┗━━┫ error: forming value of incomplete type
|
||||
// CHECK:STDERR: · ┃ `Cpp.ForwardDeclaredClass`
|
||||
// CHECK:STDERR: · ┃ [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./decl_value_param_type.h
|
||||
// CHECK:STDERR: │ class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ auto foo_decl_param1(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ initializing function parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6-20: error: argument type 'ForwardDeclaredClass' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: forward declaration of 'ForwardDeclaredClass' [CppInteropParseNote]
|
||||
Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3-25: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-3]]:23-24: error: forming value of incomplete type `Cpp.ForwardDeclaredClass` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:23-24: error: forming value of incomplete type `Cpp.ForwardDeclaredClass` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_import_decl_value_param_type.carbon:[[@LINE+19]]:23
|
||||
// CHECK:STDERR: -> │ Cpp.foo_decl_param2(*p);
|
||||
// CHECK:STDERR: · ┳━
|
||||
// CHECK:STDERR: · ┗━━┫ error: forming value of incomplete type
|
||||
// CHECK:STDERR: · ┃ `Cpp.ForwardDeclaredClass`
|
||||
// CHECK:STDERR: · ┃ [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ ╭── included from: fail_import_decl_value_param_type.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./decl_value_param_type.h
|
||||
// CHECK:STDERR: │ class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ initializing function parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_param2(*p);
|
||||
}
|
||||
@@ -84,22 +136,39 @@ class NonCopyableClass {
|
||||
NonCopyableClass(const NonCopyableClass&) = delete;
|
||||
};
|
||||
|
||||
// CHECK:STDERR: ╷ ╭── included from: fail_import_non_copyable_param_type.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./non_copyable_param_type.h:[[@LINE+22]]:6
|
||||
// CHECK:STDERR: │ NonCopyableClass(const NonCopyableClass&) = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ 'NonCopyableClass' has been explicitly marked deleted here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ auto foo_non_copyable_param(NonCopyableClass) -> void;
|
||||
// CHECK:STDERR: · ━━━━━━━━━━━┳━━━━━━━━━━ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ error: call to deleted
|
||||
// CHECK:STDERR: · │ ┃ constructor of
|
||||
// CHECK:STDERR: · │ ┃ 'NonCopyableClass'
|
||||
// CHECK:STDERR: · │ ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: · ╰────┤ passing argument to parameter
|
||||
// CHECK:STDERR: · │ here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ fail_import_non_copyable_param_type.carbon
|
||||
// CHECK:STDERR: │ Cpp.foo_non_copyable_param(c);
|
||||
// CHECK:STDERR: · ──────────────┬──────────────
|
||||
// CHECK:STDERR: · ╰──┤ in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
auto foo_non_copyable_param(NonCopyableClass) -> void;
|
||||
|
||||
// --- fail_import_non_copyable_param_type.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:6-27: error: call to deleted constructor of 'NonCopyableClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:3:3: note: 'NonCopyableClass' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:45: note: passing argument to parameter here [CppInteropParseNote]
|
||||
import Cpp library "non_copyable_param_type.h";
|
||||
|
||||
fn F(c: Cpp.NonCopyableClass) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+2]]:3-31: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_non_copyable_param(c);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
@@ -114,6 +183,75 @@ struct MoveOnlyClass {
|
||||
MoveOnlyClass(MoveOnlyClass&&);
|
||||
};
|
||||
|
||||
// CHECK:STDERR: ╷ ╭── included from: fail_pass_move_only_param_value.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./move_only_param_type.h:[[@LINE+68]]:6
|
||||
// CHECK:STDERR: │ MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ copy constructor is implicitly deleted because 'MoveOnlyClass' has a
|
||||
// CHECK:STDERR: · │ user-declared move constructor
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━━ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━━━━━━┫ error: call to implicitly-deleted
|
||||
// CHECK:STDERR: · │ ┃ copy constructor of
|
||||
// CHECK:STDERR: · │ ┃ 'MoveOnlyClass'
|
||||
// CHECK:STDERR: · │ ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: · ╰────┤ passing argument to parameter here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ fail_pass_move_only_param_value.carbon
|
||||
// CHECK:STDERR: │ Cpp.foo_move_only_param(c);
|
||||
// CHECK:STDERR: · ─────────────┬────────────
|
||||
// CHECK:STDERR: · ╰──┤ in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: ╷ ╭── included from: fail_pass_move_only_param_ref.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./move_only_param_type.h:[[@LINE+45]]:6
|
||||
// CHECK:STDERR: │ MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ copy constructor is implicitly deleted because 'MoveOnlyClass' has a
|
||||
// CHECK:STDERR: · │ user-declared move constructor
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━━ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━━━━━━┫ error: call to implicitly-deleted
|
||||
// CHECK:STDERR: · │ ┃ copy constructor of
|
||||
// CHECK:STDERR: · │ ┃ 'MoveOnlyClass'
|
||||
// CHECK:STDERR: · │ ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: · ╰────┤ passing argument to parameter here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ fail_pass_move_only_param_ref.carbon
|
||||
// CHECK:STDERR: │ Cpp.foo_move_only_param(c);
|
||||
// CHECK:STDERR: · ─────────────┬────────────
|
||||
// CHECK:STDERR: · ╰──┤ in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: ╷ ╭── included from: fail_todo_pass_move_only_param_ref_by_move.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./move_only_param_type.h:[[@LINE+22]]:6
|
||||
// CHECK:STDERR: │ MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ copy constructor is implicitly deleted because 'MoveOnlyClass' has a
|
||||
// CHECK:STDERR: · │ user-declared move constructor
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━━ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━━━━━━┫ error: call to implicitly-deleted
|
||||
// CHECK:STDERR: · │ ┃ copy constructor of
|
||||
// CHECK:STDERR: · │ ┃ 'MoveOnlyClass'
|
||||
// CHECK:STDERR: · │ ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: · ╰────┤ passing argument to parameter here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ fail_todo_pass_move_only_param_ref_by_move.carbon
|
||||
// CHECK:STDERR: │ Cpp.foo_move_only_param(Cpp.move_move_only(ref c));
|
||||
// CHECK:STDERR: · ─────────────────────────┬────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
auto make_move_only() -> MoveOnlyClass;
|
||||
auto move_move_only(MoveOnlyClass&) -> MoveOnlyClass&&;
|
||||
@@ -134,15 +272,9 @@ fn F() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: fail_pass_move_only_param_value.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6-24: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:3:3: note: copy constructor is implicitly deleted because 'MoveOnlyClass' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
import Cpp library "move_only_param_type.h";
|
||||
|
||||
fn F(c: Cpp.MoveOnlyClass) {
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+2]]:3-28: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_move_only_param(c);
|
||||
}
|
||||
|
||||
@@ -150,15 +282,9 @@ fn F(c: Cpp.MoveOnlyClass) {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: fail_pass_move_only_param_ref.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6-24: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:3:3: note: copy constructor is implicitly deleted because 'MoveOnlyClass' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
import Cpp library "move_only_param_type.h";
|
||||
|
||||
fn F(ref c: Cpp.MoveOnlyClass) {
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+2]]:3-28: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_move_only_param(c);
|
||||
}
|
||||
|
||||
@@ -166,15 +292,9 @@ fn F(ref c: Cpp.MoveOnlyClass) {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6-24: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:3:3: note: copy constructor is implicitly deleted because 'MoveOnlyClass' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
import Cpp library "move_only_param_type.h";
|
||||
|
||||
fn F(ref c: Cpp.MoveOnlyClass) {
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+2]]:3-52: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_move_only_param(Cpp.move_move_only(ref c));
|
||||
}
|
||||
|
||||
@@ -359,9 +479,18 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+4]]:3-20: error: member access into incomplete class `Cpp.Incomplete` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_import_incomplete.carbon:[[@LINE+13]]:3
|
||||
// CHECK:STDERR: -> │ Cpp.Incomplete.foo();
|
||||
// CHECK:STDERR: · ━━━━━━━━━┳━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: member access into incomplete class `Cpp.Incomplete`
|
||||
// CHECK:STDERR: · ┃ [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ ╭── included from: fail_import_incomplete.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./incomplete.h
|
||||
// CHECK:STDERR: │ class Incomplete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Cpp.Incomplete.foo();
|
||||
}
|
||||
@@ -418,25 +547,51 @@ fn F(c: Cpp.DefPointerParamClass*) {
|
||||
|
||||
class DeclValueReturnClass;
|
||||
|
||||
// CHECK:STDERR: ╷ ╭── included from: fail_import_decl_value_return_type.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./decl_value_return_type.h:[[@LINE+18]]:6
|
||||
// CHECK:STDERR: │ class DeclValueReturnClass;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ forward declaration of 'DeclValueReturnClass' [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: calling 'foo_decl_value_return' with incomplete return type
|
||||
// CHECK:STDERR: · │ ┃ 'DeclValueReturnClass'
|
||||
// CHECK:STDERR: · │ ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: · ╰────┤ 'foo_decl_value_return' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ fail_import_decl_value_return_type.carbon
|
||||
// CHECK:STDERR: │ Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: · ─────────────┬─────────────
|
||||
// CHECK:STDERR: · ╰──┤ in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
|
||||
// --- fail_import_decl_value_return_type.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6-26: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: note: 'foo_decl_value_return' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: forward declaration of 'DeclValueReturnClass' [CppInteropParseNote]
|
||||
import Cpp library "decl_value_return_type.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+7]]:3-29: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+5]]:3-29: error: function returns incomplete type `Cpp.DeclValueReturnClass` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:33: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_import_decl_value_return_type.carbon:[[@LINE+18]]:3
|
||||
// CHECK:STDERR: -> │ Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: · ━━━━━━━┳━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: function returns incomplete type `Cpp.DeclValueReturnClass`
|
||||
// CHECK:STDERR: · ┃ [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ ╭── included from: fail_import_decl_value_return_type.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./decl_value_return_type.h
|
||||
// CHECK:STDERR: │ class DeclValueReturnClass;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ return type declared here
|
||||
// CHECK:STDERR: · │ [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_value_return();
|
||||
}
|
||||
@@ -575,7 +730,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%c.param: %NonCopyableClass) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo_non_copyable_param.ref: %foo_non_copyable_param.cpp_overload_set.type = name_ref foo_non_copyable_param, imports.%foo_non_copyable_param.cpp_overload_set.value [concrete = constants.%foo_non_copyable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %c.ref: %NonCopyableClass = name_ref c, %c
|
||||
// CHECK:STDOUT: %foo_non_copyable_param.call: init %empty_tuple.type = call imports.%foo_non_copyable_param.decl(%c.ref)
|
||||
|
||||
Reference in new issue
Block a user