mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 22:50:29 +00:00
Render diagnostics through the terminal library (#7683)
Diagnostic rendering was part of the data model: `Loc::FormatLocation` and `Loc::FormatSnippet` wrote plain text to a stream, so no capability, color, or terminal width could reach them. A diagnostic is now one message with labels, contexts, and location information attached, and `Diagnostics::Renderer` draws it into a `Terminal::Buffer`. The design is in `toolchain/docs/diagnostics_rendering.md` (#7668), authoring in `toolchain/docs/diagnostics.md`. Before: ``` example.carbon:6:3: error: 1 argument passed to function expecting 0 arguments Run0(1); ^~~~~~~ example.carbon:3:1: note: calling function declared here fn Run0() {} ^~~~~~~~~~~ ``` After: ``` error: 1 argument passed to function expecting 0 arguments ╭─┤ example.carbon:6:3 ┆ 3 │ fn Run0() {} · ─────┬───── · ╰──┤ calling function declared here ┆ -> 6 │ Run0(1); · ─────── ╰──────────── ``` `--no-diagnostic-snippets` gives a compact form, `example.carbon:6:3-9`. File tests use it; the rendering tests under `toolchain/diagnostics/testdata` ask for snippets. C++ interop diagnostics are data now rather than text Clang drew: `SemIR::ClangSourceLocId` names a `clang::SourceRange`, and a Clang location is marked as the point it names. `StreamConsumer` moves to a `:renderer` target that `:emitter` does not depend on, keeping `common/terminal` out of `consumer.h`. Capabilities come from the file behind the error stream, so tests get plain ASCII. `renderer_fuzzer` draws diagnostics built from fuzzer bytes with every capability combination, since a shape the renderer doesn't expect must never be why the compiler dies while reporting a problem. TODOs mark the follow-ups: line weights and crossing lines, wrapping that keeps a quoted type whole, and ordering diagnostics that share a byte offset. Also: `IncorrectExtension`'s hint moves into its message, since its note had no location of its own, and `strip_noise` in `check_diagnostics.py` blanks multi-line `#define`s instead of deleting them. Assisted-by: Claude Code
This commit is contained in:
1 parent
e1c8c1f855
commit
2c9739799b
1205 files changed
+20291
-24988
No files matched your search
+46
-126
@@ -22,10 +22,8 @@
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_one_error.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_one_error.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./one_error.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "one_error.h";
|
||||
|
||||
@@ -42,15 +40,11 @@ import Cpp library "one_error.h";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_multiple_errors.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_multiple_errors.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors.h:3:2: error: "error2" [CppInteropParseError]
|
||||
// CHECK:STDERR: 3 | #error "error2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multiple_errors.h";
|
||||
|
||||
@@ -67,10 +61,8 @@ import Cpp library "multiple_errors.h";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: import_cpp_file_with_one_warning.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_cpp_file_with_one_warning.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "one_warning.h";
|
||||
//@dump-sem-ir-end
|
||||
@@ -90,20 +82,14 @@ import Cpp library "one_warning.h";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_warnings.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_warnings.h:3:2: warning: "warning2" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 3 | #warning "warning2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_cpp_file_with_multiple_warnings.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_warnings.h:4:2: warning: "warning3" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 4 | #warning "warning3"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multiple_warnings.h";
|
||||
//@dump-sem-ir-end
|
||||
@@ -121,15 +107,11 @@ import Cpp library "multiple_warnings.h";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_one_error_and_one_warning.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_one_error_and_one_warning.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./one_error_and_one_warning.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_one_error_and_one_warning.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_one_error_and_one_warning.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./one_error_and_one_warning.h:3:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 3 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "one_error_and_one_warning.h";
|
||||
|
||||
@@ -149,30 +131,20 @@ import Cpp library "one_error_and_one_warning.h";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+25]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+20]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:3:2: error: "error2" [CppInteropParseError]
|
||||
// CHECK:STDERR: 3 | #error "error2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:4:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 4 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:5:2: warning: "warning2" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 5 | #warning "warning2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:6:2: warning: "warning3" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | #warning "warning3"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multiple_errors_and_multiple_warnings.h";
|
||||
|
||||
@@ -195,26 +167,18 @@ import Cpp library "multiple_errors_and_multiple_warnings.h";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multi_one_warning.h";
|
||||
// CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_multiple_warnings.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_multiple_warnings.h:3:2: warning: "warning2" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 3 | #warning "warning2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_multiple_warnings.h:4:2: warning: "warning3" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 4 | #warning "warning3"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multi_multiple_warnings.h";
|
||||
//@dump-sem-ir-end
|
||||
@@ -240,41 +204,27 @@ import Cpp library "multi_multiple_warnings.h";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_one_error_and_one_warning.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_one_error_and_one_warning.h:3:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 3 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multi_one_error_and_one_warning.h";
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+25]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+20]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:3:2: error: "error2" [CppInteropParseError]
|
||||
// CHECK:STDERR: 3 | #error "error2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:4:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 4 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:5:2: warning: "warning2" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 5 | #warning "warning2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:6:2: warning: "warning3" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | #warning "warning3"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multi_multiple_errors_and_multiple_warnings.h";
|
||||
|
||||
@@ -294,11 +244,9 @@ import Cpp library "multi_multiple_errors_and_multiple_warnings.h";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_indirect_error.carbon:[[@LINE+6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./indirect_error.h:2:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_indirect_error.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: included from: ./indirect_error.h:2:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./indirect_one_error.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "indirect_error.h";
|
||||
|
||||
@@ -319,11 +267,9 @@ import Cpp library "indirect_error.h";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: import_indirect_warning.carbon:[[@LINE+6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./indirect_warning.h:2:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_indirect_warning.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: included from: ./indirect_warning.h:2:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./indirect_one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "indirect_warning.h";
|
||||
//@dump-sem-ir-end
|
||||
@@ -343,14 +289,10 @@ library "[[@TEST_NAME]]";
|
||||
//!Lexer error: whitespace is required after the comment introducer.
|
||||
|
||||
// TODO: Move this warning to be after the lexer error.
|
||||
// CHECK:STDERR: fail_import_cpp_library_lexer_error.carbon:[[@LINE+9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_cpp_library_lexer_error.carbon:[[@LINE+5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./lexer_error_one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_library_lexer_error.carbon:[[@LINE-8]]:3: error: whitespace is required after '//' [NoWhitespaceAfterCommentIntroducer]
|
||||
// CHECK:STDERR: //!Lexer error: whitespace is required after the comment introducer.
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_cpp_library_lexer_error.carbon:[[@LINE-6]]:3: error: whitespace is required after '//' [NoWhitespaceAfterCommentIntroducer]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "lexer_error_one_warning.h";
|
||||
|
||||
@@ -366,18 +308,14 @@ double score = 0.1
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_fix_it_hints.carbon:[[@LINE+6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_fix_it_hints.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./fix_it_hints.h:2:19: error: expected ';' after top level declarator [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | double score = 0.1
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: | ;
|
||||
// CHECK:STDERR: ./fix_it_hints.h:2:19: note: insert `;` here [CppInteropFixItInsertion]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "fix_it_hints.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_fix_it_hints.carbon:[[@LINE+4]]:3: error: member name `foo` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.foo();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_import_fix_it_hints.carbon:[[@LINE+2]]:3-9: error: member name `foo` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo();
|
||||
}
|
||||
@@ -398,14 +336,10 @@ inline void call_foobar() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_with_notes.carbon:[[@LINE+9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./with_notes.h:5:3: error: no matching function for call to 'foobar' [CppInteropParseError]
|
||||
// CHECK:STDERR: 5 | foobar(1, 2);
|
||||
// CHECK:STDERR: | ^~~~~~
|
||||
// CHECK:STDERR: fail_with_notes.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./with_notes.h:2:6: note: candidate function not viable: requires 1 argument, but 2 were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | void foobar(int);
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: included from: fail_with_notes.carbon:[[@LINE+5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./with_notes.h:5:3-8: error: no matching function for call to 'foobar' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./with_notes.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./with_notes.h:2:13-15: note: requires 1 argument, but 2 were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "with_notes.h";
|
||||
|
||||
@@ -434,20 +368,12 @@ FOO
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_use_context_stack.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./direct_include.h:4:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./indirect_include.h:2:13: in expansion of macro defined here [InCppMacroExpansion]
|
||||
// CHECK:STDERR: ./direct_include.h:2:13: in expansion of macro defined here [InCppMacroExpansion]
|
||||
// CHECK:STDERR: ./indirect_include.h:3:20: in expansion of macro defined here [InCppMacroExpansion]
|
||||
// CHECK:STDERR: included from: fail_use_context_stack.carbon:[[@LINE+7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: included from: ./direct_include.h:4:10 [InCppInclude]
|
||||
// CHECK:STDERR: expanded from macro defined at: ./indirect_include.h:2:13 [InCppMacroExpansion]
|
||||
// CHECK:STDERR: expanded from macro defined at: ./direct_include.h:2:13 [InCppMacroExpansion]
|
||||
// CHECK:STDERR: expanded from macro defined at: ./indirect_include.h:3:20 [InCppMacroExpansion]
|
||||
// CHECK:STDERR: ./indirect_include.h:5:1: error: unknown type name 'error' [CppInteropParseError]
|
||||
// CHECK:STDERR: 5 | FOO
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: 2 | #define FOO BAR
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: 2 | #define BAR BAZ
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: 3 | #define BAZ void f(error);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "direct_include.h";
|
||||
|
||||
@@ -459,9 +385,7 @@ import Cpp library "direct_include.h";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_loc_in_inline_simple.carbon:[[@LINE+4]]:9: error: use of undeclared identifier 'banana' [CppInteropParseError]
|
||||
// CHECK:STDERR: 8 | int n = banana;
|
||||
// CHECK:STDERR: | ^~~~~~
|
||||
// CHECK:STDERR: fail_loc_in_inline_simple.carbon:[[@LINE+2]]:9-14: error: use of undeclared identifier 'banana' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
import Cpp inline "int n = banana;";
|
||||
|
||||
@@ -469,12 +393,8 @@ import Cpp inline "int n = banana;";
|
||||
|
||||
import Cpp inline '''c++
|
||||
void f(const int n) {
|
||||
// CHECK:STDERR: fail_loc_in_inline_block.carbon:[[@LINE+7]]:3: error: cannot assign to variable 'n' with const-qualified type 'const int' [CppInteropParseError]
|
||||
// CHECK:STDERR: 11 | ++n;
|
||||
// CHECK:STDERR: | ^ ~
|
||||
// CHECK:STDERR: fail_loc_in_inline_block.carbon:[[@LINE-4]]:18: note: variable 'n' declared const here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | void f(const int n) {
|
||||
// CHECK:STDERR: | ~~~~~~~~~~^
|
||||
// CHECK:STDERR: fail_loc_in_inline_block.carbon:[[@LINE+3]]:3: error: cannot assign to variable 'n' with const-qualified type 'const int' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_loc_in_inline_block.carbon:[[@LINE-2]]:8-18: note: variable 'n' declared const here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
++n;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
|
||||
// EXTRA-ARGS: --target=x86_64-linux-gnu --clang-arg=-std=c++20 --clang-arg=-Wextra-semi
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/fail_import_fix_its.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/fail_import_fix_its.carbon
|
||||
|
||||
// Covers the three shapes a Clang fix-it comes in, each of which becomes a
|
||||
// label saying what to do rather than the inline rendering Clang would draw.
|
||||
//
|
||||
// TODO: Remove the `extra ';'` warning on `<carbon Cpp imports>` that every
|
||||
// file here gets. It comes from the `;` that `InitializeCppDomain` puts in the
|
||||
// main file, not from any code here, and only shows because of `-Wextra-semi`.
|
||||
|
||||
// --- replacement.h
|
||||
|
||||
int variable_name;
|
||||
int other = varable_name;
|
||||
|
||||
// --- fail_import_replacement.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: warning: extra ';' outside of a function is incompatible with C++98 [CppInteropParseWarning]
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: remove this [CppInteropFixItRemoval]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: included from: fail_import_replacement.carbon:[[@LINE+5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./replacement.h:3:13-24: error: use of undeclared identifier 'varable_name'; did you mean 'variable_name'? [CppInteropParseError]
|
||||
// CHECK:STDERR: ./replacement.h:3:13-24: note: replace with `variable_name` [CppInteropFixItReplacement]
|
||||
// CHECK:STDERR: ./replacement.h:2:5: note: 'variable_name' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "replacement.h";
|
||||
|
||||
// --- removal.h
|
||||
|
||||
struct WithExtraSemi {};;
|
||||
|
||||
// --- import_removal.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: warning: extra ';' outside of a function is incompatible with C++98 [CppInteropParseWarning]
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: remove this [CppInteropFixItRemoval]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: included from: import_removal.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./removal.h:2:25: warning: extra ';' outside of a function is incompatible with C++98 [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./removal.h:2:25: note: remove this [CppInteropFixItRemoval]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "removal.h";
|
||||
|
||||
// --- insertion.h
|
||||
|
||||
double missing_semicolon = 0.1
|
||||
|
||||
// --- fail_import_insertion.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: warning: extra ';' outside of a function is incompatible with C++98 [CppInteropParseWarning]
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: remove this [CppInteropFixItRemoval]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: included from: fail_import_insertion.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./insertion.h:2:31: error: expected ';' after top level declarator [CppInteropParseError]
|
||||
// CHECK:STDERR: ./insertion.h:2:31: note: insert `;` here [CppInteropFixItInsertion]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "insertion.h";
|
||||
@@ -16,19 +16,13 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''c++
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:2: error: expected '}' [CppInteropParseError]
|
||||
// CHECK:STDERR: 1 | ;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_unterminated_import_inline.carbon:[[@LINE+4]]:10: note: to match this '{' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | void f() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_unterminated_import_inline.carbon:[[@LINE+2]]:10: note: to match this '{' [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
void f() {
|
||||
''';
|
||||
|
||||
import Cpp inline '''c++
|
||||
// CHECK:STDERR: fail_unterminated_import_inline.carbon:[[@LINE+4]]:1: error: extraneous closing brace ('}') [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_unterminated_import_inline.carbon:[[@LINE+2]]:1: error: extraneous closing brace ('}') [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
}
|
||||
''';
|
||||
@@ -37,13 +31,9 @@ import Cpp inline '''c++
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_library_without_name_and_inline_without_content.carbon:[[@LINE+8]]:20: error: expected a string literal to specify the library name [ExpectedLibraryName]
|
||||
// CHECK:STDERR: import Cpp library inline;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_import_cpp_library_without_name_and_inline_without_content.carbon:[[@LINE+4]]:20-25: error: expected a string literal to specify the library name [ExpectedLibraryName]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_library_without_name_and_inline_without_content.carbon:[[@LINE+4]]:20: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: import Cpp library inline;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_import_cpp_library_without_name_and_inline_without_content.carbon:[[@LINE+2]]:20-25: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library inline;
|
||||
|
||||
@@ -51,13 +41,9 @@ import Cpp library inline;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_library_with_name_and_inline_without_content.carbon:[[@LINE+8]]:28: error: `import` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: import Cpp library "foo.h" inline;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_import_cpp_library_with_name_and_inline_without_content.carbon:[[@LINE+4]]:28-33: error: `import` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_library_with_name_and_inline_without_content.carbon:[[@LINE+4]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: import Cpp library "foo.h" inline;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_cpp_library_with_name_and_inline_without_content.carbon:[[@LINE+2]]:1-34: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "foo.h" inline;
|
||||
|
||||
@@ -65,13 +51,9 @@ import Cpp library "foo.h" inline;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_library_without_name_and_inline_with_content.carbon:[[@LINE+8]]:20: error: expected a string literal to specify the library name [ExpectedLibraryName]
|
||||
// CHECK:STDERR: import Cpp library inline "";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_import_cpp_library_without_name_and_inline_with_content.carbon:[[@LINE+4]]:20-25: error: expected a string literal to specify the library name [ExpectedLibraryName]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_library_without_name_and_inline_with_content.carbon:[[@LINE+4]]:20: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: import Cpp library inline "";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_import_cpp_library_without_name_and_inline_with_content.carbon:[[@LINE+2]]:20-25: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library inline "";
|
||||
|
||||
@@ -79,12 +61,8 @@ import Cpp library inline "";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_library_with_name_and_inline_with_content.carbon:[[@LINE+8]]:28: error: `import` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: import Cpp library "foo.h" inline "";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_import_cpp_library_with_name_and_inline_with_content.carbon:[[@LINE+4]]:28-33: error: `import` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_cpp_library_with_name_and_inline_with_content.carbon:[[@LINE+4]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: import Cpp library "foo.h" inline "";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_cpp_library_with_name_and_inline_with_content.carbon:[[@LINE+2]]:1-37: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "foo.h" inline "";
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_cpp_library_empty.carbon:[[@LINE+4]]:10: error: empty filename [CppInteropParseError]
|
||||
// CHECK:STDERR: 8 | #include ""
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_cpp_library_empty.carbon:[[@LINE+2]]:10: error: empty filename [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "";
|
||||
+5
-11
@@ -20,18 +20,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: Translate the file to a `#include` that includes the named file
|
||||
// properly. `\` escapes aren't processed in regular `#include`s.
|
||||
// CHECK:STDERR: fail_todo_import_cpp_library_file_with_quotes.carbon:[[@LINE+14]]:10: error: '\' file not found [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | #include "\"foo.h\""
|
||||
// CHECK:STDERR: | ^~~
|
||||
// CHECK:STDERR: fail_todo_import_cpp_library_file_with_quotes.carbon:[[@LINE+8]]:10-12: error: '\' file not found [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_cpp_library_file_with_quotes.carbon:[[@LINE+10]]:13: error: invalid suffix on literal; C++11 requires a space between literal and identifier [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | #include "\"foo.h\""
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: | {{}}
|
||||
// CHECK:STDERR: fail_todo_import_cpp_library_file_with_quotes.carbon:[[@LINE+6]]:13: error: invalid suffix on literal; C++11 requires a space between literal and identifier [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_import_cpp_library_file_with_quotes.carbon:[[@LINE+5]]:13: note: insert ` ` here [CppInteropFixItInsertion]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_cpp_library_file_with_quotes.carbon:[[@LINE+5]]:13: warning: extra tokens at end of #include directive [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 20 | #include "\"foo.h\""
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: | //
|
||||
// CHECK:STDERR: fail_todo_import_cpp_library_file_with_quotes.carbon:[[@LINE+3]]:13: warning: extra tokens at end of #include directive [CppInteropParseWarning]
|
||||
// CHECK:STDERR: fail_todo_import_cpp_library_file_with_quotes.carbon:[[@LINE+2]]:13: note: insert `//` here [CppInteropFixItInsertion]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "\"foo.h\"";
|
||||
+1
-3
@@ -18,8 +18,6 @@
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_cpp_file_not_found.carbon:[[@LINE+4]]:10: error: 'not_found.h' file not found [CppInteropParseError]
|
||||
// CHECK:STDERR: 8 | #include "not_found.h"
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_cpp_file_not_found.carbon:[[@LINE+2]]:10-22: error: 'not_found.h' file not found [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "not_found.h";
|
||||
@@ -20,13 +20,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "header.h";
|
||||
|
||||
// CHECK:STDERR: fail_duplicate_cpp_name.carbon:[[@LINE+8]]:11: error: `namespace` introducer should be followed by a name [ExpectedDeclName]
|
||||
// CHECK:STDERR: namespace Cpp;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_duplicate_cpp_name.carbon:[[@LINE+4]]:11-13: error: `namespace` introducer should be followed by a name [ExpectedDeclName]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_duplicate_cpp_name.carbon:[[@LINE+4]]:11: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: namespace Cpp;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_duplicate_cpp_name.carbon:[[@LINE+2]]:11-13: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
namespace Cpp;
|
||||
|
||||
@@ -37,13 +33,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "header.h";
|
||||
|
||||
namespace N;
|
||||
// CHECK:STDERR: fail_cpp_in_inner_namespace.carbon:[[@LINE+8]]:13: error: `.` should be followed by a name [ExpectedDeclNameAfterPeriod]
|
||||
// CHECK:STDERR: namespace N.Cpp;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_cpp_in_inner_namespace.carbon:[[@LINE+4]]:13-15: error: `.` should be followed by a name [ExpectedDeclNameAfterPeriod]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_cpp_in_inner_namespace.carbon:[[@LINE+4]]:13: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: namespace N.Cpp;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_cpp_in_inner_namespace.carbon:[[@LINE+2]]:13-15: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
namespace N.Cpp;
|
||||
|
||||
@@ -63,13 +55,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "header.h";
|
||||
|
||||
// CHECK:STDERR: fail_add_name_to_cpp_namespace.carbon:[[@LINE+8]]:7: error: `class` introducer should be followed by a name [ExpectedDeclName]
|
||||
// CHECK:STDERR: class Cpp.C {};
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_add_name_to_cpp_namespace.carbon:[[@LINE+4]]:7-9: error: `class` introducer should be followed by a name [ExpectedDeclName]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_add_name_to_cpp_namespace.carbon:[[@LINE+4]]:7: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: class Cpp.C {};
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_add_name_to_cpp_namespace.carbon:[[@LINE+2]]:7-9: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
class Cpp.C {};
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/fail_fuzzing.carbon
|
||||
|
||||
// CHECK:STDERR: fail_fuzzing.carbon:[[@LINE+4]]:1: error: `Cpp` import found during fuzzing [CppInteropFuzzing]
|
||||
// CHECK:STDERR: import Cpp library "file.h";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_fuzzing.carbon:[[@LINE+2]]:1-28: error: `Cpp` import found during fuzzing [CppInteropFuzzing]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "file.h";
|
||||
@@ -30,11 +30,9 @@ alias MyStructAlias = Cpp.MyStruct;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_import_struct_api.carbon:[[@LINE+6]]:1: in import [InImport]
|
||||
// CHECK:STDERR: struct_api.carbon:4:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: imported from: fail_todo_import_struct_api.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: included from: struct_api.carbon:4:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct.h:2:8: error: semantics TODO: `indirect import of C++ declaration with no direct Cpp import` [SemanticsTodo]
|
||||
// CHECK:STDERR: struct MyStruct { void Foo(); };
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
import library "struct_api";
|
||||
|
||||
|
||||
@@ -89,13 +89,9 @@ namespace A {
|
||||
fn TryToUseNotLeaked() {
|
||||
// TODO: Clang's diagnostic for using a class whose definition is not
|
||||
// reachable is confusing.
|
||||
// CHECK:STDERR: fail_not_leaked.carbon:[[@LINE+8]]:17: error: binding pattern has incomplete type `X` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: var unused x: Cpp.A.X = 0;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: direct_import.carbon:4:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_not_leaked.carbon:[[@LINE+4]]:17-23: error: binding pattern has incomplete type `X` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: included from: direct_import.carbon:4:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./shared.h:3:10: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct X {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var unused x: Cpp.A.X = 0;
|
||||
}
|
||||
|
||||
+11
-33
@@ -45,12 +45,8 @@ void f() {}
|
||||
''';
|
||||
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:6: error: redefinition of 'f' [CppInteropParseError]
|
||||
// CHECK:STDERR: 18 | void f() {}
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-7]]:6: note: previous definition is here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void f() {}
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+3]]:6: error: redefinition of 'f' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:6: note: previous definition is here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
void f() {}
|
||||
''';
|
||||
@@ -61,17 +57,13 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_diag_location.carbon:[[@LINE+4]]:12: error: use of undeclared identifier 'undeclared' [CppInteropParseError]
|
||||
// CHECK:STDERR: 10 | void f() { undeclared = 0; }
|
||||
// CHECK:STDERR: | ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_diag_location.carbon:[[@LINE+2]]:12-21: error: use of undeclared identifier 'undeclared' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
inline Cpp "void f() { undeclared = 0; }";
|
||||
|
||||
inline Cpp '''
|
||||
void g() {
|
||||
// CHECK:STDERR: fail_diag_location.carbon:[[@LINE+4]]:3: error: use of undeclared identifier 'undeclared' [CppInteropParseError]
|
||||
// CHECK:STDERR: 18 | undeclared = 0;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_diag_location.carbon:[[@LINE+2]]:3-12: error: use of undeclared identifier 'undeclared' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
undeclared = 0;
|
||||
}
|
||||
@@ -81,9 +73,7 @@ void g() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_inline_no_import.carbon:[[@LINE+4]]:8: error: name `Cpp` not found [NameNotFound]
|
||||
// CHECK:STDERR: inline Cpp "";
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_inline_no_import.carbon:[[@LINE+2]]:8-10: error: name `Cpp` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
inline Cpp "";
|
||||
|
||||
@@ -94,33 +84,25 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:3: error: `inline Cpp` declaration not at file scope [InlineDeclNotAtFileScope]
|
||||
// CHECK:STDERR: inline Cpp "";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+2]]:3-16: error: `inline Cpp` declaration not at file scope [InlineDeclNotAtFileScope]
|
||||
// CHECK:STDERR:
|
||||
inline Cpp "";
|
||||
}
|
||||
|
||||
interface I {
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:3: error: `inline Cpp` declaration not at file scope [InlineDeclNotAtFileScope]
|
||||
// CHECK:STDERR: inline Cpp "";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+2]]:3-16: error: `inline Cpp` declaration not at file scope [InlineDeclNotAtFileScope]
|
||||
// CHECK:STDERR:
|
||||
inline Cpp "";
|
||||
}
|
||||
|
||||
constraint N {
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:3: error: `inline Cpp` declaration not at file scope [InlineDeclNotAtFileScope]
|
||||
// CHECK:STDERR: inline Cpp "";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+2]]:3-16: error: `inline Cpp` declaration not at file scope [InlineDeclNotAtFileScope]
|
||||
// CHECK:STDERR:
|
||||
inline Cpp "";
|
||||
}
|
||||
|
||||
impl C as I {
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:3: error: `inline Cpp` declaration not at file scope [InlineDeclNotAtFileScope]
|
||||
// CHECK:STDERR: inline Cpp "";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+2]]:3-16: error: `inline Cpp` declaration not at file scope [InlineDeclNotAtFileScope]
|
||||
// CHECK:STDERR:
|
||||
inline Cpp "";
|
||||
}
|
||||
@@ -129,13 +111,9 @@ impl C as I {
|
||||
|
||||
fn F() {
|
||||
// TODO: Should this be a check error rather than a parse error?
|
||||
// CHECK:STDERR: fail_nested_fn.carbon:[[@LINE+8]]:3: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR: inline Cpp "";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_nested_fn.carbon:[[@LINE+4]]:3-8: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_nested_fn.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: inline Cpp "";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_nested_fn.carbon:[[@LINE+2]]:3-8: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
inline Cpp "";
|
||||
}
|
||||
@@ -17,16 +17,11 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: This diagnostic isn't very good.
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_export_module_in_inline_cpp.carbon:[[@LINE+11]]:8: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | export module Foo;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_export_module_in_inline_cpp.carbon:[[@LINE+6]]:8-18: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_export_module_in_inline_cpp.carbon:[[@LINE+7]]:8: error: module declaration must occur at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | export module Foo;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_export_module_in_inline_cpp.carbon:[[@LINE+4]]:8: error: module declaration must occur at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: add 'module;' to the start of the file to introduce a global module fragment [CppInteropParseNote]
|
||||
// CHECK:STDERR: 1 | ;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: insert `module; ` here [CppInteropFixItInsertion]
|
||||
// CHECK:STDERR:
|
||||
export module Foo;
|
||||
''';
|
||||
@@ -37,20 +32,13 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: This diagnostic isn't very good.
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+15]]:1: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | module Bar;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+8]]:1-11: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+11]]:1: error: module declaration must occur at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | module Bar;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+6]]:1: error: module declaration must occur at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: add 'module;' to the start of the file to introduce a global module fragment [CppInteropParseNote]
|
||||
// CHECK:STDERR: 1 | ;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: insert `module; ` here [CppInteropFixItInsertion]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+4]]:8: error: module name 'Foo' specified on command line does not match name of module [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | module Bar;
|
||||
// CHECK:STDERR: | ^~~
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+2]]:8-10: error: module name 'Foo' specified on command line does not match name of module [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
module Bar;
|
||||
''';
|
||||
@@ -61,32 +49,21 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: This diagnostic isn't very good.
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+8]]:1: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR: 14 | module;
|
||||
// CHECK:STDERR: | ^~~~~~~
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+4]]:1-7: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+4]]:1: error: 'module;' introducing a global module fragment can appear only at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: 14 | module;
|
||||
// CHECK:STDERR: | ^~~~~~~
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+2]]:1-7: error: 'module;' introducing a global module fragment can appear only at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
module;
|
||||
|
||||
int n;
|
||||
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+15]]:1: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR: 33 | module Baz;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+8]]:1-11: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+11]]:1: error: module declaration must occur at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: 33 | module Baz;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+6]]:1: error: module declaration must occur at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: add 'module;' to the start of the file to introduce a global module fragment [CppInteropParseNote]
|
||||
// CHECK:STDERR: 1 | ;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: insert `module; ` here [CppInteropFixItInsertion]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+4]]:8: error: module name 'Foo' specified on command line does not match name of module [CppInteropParseError]
|
||||
// CHECK:STDERR: 33 | module Baz;
|
||||
// CHECK:STDERR: | ^~~
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+2]]:8-10: error: module name 'Foo' specified on command line does not match name of module [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
module Baz;
|
||||
''';
|
||||
@@ -97,9 +74,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: Also test that a valid module import works.
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_import_in_inline_cpp.carbon:[[@LINE+4]]:8: error: 'file_that_does_not_exist.h' file not found [CppInteropParseError]
|
||||
// CHECK:STDERR: 10 | import "file_that_does_not_exist.h";
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_in_inline_cpp.carbon:[[@LINE+2]]:8-35: error: 'file_that_does_not_exist.h' file not found [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
import "file_that_does_not_exist.h";
|
||||
''';
|
||||
@@ -38,9 +38,7 @@ import Cpp;
|
||||
|
||||
fn CallLeakedA() -> i32 {
|
||||
// This should not be found as we have not imported "a.h".
|
||||
// CHECK:STDERR: fail_a_does_not_leak.carbon:[[@LINE+4]]:10: error: member name `GetA` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: return Cpp.GetA();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_a_does_not_leak.carbon:[[@LINE+2]]:10-17: error: member name `GetA` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
return Cpp.GetA();
|
||||
}
|
||||
|
||||
@@ -19,17 +19,13 @@ auto [a, b] = X{};
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_use_structured_binding.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_todo_use_structured_binding.carbon:[[@LINE+2]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./structured_binding.h:3:7: error: semantics TODO: `Unsupported: Declaration type Binding` [SemanticsTodo]
|
||||
// CHECK:STDERR: auto [a, b] = X{};
|
||||
// CHECK:STDERR: ^
|
||||
import Cpp library "structured_binding.h";
|
||||
|
||||
fn F() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_use_structured_binding.carbon:[[@LINE+4]]:10: note: in `Cpp` name lookup for `a` [InCppNameLookup]
|
||||
// CHECK:STDERR: return Cpp.a;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_use_structured_binding.carbon:[[@LINE+2]]:10-14: note: in `Cpp` name lookup for `a` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
return Cpp.a;
|
||||
//@dump-sem-ir-end
|
||||
|
||||
@@ -16,14 +16,10 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''c++
|
||||
// CHECK:STDERR: unused.carbon:[[@LINE+4]]:12: warning: unused variable 'n' [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 9 | static int n = 0;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: unused.carbon:[[@LINE+2]]:12: warning: unused variable 'n' [CppInteropParseWarning]
|
||||
// CHECK:STDERR:
|
||||
static int n = 0;
|
||||
// CHECK:STDERR: unused.carbon:[[@LINE+4]]:13: warning: unused function 'f' [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 14 | static void f() {}
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: unused.carbon:[[@LINE+2]]:13: warning: unused function 'f' [CppInteropParseWarning]
|
||||
// CHECK:STDERR:
|
||||
static void f() {}
|
||||
''';
|
||||
|
||||
+12
-36
@@ -62,12 +62,8 @@ import Cpp;
|
||||
class FinalClass {}
|
||||
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+7]]:12: error: base 'FinalClass' is marked 'final' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | struct A : Carbon::FinalClass {};
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE-6]]:18: note: 'FinalClass' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FinalClass {}
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+3]]:12: error: base 'FinalClass' is marked 'final' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE-4]]:18: note: 'FinalClass' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
struct A : Carbon::FinalClass {};
|
||||
''';
|
||||
@@ -84,21 +80,15 @@ struct VirtualDestructor {
|
||||
};
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractWithVdtor` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: abstract class AbstractWithVdtor {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+2]]:1-34: error: cannot access member of interface `Core.Destroy` in type `AbstractWithVdtor` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
abstract class AbstractWithVdtor {
|
||||
extend base: Cpp.VirtualDestructor;
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+7]]:27: error: variable type 'Carbon::AbstractWithVdtor' is an abstract class [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | Carbon::AbstractWithVdtor x;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_abstract.carbon:[[@LINE-8]]:34: note: unimplemented pure virtual method '~AbstractWithVdtor' in 'AbstractWithVdtor' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 16 | abstract class AbstractWithVdtor {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+3]]:27: error: variable type 'Carbon::AbstractWithVdtor' is an abstract class [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_abstract.carbon:[[@LINE-6]]:34: note: unimplemented pure virtual method '~AbstractWithVdtor' in 'AbstractWithVdtor' [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::AbstractWithVdtor x;
|
||||
''';
|
||||
@@ -110,13 +100,9 @@ import Cpp;
|
||||
|
||||
// TODO: Find a way to export this to C++ as an abstract class, despite not
|
||||
// having a vptr.
|
||||
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor.carbon:[[@LINE+8]]:1: error: semantics TODO: `exporting abstract class with no abstract methods and non-virtual destructor to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR: abstract class AbstractNonvirtualDtor {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor.carbon:[[@LINE+4]]:1-39: error: semantics TODO: `exporting abstract class with no abstract methods and non-virtual destructor to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractNonvirtualDtor` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: abstract class AbstractNonvirtualDtor {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor.carbon:[[@LINE+2]]:1-39: error: cannot access member of interface `Core.Destroy` in type `AbstractNonvirtualDtor` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
abstract class AbstractNonvirtualDtor {}
|
||||
|
||||
@@ -132,9 +118,7 @@ import Cpp;
|
||||
// TODO: We should support generating a base subobject destructor for an
|
||||
// abstract class, even though we refuse to generate a complete object
|
||||
// destructor.
|
||||
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor_but_virtual_fns.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractWithMethodNoVptr` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: abstract class AbstractWithMethodNoVptr {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor_but_virtual_fns.carbon:[[@LINE+2]]:1-41: error: cannot access member of interface `Core.Destroy` in type `AbstractWithMethodNoVptr` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
abstract class AbstractWithMethodNoVptr {
|
||||
abstract fn F(self);
|
||||
@@ -153,21 +137,15 @@ import Cpp;
|
||||
// TODO: We should support generating a base subobject destructor for an
|
||||
// abstract class, even though we refuse to generate a complete object
|
||||
// destructor.
|
||||
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractWithMethod` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: abstract class AbstractWithMethod {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE+2]]:1-35: error: cannot access member of interface `Core.Destroy` in type `AbstractWithMethod` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
abstract class AbstractWithMethod {
|
||||
abstract fn F(self);
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE+7]]:28: error: variable type 'Carbon::AbstractWithMethod' is an abstract class [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::AbstractWithMethod x_abstract;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE-7]]:22: note: unimplemented pure virtual method 'F' in 'AbstractWithMethod' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 13 | abstract fn F(self);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE+3]]:28: error: variable type 'Carbon::AbstractWithMethod' is an abstract class [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE-5]]:22: note: unimplemented pure virtual method 'F' in 'AbstractWithMethod' [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::AbstractWithMethod x_abstract;
|
||||
''';
|
||||
@@ -180,9 +158,7 @@ import Cpp;
|
||||
// TODO: We should support generating a base subobject destructor for an
|
||||
// abstract class, even though we refuse to generate a complete object
|
||||
// destructor.
|
||||
// CHECK:STDERR: fail_todo_abstract_method_overridden_in_cpp.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractToOverride` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: abstract class AbstractToOverride {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_abstract_method_overridden_in_cpp.carbon:[[@LINE+2]]:1-35: error: cannot access member of interface `Core.Destroy` in type `AbstractToOverride` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
abstract class AbstractToOverride {
|
||||
abstract fn F(ref self);
|
||||
|
||||
@@ -59,19 +59,13 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE+4]]:1: error: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class IncompleteConcreteA;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE+2]]:1-26: error: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR:
|
||||
class IncompleteConcreteA;
|
||||
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE+7]]:29: error: variable has incomplete type 'Carbon::IncompleteConcreteA' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Carbon::IncompleteConcreteA incomplete_concrete_a;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE-6]]:26: note: forward declaration of 'Carbon::IncompleteConcreteA' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 9 | class IncompleteConcreteA;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE+3]]:29: error: variable has incomplete type 'Carbon::IncompleteConcreteA' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE-4]]:26: note: forward declaration of 'Carbon::IncompleteConcreteA' [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::IncompleteConcreteA incomplete_concrete_a;
|
||||
''';
|
||||
@@ -81,9 +75,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_todo_monomorphization_failure.carbon:[[@LINE+4]]:1: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: class B(N: i32) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_monomorphization_failure.carbon:[[@LINE+2]]:1-17: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
class B(N: i32) {
|
||||
var a: array(i8, N);
|
||||
@@ -94,13 +86,9 @@ class B(N: i32) {
|
||||
alias T = B(-1);
|
||||
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_todo_monomorphization_failure.carbon:[[@LINE+8]]:1: error: semantics TODO: `interop with unsupported type` [SemanticsTodo]
|
||||
// CHECK:STDERR: Carbon::T t;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_monomorphization_failure.carbon:[[@LINE+4]]:1: error: semantics TODO: `interop with unsupported type` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_monomorphization_failure.carbon:[[@LINE+4]]:9: error: no type named 'T' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 26 | Carbon::T t;
|
||||
// CHECK:STDERR: | ~~~~~~~~^
|
||||
// CHECK:STDERR: fail_todo_monomorphization_failure.carbon:[[@LINE+2]]:9: error: no type named 'T' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::T t;
|
||||
''';
|
||||
+10
-30
@@ -75,14 +75,10 @@ class EmptyClass {}
|
||||
inline Cpp '''
|
||||
void AccessNonexistentField() {
|
||||
Carbon::EmptyClass a;
|
||||
// CHECK:STDERR: fail_nonexistent_field.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::EmptyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 13 | a.x = 12;
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR: fail_nonexistent_field.carbon:[[@LINE+2]]:5: error: no member named 'x' in 'Carbon::EmptyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
a.x = 12;
|
||||
// CHECK:STDERR: fail_nonexistent_field.carbon:[[@LINE+4]]:5: error: no member named 'y' in 'Carbon::EmptyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 18 | a.y = 34;
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR: fail_nonexistent_field.carbon:[[@LINE+2]]:5: error: no member named 'y' in 'Carbon::EmptyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
a.y = 34;
|
||||
}
|
||||
@@ -93,14 +89,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class UnsupportedFieldType {
|
||||
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:7: error: semantics TODO: `failed to map Carbon type to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR: var x: ();
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+2]]:7-11: error: semantics TODO: `failed to map Carbon type to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
var x: ();
|
||||
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:7: error: semantics TODO: `failed to map Carbon type to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR: var y: ();
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+2]]:7-11: error: semantics TODO: `failed to map Carbon type to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
var y: ();
|
||||
}
|
||||
@@ -108,14 +100,10 @@ class UnsupportedFieldType {
|
||||
inline Cpp '''
|
||||
void AccessUnsupportedField() {
|
||||
Carbon::UnsupportedFieldType a;
|
||||
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::UnsupportedFieldType' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | a.x;
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+2]]:5: error: no member named 'x' in 'Carbon::UnsupportedFieldType' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
a.x;
|
||||
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:5: error: no member named 'y' in 'Carbon::UnsupportedFieldType' [CppInteropParseError]
|
||||
// CHECK:STDERR: 29 | a.y;
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+2]]:5: error: no member named 'y' in 'Carbon::UnsupportedFieldType' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
a.y;
|
||||
}
|
||||
@@ -132,9 +120,7 @@ class AdaptedClass {
|
||||
inline Cpp '''
|
||||
void AccessAdaptedField() {
|
||||
Carbon::AdaptedClass a;
|
||||
// CHECK:STDERR: fail_adapter.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::AdaptedClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | a.x = 12;
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR: fail_adapter.carbon:[[@LINE+2]]:5: error: no member named 'x' in 'Carbon::AdaptedClass' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
a.x = 12;
|
||||
}
|
||||
@@ -146,9 +132,7 @@ import Cpp;
|
||||
|
||||
// This should not cause a crash.
|
||||
class InvalidBaseClass {
|
||||
// CHECK:STDERR: fail_invalid.carbon:[[@LINE+4]]:16: error: name `Whoops` not found [NameNotFound]
|
||||
// CHECK:STDERR: extend base: Whoops;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_invalid.carbon:[[@LINE+2]]:16-21: error: name `Whoops` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
extend base: Whoops;
|
||||
}
|
||||
@@ -172,12 +156,8 @@ class ClassWithPrivateField {
|
||||
inline Cpp '''
|
||||
int AccessPrivateField() {
|
||||
auto c = Carbon::ClassWithPrivateField::Make();
|
||||
// CHECK:STDERR: fail_private_field.carbon:[[@LINE+7]]:12: error: 'x' is a private member of 'Carbon::ClassWithPrivateField' [CppInteropParseError]
|
||||
// CHECK:STDERR: 22 | return c.x;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_private_field.carbon:[[@LINE-9]]:16: note: implicitly declared private here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 9 | private var x: i32;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_private_field.carbon:[[@LINE+3]]:12: error: 'x' is a private member of 'Carbon::ClassWithPrivateField' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_private_field.carbon:[[@LINE-7]]:16: note: implicitly declared private here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return c.x;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,7 @@ void FSpecific() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+4]]:1: error: semantics TODO: `failed to map specific type arg to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR: class UnsupportedClass(T: type) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+2]]:1-33: error: semantics TODO: `failed to map specific type arg to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
class UnsupportedClass(T: type) {
|
||||
var t: T;
|
||||
@@ -56,13 +54,9 @@ alias AliasEmptyTuple = UnsupportedClass(());
|
||||
|
||||
inline Cpp '''
|
||||
void FUnsupported() {
|
||||
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+8]]:11: error: semantics TODO: `interop with unsupported type` [SemanticsTodo]
|
||||
// CHECK:STDERR: Carbon::AliasEmptyTuple a;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+4]]:11: error: semantics TODO: `interop with unsupported type` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+4]]:11: error: no type named 'AliasEmptyTuple' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 23 | Carbon::AliasEmptyTuple a;
|
||||
// CHECK:STDERR: | ~~~~~~~~^
|
||||
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+2]]:11: error: no type named 'AliasEmptyTuple' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::AliasEmptyTuple a;
|
||||
a.t = 123;
|
||||
@@ -74,9 +68,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class ClassWithMethod(T: type) {
|
||||
// CHECK:STDERR: fail_todo_generic_class_method_call.carbon:[[@LINE+4]]:3: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn M(unused ref self) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_generic_class_method_call.carbon:[[@LINE+2]]:3-25: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn M(unused ref self) {}
|
||||
}
|
||||
@@ -84,9 +76,7 @@ class ClassWithMethod(T: type) {
|
||||
inline Cpp '''
|
||||
void FMethodCall() {
|
||||
Carbon::ClassWithMethod<int> c;
|
||||
// CHECK:STDERR: fail_todo_generic_class_method_call.carbon:[[@LINE+4]]:5: error: no member named 'M' in 'Carbon::ClassWithMethod<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | c.M();
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR: fail_todo_generic_class_method_call.carbon:[[@LINE+2]]:5: error: no member named 'M' in 'Carbon::ClassWithMethod<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
c.M();
|
||||
}
|
||||
|
||||
@@ -92,12 +92,8 @@ class RefMethodRValueClass {
|
||||
|
||||
inline Cpp '''
|
||||
void RefMethodRValue() {
|
||||
// CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE+7]]:3: error: 'this' argument to member function 'M' is an rvalue, but function has non-const lvalue ref-qualifier [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Carbon::RefMethodRValueClass().M();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE-8]]:17: note: 'M' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | fn M(ref self);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE+3]]:3: error: 'this' argument to member function 'M' is an rvalue, but function has non-const lvalue ref-qualifier [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE-6]]:17: note: 'M' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::RefMethodRValueClass().M();
|
||||
}
|
||||
@@ -113,12 +109,8 @@ class RefMethodConstLValueClass {
|
||||
|
||||
inline Cpp '''
|
||||
void RefMethodConstLValue(const Carbon::RefMethodConstLValueClass& c) {
|
||||
// CHECK:STDERR: fail_ref_method_const_lvalue.carbon:[[@LINE+7]]:3: error: 'this' argument to member function 'M' has type 'const Carbon::RefMethodConstLValueClass', but function is not marked const [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | c.M();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ref_method_const_lvalue.carbon:[[@LINE-8]]:17: note: 'M' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | fn M(ref self);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ref_method_const_lvalue.carbon:[[@LINE+3]]:3: error: 'this' argument to member function 'M' has type 'const Carbon::RefMethodConstLValueClass', but function is not marked const [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_ref_method_const_lvalue.carbon:[[@LINE-6]]:17: note: 'M' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
c.M();
|
||||
}
|
||||
|
||||
@@ -70,9 +70,7 @@ struct VBase {
|
||||
};
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+4]]:1: error: semantics TODO: `generic class deriving from C++ virtual class` [SemanticsTodo]
|
||||
// CHECK:STDERR: class GenericZ(T: type) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+2]]:1-25: error: semantics TODO: `generic class deriving from C++ virtual class` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
class GenericZ(T: type) {
|
||||
extend base: Cpp.VBase;
|
||||
|
||||
@@ -34,12 +34,8 @@ class PrivateClass {
|
||||
|
||||
inline Cpp '''
|
||||
int PrivateStatic() {
|
||||
// CHECK:STDERR: fail_static_private.carbon:[[@LINE+7]]:32: error: 'x' is a private member of 'Carbon::PrivateClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | return Carbon::PrivateClass::x;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_static_private.carbon:[[@LINE-8]]:23: note: implicitly declared private here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | private static var x: i32 = 123;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_static_private.carbon:[[@LINE+3]]:32: error: 'x' is a private member of 'Carbon::PrivateClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_static_private.carbon:[[@LINE-6]]:23: note: implicitly declared private here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return Carbon::PrivateClass::x;
|
||||
}
|
||||
|
||||
@@ -57,9 +57,7 @@ import Cpp library "abstract.h";
|
||||
|
||||
class C {
|
||||
extend base: Cpp.A;
|
||||
// CHECK:STDERR: fail_impl_mismatch_member.carbon:[[@LINE+4]]:3: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: override fn invalid(unused ref self) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_impl_mismatch_member.carbon:[[@LINE+2]]:3-40: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR:
|
||||
override fn invalid(unused ref self) {}
|
||||
}
|
||||
@@ -78,9 +76,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "abstract_final.h";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_derive_from_abstract_final.carbon:[[@LINE+4]]:16: error: deriving from final type `AbstractFinal`; base type must be an `abstract` or `base` class [BaseIsFinal]
|
||||
// CHECK:STDERR: extend base: Cpp.AbstractFinal;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_derive_from_abstract_final.carbon:[[@LINE+2]]:16-32: error: deriving from final type `AbstractFinal`; base type must be an `abstract` or `base` class [BaseIsFinal]
|
||||
// CHECK:STDERR:
|
||||
extend base: Cpp.AbstractFinal;
|
||||
}
|
||||
|
||||
+224
-659
File diff suppressed because it is too large.
Load diff
+40
-120
@@ -156,111 +156,71 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "multiple_inheritance.h";
|
||||
|
||||
fn ConvertA(p: Cpp.C*) -> Cpp.A* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `C*` to `Cpp.A*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.C*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `C*` to `Cpp.A*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.C*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertB(p: Cpp.C*) -> Cpp.B* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `C*` to `Cpp.B*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.C*` does not implement interface `Core.ImplicitAs(Cpp.B*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `C*` to `Cpp.B*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.C*` does not implement interface `Core.ImplicitAs(Cpp.B*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertOneNonEmptyBaseToEmpty1(p: Cpp.OneNonEmptyBase*) -> Cpp.Empty1* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `OneNonEmptyBase*` to `Cpp.Empty1*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.OneNonEmptyBase*` does not implement interface `Core.ImplicitAs(Cpp.Empty1*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `OneNonEmptyBase*` to `Cpp.Empty1*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.OneNonEmptyBase*` does not implement interface `Core.ImplicitAs(Cpp.Empty1*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertOneNonEmptyBaseToEmpty2(p: Cpp.OneNonEmptyBase*) -> Cpp.Empty2* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `OneNonEmptyBase*` to `Cpp.Empty2*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.OneNonEmptyBase*` does not implement interface `Core.ImplicitAs(Cpp.Empty2*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `OneNonEmptyBase*` to `Cpp.Empty2*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.OneNonEmptyBase*` does not implement interface `Core.ImplicitAs(Cpp.Empty2*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertTwoNonEmptyBasesToA(p: Cpp.TwoNonEmptyBases*) -> Cpp.A* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `TwoNonEmptyBases*` to `Cpp.A*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.TwoNonEmptyBases*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `TwoNonEmptyBases*` to `Cpp.A*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.TwoNonEmptyBases*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertTwoNonEmptyBasesToB(p: Cpp.TwoNonEmptyBases*) -> Cpp.B* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `TwoNonEmptyBases*` to `Cpp.B*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.TwoNonEmptyBases*` does not implement interface `Core.ImplicitAs(Cpp.B*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `TwoNonEmptyBases*` to `Cpp.B*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.TwoNonEmptyBases*` does not implement interface `Core.ImplicitAs(Cpp.B*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertOnePolymorphicBaseToA(p: Cpp.OnePolymorphicBase*) -> Cpp.A* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `OnePolymorphicBase*` to `Cpp.A*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.OnePolymorphicBase*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `OnePolymorphicBase*` to `Cpp.A*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.OnePolymorphicBase*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertOnePolymorphicBaseToB(p: Cpp.OnePolymorphicBase*) -> Cpp.B* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `OnePolymorphicBase*` to `Cpp.B*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.OnePolymorphicBase*` does not implement interface `Core.ImplicitAs(Cpp.B*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `OnePolymorphicBase*` to `Cpp.B*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.OnePolymorphicBase*` does not implement interface `Core.ImplicitAs(Cpp.B*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertTwoPolymorphicBasesToPolymorphic1(p: Cpp.TwoPolymorphicBases*) -> Cpp.Polymorphic1* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `TwoPolymorphicBases*` to `Cpp.Polymorphic1*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.TwoPolymorphicBases*` does not implement interface `Core.ImplicitAs(Cpp.Polymorphic1*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `TwoPolymorphicBases*` to `Cpp.Polymorphic1*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.TwoPolymorphicBases*` does not implement interface `Core.ImplicitAs(Cpp.Polymorphic1*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertTwoPolymorphicBasesToPolymorphic2(p: Cpp.TwoPolymorphicBases*) -> Cpp.Polymorphic2* {
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `TwoPolymorphicBases*` to `Cpp.Polymorphic2*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.TwoPolymorphicBases*` does not implement interface `Core.ImplicitAs(Cpp.Polymorphic2*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `TwoPolymorphicBases*` to `Cpp.Polymorphic2*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_multiple_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.TwoPolymorphicBases*` does not implement interface `Core.ImplicitAs(Cpp.Polymorphic2*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
@@ -308,12 +268,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "virtual_inheritance.h";
|
||||
|
||||
fn Convert(p: Cpp.VirtB*) -> Cpp.VirtA* {
|
||||
// CHECK:STDERR: fail_todo_use_virtual_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `VirtB*` to `Cpp.VirtA*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_virtual_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.VirtB*` does not implement interface `Core.ImplicitAs(Cpp.VirtA*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_virtual_inheritance.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `VirtB*` to `Cpp.VirtA*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_virtual_inheritance.carbon:[[@LINE+2]]:3-11: note: type `Cpp.VirtB*` does not implement interface `Core.ImplicitAs(Cpp.VirtA*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
@@ -343,89 +299,57 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "diamond.h";
|
||||
|
||||
fn ConvertBA(p: Cpp.DiamondB*) -> Cpp.DiamondA* {
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `DiamondB*` to `Cpp.DiamondA*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.DiamondB*` does not implement interface `Core.ImplicitAs(Cpp.DiamondA*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `DiamondB*` to `Cpp.DiamondA*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+2]]:3-11: note: type `Cpp.DiamondB*` does not implement interface `Core.ImplicitAs(Cpp.DiamondA*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertCA(p: Cpp.DiamondC*) -> Cpp.DiamondA* {
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `DiamondC*` to `Cpp.DiamondA*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.DiamondC*` does not implement interface `Core.ImplicitAs(Cpp.DiamondA*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `DiamondC*` to `Cpp.DiamondA*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+2]]:3-11: note: type `Cpp.DiamondC*` does not implement interface `Core.ImplicitAs(Cpp.DiamondA*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertDB(p: Cpp.DiamondD*) -> Cpp.DiamondB* {
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `DiamondD*` to `Cpp.DiamondB*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.DiamondD*` does not implement interface `Core.ImplicitAs(Cpp.DiamondB*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `DiamondD*` to `Cpp.DiamondB*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+2]]:3-11: note: type `Cpp.DiamondD*` does not implement interface `Core.ImplicitAs(Cpp.DiamondB*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn ConvertDC(p: Cpp.DiamondD*) -> Cpp.DiamondC* {
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `DiamondD*` to `Cpp.DiamondC*` [ConversionFailure]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.DiamondD*` does not implement interface `Core.ImplicitAs(Cpp.DiamondC*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return p;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `DiamondD*` to `Cpp.DiamondC*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+2]]:3-11: note: type `Cpp.DiamondD*` does not implement interface `Core.ImplicitAs(Cpp.DiamondC*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return p;
|
||||
}
|
||||
|
||||
fn AccessBA(d: Cpp.DiamondD) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:11: error: cannot convert expression of type `DiamondD` to `Cpp.DiamondB` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: return (d as Cpp.DiamondB).b;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:11: note: type `Cpp.DiamondD` does not implement interface `Core.As(Cpp.DiamondB)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return (d as Cpp.DiamondB).b;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+3]]:11-27: error: cannot convert expression of type `DiamondD` to `Cpp.DiamondB` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+2]]:11-27: note: type `Cpp.DiamondD` does not implement interface `Core.As(Cpp.DiamondB)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return (d as Cpp.DiamondB).b;
|
||||
}
|
||||
|
||||
fn AccessCA(d: Cpp.DiamondD) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:11: error: cannot convert expression of type `DiamondD` to `Cpp.DiamondC` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: return (d as Cpp.DiamondC).b;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:11: note: type `Cpp.DiamondD` does not implement interface `Core.As(Cpp.DiamondC)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return (d as Cpp.DiamondC).b;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+3]]:11-27: error: cannot convert expression of type `DiamondD` to `Cpp.DiamondC` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+2]]:11-27: note: type `Cpp.DiamondD` does not implement interface `Core.As(Cpp.DiamondC)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return (d as Cpp.DiamondC).b;
|
||||
}
|
||||
|
||||
fn AccessDB(d: Cpp.DiamondD) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:10: error: cannot implicitly convert expression of type `DiamondD` to `Cpp.DiamondB` [ConversionFailure]
|
||||
// CHECK:STDERR: return d.b;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:10: note: type `Cpp.DiamondD` does not implement interface `Core.ImplicitAs(Cpp.DiamondB)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return d.b;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+3]]:10-12: error: cannot implicitly convert expression of type `DiamondD` to `Cpp.DiamondB` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+2]]:10-12: note: type `Cpp.DiamondD` does not implement interface `Core.ImplicitAs(Cpp.DiamondB)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return d.b;
|
||||
}
|
||||
|
||||
fn AccessDC(d: Cpp.DiamondD) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:10: error: cannot implicitly convert expression of type `DiamondD` to `Cpp.DiamondC` [ConversionFailure]
|
||||
// CHECK:STDERR: return d.c;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:10: note: type `Cpp.DiamondD` does not implement interface `Core.ImplicitAs(Cpp.DiamondC)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return d.c;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+3]]:10-12: error: cannot implicitly convert expression of type `DiamondD` to `Cpp.DiamondC` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+2]]:10-12: note: type `Cpp.DiamondD` does not implement interface `Core.ImplicitAs(Cpp.DiamondC)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return d.c;
|
||||
}
|
||||
@@ -441,9 +365,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "final.h";
|
||||
|
||||
class B {
|
||||
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+4]]:16: error: deriving from final type `FinalA`; base type must be an `abstract` or `base` class [BaseIsFinal]
|
||||
// CHECK:STDERR: extend base: Cpp.FinalA;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+2]]:16-25: error: deriving from final type `FinalA`; base type must be an `abstract` or `base` class [BaseIsFinal]
|
||||
// CHECK:STDERR:
|
||||
extend base: Cpp.FinalA;
|
||||
}
|
||||
@@ -459,9 +381,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "union.h";
|
||||
|
||||
class V {
|
||||
// CHECK:STDERR: fail_derive_from_union.carbon:[[@LINE+4]]:16: error: deriving from final type `U`; base type must be an `abstract` or `base` class [BaseIsFinal]
|
||||
// CHECK:STDERR: extend base: Cpp.U;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_derive_from_union.carbon:[[@LINE+2]]:16-20: error: deriving from final type `U`; base type must be an `abstract` or `base` class [BaseIsFinal]
|
||||
// CHECK:STDERR:
|
||||
extend base: Cpp.U;
|
||||
}
|
||||
|
||||
@@ -35,13 +35,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "declaration.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:19: error: binding pattern has incomplete type `DeclBar` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: var unused bar: Cpp.DeclBar;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+4]]:19-29: error: binding pattern has incomplete type `DeclBar` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: included from: fail_use_declaration_as_definition.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./declaration.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class DeclBar;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var unused bar: Cpp.DeclBar;
|
||||
}
|
||||
@@ -235,19 +231,11 @@ class Class1;
|
||||
class Generic(x: Core.Copy) {
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_copy_witness_of_incomplete_class.carbon:[[@LINE+14]]:19: error: argument to C++ call has incomplete type `Cpp.Class1` [IncompleteTypeInCopyWitness]
|
||||
// CHECK:STDERR: fn GenericUse(p2: Generic(Cpp.Class1)) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_copy_witness_of_incomplete_class.carbon:[[@LINE-9]]:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Class1;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_copy_witness_of_incomplete_class.carbon:[[@LINE-9]]:15: note: initializing generic parameter `x` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: class Generic(x: Core.Copy) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_copy_witness_of_incomplete_class.carbon:[[@LINE+6]]:19-37: error: argument to C++ call has incomplete type `Cpp.Class1` [IncompleteTypeInCopyWitness]
|
||||
// CHECK:STDERR: fail_copy_witness_of_incomplete_class.carbon:[[@LINE-7]]:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: fail_copy_witness_of_incomplete_class.carbon:[[@LINE-5]]:15-26: note: initializing generic parameter `x` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_copy_witness_of_incomplete_class.carbon:[[@LINE+4]]:15: warning: binding `p2` unused [UnusedBinding]
|
||||
// CHECK:STDERR: fn GenericUse(p2: Generic(Cpp.Class1)) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_copy_witness_of_incomplete_class.carbon:[[@LINE+2]]:15-37: warning: binding `p2` unused [UnusedBinding]
|
||||
// CHECK:STDERR:
|
||||
fn GenericUse(p2: Generic(Cpp.Class1)) {
|
||||
}
|
||||
|
||||
@@ -80,12 +80,8 @@ fn G(generic T: Core.Default & Core.Destroy) {
|
||||
}
|
||||
|
||||
fn CallG() {
|
||||
// CHECK:STDERR: fail_no_default.carbon:[[@LINE+7]]:3: error: cannot convert type `NoDefault` into type implementing `Core.Default & Core.Destroy` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: G(Cpp.NoDefault);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_no_default.carbon:[[@LINE-8]]:14: note: initializing generic parameter `T` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn G(generic T: Core.Default & Core.Destroy) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_no_default.carbon:[[@LINE+3]]:3-18: error: cannot convert type `NoDefault` into type implementing `Core.Default & Core.Destroy` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_no_default.carbon:[[@LINE-6]]:14-43: note: initializing generic parameter `T` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
G(Cpp.NoDefault);
|
||||
}
|
||||
@@ -212,26 +208,15 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "deleted.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+8]]:54: error: call to deleted function 'DeletedC' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | let unused c: Cpp.DeletedC = Cpp.DeletedC.DeletedC();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+4]]:32-52: error: call to deleted function 'DeletedC' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_deleted.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted.h:4:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | DeletedC() = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
let unused c: Cpp.DeletedC = Cpp.DeletedC.DeletedC();
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+12]]:55: error: call to deleted function 'DeletedD' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | let unused d: Cpp.DeletedD = Cpp.DeletedD.DeletedD(0);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+5]]:32-52: error: call to deleted function 'DeletedD' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_deleted.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted.h:9:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 9 | DeletedD(int) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted.h:10:3: note: candidate constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | DeletedD(short);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
let unused d: Cpp.DeletedD = Cpp.DeletedD.DeletedD(0);
|
||||
}
|
||||
@@ -300,13 +285,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:4: error: member access into incomplete class `Cpp.IncompleteC` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: Cpp.IncompleteC.IncompleteC();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+4]]:4-30: error: member access into incomplete class `Cpp.IncompleteC` [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: class IncompleteC;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.IncompleteC.IncompleteC();
|
||||
}
|
||||
|
||||
@@ -125,31 +125,23 @@ fn G(s: Cpp.BitfieldUnion) -> i32 {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_use_bitfields.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_todo_use_bitfields.carbon:[[@LINE+2]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./with_bitfields.h:4:7: error: semantics TODO: `Unsupported: field declaration has unhandled type or kind` [SemanticsTodo]
|
||||
// CHECK:STDERR: int b : 2;
|
||||
// CHECK:STDERR: ^
|
||||
import Cpp library "with_bitfields.h";
|
||||
|
||||
fn F(s: Cpp.BitfieldStruct) -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_use_bitfields.carbon:[[@LINE+8]]:10: note: in `Cpp` name lookup for `b` [InCppNameLookup]
|
||||
// CHECK:STDERR: return s.b;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_todo_use_bitfields.carbon:[[@LINE+4]]:10-12: note: in `Cpp` name lookup for `b` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_use_bitfields.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_todo_use_bitfields.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./with_bitfields.h:9:7: error: semantics TODO: `Unsupported: field declaration has unhandled type or kind` [SemanticsTodo]
|
||||
// CHECK:STDERR: int d : 3;
|
||||
// CHECK:STDERR: ^
|
||||
return s.b;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
fn G(s: Cpp.BitfieldUnion) -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_use_bitfields.carbon:[[@LINE+4]]:10: note: in `Cpp` name lookup for `d` [InCppNameLookup]
|
||||
// CHECK:STDERR: return s.d;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_todo_use_bitfields.carbon:[[@LINE+2]]:10-12: note: in `Cpp` name lookup for `d` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
return s.d;
|
||||
//@dump-sem-ir-end
|
||||
@@ -183,16 +175,12 @@ fn Test(m: Cpp.UnsupportedMembers*) {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_use_unsupported_members.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_use_unsupported_members.carbon:[[@LINE+2]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./unsupported_members.h:4:16: error: semantics TODO: `Unsupported: field declaration has unhandled type or kind` [SemanticsTodo]
|
||||
// CHECK:STDERR: volatile int is_volatile;
|
||||
// CHECK:STDERR: ^
|
||||
import Cpp library "unsupported_members.h";
|
||||
|
||||
fn Test(m: Cpp.UnsupportedMembers*) {
|
||||
// CHECK:STDERR: fail_use_unsupported_members.carbon:[[@LINE+4]]:23: note: in `Cpp` name lookup for `is_volatile` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused a: i32 = m->is_volatile;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_unsupported_members.carbon:[[@LINE+2]]:23-36: note: in `Cpp` name lookup for `is_volatile` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
let unused a: i32 = m->is_volatile;
|
||||
}
|
||||
|
||||
@@ -16,9 +16,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
struct Base {
|
||||
// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:3: error: unknown type name 'no_such_type' [CppInteropParseError]
|
||||
// CHECK:STDERR: 10 | no_such_type invalid;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+2]]:3: error: unknown type name 'no_such_type' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
no_such_type invalid;
|
||||
};
|
||||
|
||||
+22
-51
@@ -59,44 +59,28 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "object_param_qualifiers.h";
|
||||
|
||||
fn Value(v: Cpp.HasQualifiers) {
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:11: error: no matching function for call to 'plain' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | v.plain();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3-9: error: no matching function for call to 'plain' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:3:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | void plain();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
v.plain();
|
||||
|
||||
// TODO: This should remain invalid once we support `volatile`.
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:19: error: no matching function for call to 'volatile_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: 26 | v.volatile_this();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-17]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'volatile_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:5:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | void volatile_this() volatile;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
v.volatile_this();
|
||||
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:14: error: no matching function for call to 'ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: 36 | v.ref_this();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3-12: error: no matching function for call to 'ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void ref_this() &;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
v.ref_this();
|
||||
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:18: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: 46 | v.ref_ref_this();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-37]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3-16: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-23]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:10:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | void ref_ref_this() &&;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
v.ref_ref_this();
|
||||
}
|
||||
@@ -109,9 +93,7 @@ import Cpp library "object_param_qualifiers.h";
|
||||
|
||||
fn Ref(p: Cpp.HasQualifiers*) {
|
||||
// TODO: This should eventually be accepted if we support `volatile`.
|
||||
// CHECK:STDERR: fail_todo_bad_object_param_qualifiers_by_ref.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: volatile struct HasQualifiers &` [SemanticsTodo]
|
||||
// CHECK:STDERR: p->volatile_this();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_bad_object_param_qualifiers_by_ref.carbon:[[@LINE+2]]:3-20: error: semantics TODO: `Unsupported: parameter type: volatile struct HasQualifiers &` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
p->volatile_this();
|
||||
}
|
||||
@@ -123,23 +105,17 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "object_param_qualifiers.h";
|
||||
|
||||
fn Ref(p: Cpp.HasQualifiers*) {
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+8]]:19: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | p->ref_ref_this();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:10:8: note: candidate function not viable: expects an rvalue for object argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | void ref_ref_this() &&;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:10:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:10:20-21: note: expects an rvalue for object argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
p->ref_ref_this();
|
||||
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+8]]:25: error: no matching function for call to 'const_ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: 25 | p->const_ref_ref_this();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:11:8: note: candidate function not viable: expects an rvalue for object argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 11 | void const_ref_ref_this() const&&;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+5]]:3-23: error: no matching function for call to 'const_ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:11:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:11:26-27: note: expects an rvalue for object argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
p->const_ref_ref_this();
|
||||
}
|
||||
@@ -153,13 +129,10 @@ import Cpp library "object_param_qualifiers.h";
|
||||
fn Make() -> Cpp.HasQualifiers;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE+8]]:19: error: no matching function for call to 'ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Make().ref_this();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable: expects an lvalue for object argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void ref_this() &;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:7:16-17: note: expects an lvalue for object argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Make().ref_this();
|
||||
}
|
||||
@@ -234,9 +207,7 @@ struct ExplicitObjectParamUnsupported {
|
||||
''';
|
||||
|
||||
fn Call(e: Cpp.ExplicitObjectParamUnsupported) {
|
||||
// CHECK:STDERR: fail_call_explicit_object_param_with_unsupported_type_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR: e.(Cpp.ExplicitObjectParamUnsupported.F)(1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_explicit_object_param_with_unsupported_type_param.carbon:[[@LINE+2]]:3-45: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
e.(Cpp.ExplicitObjectParamUnsupported.F)(1);
|
||||
}
|
||||
|
||||
+2
-6
@@ -29,12 +29,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "non_aggregate.h";
|
||||
|
||||
fn Make() {
|
||||
// CHECK:STDERR: fail_non_aggregate_init.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `{}` to `Cpp.X` [ConversionFailure]
|
||||
// CHECK:STDERR: var _: Cpp.X = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_non_aggregate_init.carbon:[[@LINE+4]]:3: note: type `{}` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: var _: Cpp.X = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_non_aggregate_init.carbon:[[@LINE+3]]:3-14: error: cannot implicitly convert expression of type `{}` to `Cpp.X` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_non_aggregate_init.carbon:[[@LINE+2]]:3-14: note: type `{}` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
var _: Cpp.X = {};
|
||||
}
|
||||
|
||||
@@ -41,21 +41,11 @@ import Cpp library "overload.h";
|
||||
class Overload0Params {
|
||||
extend base: Cpp.OverloadedBase;
|
||||
//
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE+16]]:3: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: override fn f(self);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE+6]]:3-22: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: included from: fail_overload_no_matching_arity.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./overload.h:6:16: note: base class function has more parameters (1 vs 0 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: virtual void f(X x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE-12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./overload.h:7:16: note: base class function has more parameters (1 vs 0 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: virtual void f(Y y);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./overload.h:8:16: note: base class function has more parameters (2 vs 0 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: virtual void f(X x, Y y);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
override fn f(self);
|
||||
}
|
||||
@@ -63,21 +53,11 @@ class Overload0Params {
|
||||
class Overload3Params {
|
||||
extend base: Cpp.OverloadedBase;
|
||||
//
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE+16]]:3: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: override fn f(self, x: Cpp.X, y: Cpp.Y, z: Cpp.X);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE-30]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE+6]]:3-52: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: included from: fail_overload_no_matching_arity.carbon:[[@LINE-18]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./overload.h:6:16: note: base class function has fewer parameters (1 vs 3 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: virtual void f(X x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE-34]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./overload.h:7:16: note: base class function has fewer parameters (1 vs 3 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: virtual void f(Y y);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE-38]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./overload.h:8:16: note: base class function has fewer parameters (2 vs 3 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: virtual void f(X x, Y y);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
override fn f(self, x: Cpp.X, y: Cpp.Y, z: Cpp.X);
|
||||
}
|
||||
@@ -94,19 +74,13 @@ import Cpp library "overload.h";
|
||||
class OverloadX {
|
||||
extend base: Cpp.OverloadedBase;
|
||||
//
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+16]]:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: override fn f(self, x: Cpp.X);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+10]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_overload_type.carbon: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+10]]:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: override fn f(self, x: Cpp.X);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+6]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: included from: fail_overload_type.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./overload.h:7:16: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: virtual void f(Y y);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_overload_type.carbon: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext]
|
||||
@@ -116,19 +90,13 @@ class OverloadX {
|
||||
class OverloadY {
|
||||
extend base: Cpp.OverloadedBase;
|
||||
//
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+14]]:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: override fn f(self, y: Cpp.Y);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+8]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_overload_type.carbon: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+8]]:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: override fn f(self, y: Cpp.Y);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE-36]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+4]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: included from: fail_overload_type.carbon:[[@LINE-26]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./overload.h:6:16: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: virtual void f(X x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
override fn f(self, y: Cpp.Y);
|
||||
}
|
||||
@@ -65,17 +65,10 @@ import Cpp library "instantiation_error.h";
|
||||
//@dump-sem-ir-begin
|
||||
var x: Cpp.XY.r#type = 0;
|
||||
|
||||
// CHECK:STDERR: fail_use_instantiation_error.carbon:[[@LINE+12]]:8: error: member access into incomplete class `Cpp.X` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: var y: Cpp.Xint.r#type = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_instantiation_error.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_use_instantiation_error.carbon:[[@LINE+5]]:8-22: error: member access into incomplete class `Cpp.X` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: included from: fail_use_instantiation_error.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./instantiation_error.h:3:25: note: type 'int' cannot be used prior to '::' because it has no members [CppInteropParseError]
|
||||
// CHECK:STDERR: 3 | using type = typename T::member;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_use_instantiation_error.carbon:[[@LINE-12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./instantiation_error.h:2:29: note: in instantiation of template class 'X<int>' requested here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | template<typename T> struct X {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
var y: Cpp.Xint.r#type = 0;
|
||||
//@dump-sem-ir-end
|
||||
@@ -296,11 +289,11 @@ fn G() {
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.d94 = var_pattern %x.patt [concrete = constants.%x.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %i32 = var_storage %y.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc21: type = splice_block %type.ref.loc21 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc14: type = splice_block %type.ref.loc14 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Xint.ref: type = name_ref Xint, imports.%X.decl.b67 [concrete = constants.%X.c92]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %type.ref.loc21: type = name_ref r#type, %i32.2 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %type.ref.loc14: type = name_ref r#type, %i32.2 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %i32 = wrapper_binding y, %y.var [concrete = %y.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -319,14 +312,14 @@ fn G() {
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7: init %i32 = call %bound_method.loc7_1.2(%int_0.loc7) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc7: init %i32 = converted %int_0.loc7, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc7
|
||||
// CHECK:STDOUT: %int_0.loc21: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %impl.elem0.loc21: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc21_1.1: <bound method> = bound_method %int_0.loc21, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc21: <specific function> = specific_function %impl.elem0.loc21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc21_1.2: <bound method> = bound_method %int_0.loc21, %specific_fn.loc21 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_1.2(%int_0.loc21) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc21: init %i32 = converted %int_0.loc21, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc21
|
||||
// CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc14_1.1: <bound method> = bound_method %int_0.loc14, %impl.elem0.loc14 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc14: <specific function> = specific_function %impl.elem0.loc14, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc14_1.2: <bound method> = bound_method %int_0.loc14, %specific_fn.loc14 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14: init %i32 = call %bound_method.loc14_1.2(%int_0.loc14) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc14: init %i32 = converted %int_0.loc14, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc14
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -35,13 +35,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "declaration.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:19: error: binding pattern has incomplete type `DeclBar` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: var unused bar: Cpp.DeclBar;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+4]]:19-29: error: binding pattern has incomplete type `DeclBar` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: included from: fail_use_declaration_as_definition.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./declaration.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: union DeclBar;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var unused bar: Cpp.DeclBar;
|
||||
}
|
||||
|
||||
+4
-12
@@ -37,16 +37,10 @@ const S& Get();
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_const_member_assign.carbon:[[@LINE+11]]:3: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR: Cpp.Get().x = 123;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_const_member_assign.carbon:[[@LINE+5]]:3-13: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_const_member_assign.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Core.IntLiteral` to `const i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.Get().x = 123;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_const_member_assign.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(const i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.Get().x = 123;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_const_member_assign.carbon:[[@LINE+3]]:3-19: error: cannot implicitly convert expression of type `Core.IntLiteral` to `const i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_const_member_assign.carbon:[[@LINE+2]]:3-19: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(const i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
Cpp.Get().x = 123;
|
||||
}
|
||||
@@ -63,9 +57,7 @@ const S& Get();
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_const_member_assign_cast.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR: Cpp.Get().x = 123 as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_const_member_assign_cast.carbon:[[@LINE+2]]:3-13: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR:
|
||||
Cpp.Get().x = 123 as i32;
|
||||
}
|
||||
+10
-30
@@ -39,48 +39,28 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "enum.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert expression of type `Cpp.Enum` to `i8` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.Enum.a as i8;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+4]]:3: note: type `Cpp.Enum` does not implement interface `Core.As(i8)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.Enum.a as i8;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-18: error: cannot convert expression of type `Cpp.Enum` to `i8` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-18: note: type `Cpp.Enum` does not implement interface `Core.As(i8)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
Cpp.Enum.a as i8;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert expression of type `Cpp.Enum` to `i32` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.Enum.a as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+4]]:3: note: type `Cpp.Enum` does not implement interface `Core.As(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.Enum.a as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-19: error: cannot convert expression of type `Cpp.Enum` to `i32` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-19: note: type `Cpp.Enum` does not implement interface `Core.As(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
Cpp.Enum.a as i32;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert expression of type `i8` to `Cpp.Enum` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: (42 as i8) as Cpp.Enum;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+4]]:3: note: type `i8` does not implement interface `Core.As(Cpp.Enum)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: (42 as i8) as Cpp.Enum;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-24: error: cannot convert expression of type `i8` to `Cpp.Enum` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-24: note: type `i8` does not implement interface `Core.As(Cpp.Enum)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
(42 as i8) as Cpp.Enum;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert expression of type `i32` to `Cpp.Enum` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: (42 as i32) as Cpp.Enum;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+4]]:3: note: type `i32` does not implement interface `Core.As(Cpp.Enum)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: (42 as i32) as Cpp.Enum;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-25: error: cannot convert expression of type `i32` to `Cpp.Enum` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-25: note: type `i32` does not implement interface `Core.As(Cpp.Enum)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
(42 as i32) as Cpp.Enum;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+7]]:3: error: cannot convert expression of type `Cpp.Enum` to `Cpp.DifferentSize` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.a as Cpp.DifferentSize;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+4]]:3: note: type `Cpp.Enum` does not implement interface `Core.As(Cpp.DifferentSize)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.a as Cpp.DifferentSize;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-28: error: cannot convert expression of type `Cpp.Enum` to `Cpp.DifferentSize` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-28: note: type `Cpp.Enum` does not implement interface `Core.As(Cpp.DifferentSize)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
Cpp.a as Cpp.DifferentSize;
|
||||
}
|
||||
|
||||
+2
-6
@@ -76,12 +76,8 @@ fn CompareGeneric[U: type, T: Core.EqWith(U)](x: T, y: U) -> bool {
|
||||
}
|
||||
|
||||
fn CompareHeterogeneousFail(x: Cpp.Scoped, y: Cpp.Unscoped) -> bool {
|
||||
// CHECK:STDERR: fail_heterogeneous.carbon:[[@LINE+7]]:10: error: cannot convert type `Cpp.Scoped` into type implementing `Core.EqWith(Cpp.Unscoped)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: return CompareGeneric(x, y);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_heterogeneous.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn CompareGeneric[U: type, T: Core.EqWith(U)](x: T, y: U) -> bool {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_heterogeneous.carbon:[[@LINE+3]]:10-29: error: cannot convert type `Cpp.Scoped` into type implementing `Core.EqWith(Cpp.Unscoped)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_heterogeneous.carbon:[[@LINE-6]]:1-67: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
return CompareGeneric(x, y);
|
||||
}
|
||||
+5
-13
@@ -21,10 +21,8 @@ enum UnsizedEnum;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: import_declaration.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_declaration.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./declaration.h:4:6: warning: forward references to 'enum' types are a Microsoft extension [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 4 | enum UnsizedEnum;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "declaration.h";
|
||||
|
||||
@@ -36,23 +34,17 @@ fn F(e: Cpp.UnsizedEnum);
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_use_declaration_as_definition.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./declaration.h:4:6: warning: forward references to 'enum' types are a Microsoft extension [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 4 | enum UnsizedEnum;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "declaration.h";
|
||||
|
||||
fn MyF() {
|
||||
// TODO: It's a bit surprising to refer to this type as a class, even though
|
||||
// we model it as a class in Carbon. Consider customizing the diagnostic.
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:17: error: binding pattern has incomplete type `UnsizedEnum` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: var unused e: Cpp.UnsizedEnum;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+4]]:17-31: error: binding pattern has incomplete type `UnsizedEnum` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: included from: fail_use_declaration_as_definition.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./declaration.h:4:6: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: enum UnsizedEnum;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var unused e: Cpp.UnsizedEnum;
|
||||
}
|
||||
@@ -83,7 +75,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: %e.patt: %pattern_type = wrapper_binding_pattern e, %e.param_patt [concrete = constants.%e.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %e.param: %UnsizedEnum = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %UnsizedEnum.ref [concrete = constants.%UnsizedEnum] {
|
||||
// CHECK:STDOUT: %.loc10: type = splice_block %UnsizedEnum.ref [concrete = constants.%UnsizedEnum] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %UnsizedEnum.ref: type = name_ref UnsizedEnum, imports.%UnsizedEnum.decl [concrete = constants.%UnsizedEnum]
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_invalid_underlying_type.carbon:[[@LINE+4]]:20: error: unknown type name 'no_such_type' [CppInteropParseError]
|
||||
// CHECK:STDERR: 9 | enum InvalidEnum : no_such_type {};
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_invalid_underlying_type.carbon:[[@LINE+2]]:20: error: unknown type name 'no_such_type' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
enum InvalidEnum : no_such_type {};
|
||||
''';
|
||||
|
||||
+1
-3
@@ -33,9 +33,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "enum.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_name_without_scope.carbon:[[@LINE+4]]:28: error: member name `b` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused b: Cpp.Enum = Cpp.b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_name_without_scope.carbon:[[@LINE+2]]:28-32: error: member name `b` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused b: Cpp.Enum = Cpp.b;
|
||||
}
|
||||
|
||||
+5
-15
@@ -36,21 +36,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "enum.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+7]]:29: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused c: Cpp.Other = Cpp.Enum.c;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+4]]:29: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused c: Cpp.Other = Cpp.Enum.c;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+3]]:29-38: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+2]]:29-38: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused c: Cpp.Other = Cpp.Enum.c;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+7]]:30: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused c2: Cpp.Other = Cpp.c;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+4]]:30: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused c2: Cpp.Other = Cpp.c;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+3]]:30-34: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+2]]:30-34: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused c2: Cpp.Other = Cpp.c;
|
||||
}
|
||||
@@ -62,9 +54,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "enum.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_non_enum_member.carbon:[[@LINE+4]]:29: error: member name `d` not found in `Cpp.Enum` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused c: Cpp.Other = Cpp.Enum.d;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_non_enum_member.carbon:[[@LINE+2]]:29-38: error: member name `d` not found in `Cpp.Enum` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused c: Cpp.Other = Cpp.Enum.d;
|
||||
}
|
||||
|
||||
+23
-27
@@ -28,15 +28,11 @@ using enum Zoo::Animal;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: import_enum.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_enum.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./enum.h:5:7: warning: using enum declaration is a C++20 extension [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 5 | using enum Color;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: import_enum.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_enum.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./enum.h:12:7: warning: using enum declaration is a C++20 extension [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 12 | using enum Zoo::Animal;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "enum.h";
|
||||
|
||||
@@ -93,46 +89,46 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc18_32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc18_35: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc14_35: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: %Red.ref: %Color = name_ref Red, imports.%int_0.59e [concrete = constants.%int_0.59e]
|
||||
// CHECK:STDOUT: %.loc18: type = splice_block %Color.ref.loc18_23 [concrete = constants.%Color] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc18_20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc18_23: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: %.loc14: type = splice_block %Color.ref.loc14_23 [concrete = constants.%Color] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc14_23: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %col: %Color = wrapper_binding col, %Red.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %col.patt: %pattern_type.732 = value_binding_pattern col [concrete = constants.%col.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19_33: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15_33: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Blue.ref: %Color = name_ref Blue, imports.%int_1.b76 [concrete = constants.%int_1.b76]
|
||||
// CHECK:STDOUT: %.loc19: type = splice_block %Color.ref.loc19 [concrete = constants.%Color] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc19: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: %.loc15: type = splice_block %Color.ref.loc15 [concrete = constants.%Color] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc15: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %colb: %Color = wrapper_binding colb, %Blue.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %colb.patt: %pattern_type.732 = value_binding_pattern colb [concrete = constants.%colb.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20_37: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc20_40: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc20_44: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_37: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc16_40: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc16_44: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: %Cat.ref: %Animal = name_ref Cat, imports.%int_0.648 [concrete = constants.%int_0.648]
|
||||
// CHECK:STDOUT: %.loc20: type = splice_block %Animal.ref.loc20_27 [concrete = constants.%Animal] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20_20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc20_23: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc20_27: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: %.loc16: type = splice_block %Animal.ref.loc16_27 [concrete = constants.%Animal] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc16_23: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc16_27: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %pet: %Animal = wrapper_binding pet, %Cat.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %pet.patt: %pattern_type.8cd = value_binding_pattern pet [concrete = constants.%pet.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21_38: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17_38: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dog.ref: %Animal = name_ref Dog, imports.%int_1.e7b [concrete = constants.%int_1.e7b]
|
||||
// CHECK:STDOUT: %.loc21: type = splice_block %Animal.ref.loc21 [concrete = constants.%Animal] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc21: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc21: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: %.loc17: type = splice_block %Animal.ref.loc17 [concrete = constants.%Animal] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc17: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc17: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %pet2: %Animal = wrapper_binding pet2, %Dog.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
|
||||
@@ -43,33 +43,21 @@ import Cpp;
|
||||
// HLSL extension, or by mapping to a `std::array` parameter.
|
||||
|
||||
// TODO: These diagnostics are very bad.
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+8]]:1: error: semantics TODO: `by-var array parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+4]]:1-48: error: semantics TODO: `by-var array parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+4]]:1: error: semantics TODO: `failed to map C++ type to Carbon` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+2]]:1-48: error: semantics TODO: `failed to map C++ type to Carbon` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
|
||||
inline Cpp '''
|
||||
int GArrayVarParam() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+15]]:10: error: no member named 'FArrayVarParam' in namespace 'Carbon'; did you mean 'GArrayVarParam'? [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: | GArrayVarParam
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-6]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | int GArrayVarParam() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+7]]:10: error: no member named 'FArrayVarParam' in namespace 'Carbon'; did you mean 'GArrayVarParam'? [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+6]]:10-31: note: replace with `GArrayVarParam` [CppInteropFixItReplacement]
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-4]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+7]]:33: error: too many arguments to function call, expected 0, have 1 [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-13]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | int GArrayVarParam() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+3]]:33-47: error: too many arguments to function call, expected 0, have 1 [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-7]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
//@dump-sem-ir-end
|
||||
@@ -85,9 +73,7 @@ import Cpp;
|
||||
// types, as C++ does not have such return types.
|
||||
// TODO: Support this, perhaps by returning a `std::array`.
|
||||
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:1: error: semantics TODO: `array return type` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn FArrayReturn() -> array(i32, 5) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+2]]:1-36: error: semantics TODO: `array return type` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn FArrayReturn() -> array(i32, 5) {
|
||||
return (1, 2, 3, 4, 5);
|
||||
@@ -95,18 +81,12 @@ fn FArrayReturn() -> array(i32, 5) {
|
||||
|
||||
inline Cpp '''
|
||||
int GArrayReturn() {
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+8]]:16: error: no member named 'FArrayReturn' in namespace 'Carbon'; did you mean 'GArrayReturn'? [CppInteropParseError]
|
||||
// CHECK:STDERR: 27 | auto &&arr = Carbon::FArrayReturn();
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: | GArrayReturn
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE-5]]:5: note: 'GArrayReturn' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 18 | int GArrayReturn() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:16: error: no member named 'FArrayReturn' in namespace 'Carbon'; did you mean 'GArrayReturn'? [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+3]]:16-35: note: replace with `GArrayReturn` [CppInteropFixItReplacement]
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE-3]]:5: note: 'GArrayReturn' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
auto &&arr = Carbon::FArrayReturn();
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:13: error: subscripted value is not an array, pointer, or vector [CppInteropParseError]
|
||||
// CHECK:STDERR: 32 | return arr[0];
|
||||
// CHECK:STDERR: | ~~~^~
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+2]]:13: error: subscripted value is not an array, pointer, or vector [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
return arr[0];
|
||||
}
|
||||
|
||||
@@ -36,18 +36,10 @@ class FactoryIsMethod {
|
||||
|
||||
inline Cpp '''
|
||||
void CallFactoryIsMethod() {
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE+13]]:27: error: no matching constructor for initialization of 'Carbon::FactoryIsMethod' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryIsMethod a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-9]]:23: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-12]]:23: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-15]]:23: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE+5]]:27: error: no matching constructor for initialization of 'Carbon::FactoryIsMethod' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-7]]:23: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-8]]:23: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-9]]:23: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::FactoryIsMethod a(42);
|
||||
}
|
||||
@@ -64,18 +56,10 @@ class FactoryDoesntReturnSelf {
|
||||
|
||||
inline Cpp '''
|
||||
void CallFactoryDoesntReturnSelf() {
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE+13]]:35: error: no matching constructor for initialization of 'Carbon::FactoryDoesntReturnSelf' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryDoesntReturnSelf a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-9]]:31: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-12]]:31: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-15]]:31: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE+5]]:35: error: no matching constructor for initialization of 'Carbon::FactoryDoesntReturnSelf' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-7]]:31: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-8]]:31: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-9]]:31: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::FactoryDoesntReturnSelf a(42);
|
||||
}
|
||||
@@ -92,18 +76,10 @@ class FactoryReturnsByRef {
|
||||
|
||||
inline Cpp '''
|
||||
void CallFactoryReturnsByRef() {
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE+13]]:31: error: no matching constructor for initialization of 'Carbon::FactoryReturnsByRef' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryReturnsByRef a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-9]]:27: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-12]]:27: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-15]]:27: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE+5]]:31: error: no matching constructor for initialization of 'Carbon::FactoryReturnsByRef' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-7]]:27: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-8]]:27: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-9]]:27: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::FactoryReturnsByRef a(42);
|
||||
}
|
||||
@@ -115,9 +91,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class GenericConstructor {
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+4]]:3: error: semantics TODO: `support exporting generic member functions` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn GenericConstructor[T: type](_: T) -> Self {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+2]]:3-48: error: semantics TODO: `support exporting generic member functions` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn GenericConstructor[T: type](_: T) -> Self {
|
||||
return {};
|
||||
@@ -126,18 +100,10 @@ class GenericConstructor {
|
||||
|
||||
inline Cpp '''
|
||||
void CallGenericConstructor() {
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+13]]:30: error: no matching constructor for initialization of 'Carbon::GenericConstructor' [CppInteropParseError]
|
||||
// CHECK:STDERR: 30 | Carbon::GenericConstructor b(0);
|
||||
// CHECK:STDERR: | ^ ~
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-15]]:26: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const GenericConstructor' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericConstructor {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-18]]:26: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'GenericConstructor' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericConstructor {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-21]]:26: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericConstructor {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+5]]:30: error: no matching constructor for initialization of 'Carbon::GenericConstructor' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-11]]:26: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const GenericConstructor' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-12]]:26: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'GenericConstructor' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-13]]:26: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::GenericConstructor b(0);
|
||||
}
|
||||
@@ -149,9 +115,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class GenericClass(T: type) {
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+4]]:3: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn GenericClass(_: T) -> Self {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+2]]:3-33: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn GenericClass(_: T) -> Self {
|
||||
return {};
|
||||
@@ -160,18 +124,10 @@ class GenericClass(T: type) {
|
||||
|
||||
inline Cpp '''
|
||||
void CallGenericClass() {
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+13]]:29: error: no matching constructor for initialization of 'Carbon::GenericClass<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 30 | Carbon::GenericClass<int> c(0);
|
||||
// CHECK:STDERR: | ^ ~
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-15]]:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const GenericClass<int>' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericClass(T: type) {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-18]]:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'GenericClass<int>' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericClass(T: type) {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-21]]:29: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericClass(T: type) {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+5]]:29: error: no matching constructor for initialization of 'Carbon::GenericClass<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-11]]:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const GenericClass<int>' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-12]]:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'GenericClass<int>' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-13]]:29: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::GenericClass<int> c(0);
|
||||
}
|
||||
|
||||
@@ -95,14 +95,9 @@ fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+9]]:1: in import [InImport]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_todo_generic.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1-41: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1-41: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
import OtherGeneric;
|
||||
import Cpp inline '''
|
||||
|
||||
@@ -52,21 +52,15 @@ Carbon::B CallInterfaceF() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:1: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn NonTypeF[unused N: i32]() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+2]]:1-30: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn NonTypeF[unused N: i32]() {}
|
||||
|
||||
inline Cpp '''
|
||||
void CallNonTypeF() {
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+8]]:11: error: no member named 'NonTypeF' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::NonTypeF<3>();
|
||||
// CHECK:STDERR: | ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:11-18: error: no member named 'NonTypeF' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:23: error: expected expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::NonTypeF<3>();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+2]]:23: error: expected expression [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::NonTypeF<3>();
|
||||
}
|
||||
@@ -91,9 +85,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class EnclosingA(T: type) {
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:3: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn MemberF[U: type](x: T, y: U);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+2]]:3-34: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn MemberF[U: type](x: T, y: U);
|
||||
}
|
||||
@@ -105,9 +97,7 @@ void CallEnclosingF() {
|
||||
// is to test a generic function within an enclosing generic scope.
|
||||
//
|
||||
Carbon::EnclosingB b;
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:5: error: no member named 'MemberF' in 'Carbon::EnclosingA<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 23 | b.MemberF(1, 2);
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+2]]:5: error: no member named 'MemberF' in 'Carbon::EnclosingA<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
b.MemberF(1, 2);
|
||||
}
|
||||
@@ -117,21 +107,15 @@ void CallEnclosingF() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+4]]:1: error: semantics TODO: `failed to import C++ type` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn UnsupportedF[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+2]]:1-39: error: semantics TODO: `failed to import C++ type` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn UnsupportedF[T: type](unused t: T) {}
|
||||
|
||||
inline Cpp '''
|
||||
void CallUnsupportedF() {
|
||||
volatile int x;
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+7]]:3: error: no matching function for call to 'UnsupportedF' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::UnsupportedF(x);
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE-8]]:39: note: candidate template ignored: substitution failure [with T = volatile int] [CppInteropParseNote]
|
||||
// CHECK:STDERR: 8 | fn UnsupportedF[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+3]]:3-22: error: no matching function for call to 'UnsupportedF' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE-6]]:39: note: candidate template ignored: substitution failure [with T = volatile int] [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::UnsupportedF(x);
|
||||
}
|
||||
|
||||
+19
-43
@@ -123,9 +123,7 @@ import Cpp library "wchar_t_param.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_wchar_t_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: wchar_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo('X');
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_wchar_t_param.carbon:[[@LINE+2]]:3-14: error: semantics TODO: `Unsupported: parameter type: wchar_t` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo('X');
|
||||
//@dump-sem-ir-end
|
||||
@@ -143,10 +141,8 @@ auto foo(char8_t c) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_import_char8_t_param.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_todo_import_char8_t_param.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./char8_t_param.h:2:10: error: unknown type name 'char8_t' [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | auto foo(char8_t c) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "char8_t_param.h";
|
||||
|
||||
@@ -172,9 +168,7 @@ import Cpp library "char16_t_param.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_char16_t_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: char16_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_char16_t_param.carbon:[[@LINE+2]]:3-12: error: semantics TODO: `Unsupported: parameter type: char16_t` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1);
|
||||
//@dump-sem-ir-end
|
||||
@@ -196,9 +190,7 @@ import Cpp library "char32_t_param.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_char32_t_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: char32_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_char32_t_param.carbon:[[@LINE+2]]:3-12: error: semantics TODO: `Unsupported: parameter type: char32_t` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1);
|
||||
//@dump-sem-ir-end
|
||||
@@ -242,13 +234,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_max.carbon:[[@LINE+8]]:11: error: integer value 32768 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(0x8000);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_max.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_max.carbon:[[@LINE+4]]:11-16: error: integer value 32768 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_overflow_max.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x8000);
|
||||
}
|
||||
@@ -272,13 +260,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_min.carbon:[[@LINE+8]]:11: error: integer value -32769 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(-0x8001);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_min.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_min.carbon:[[@LINE+4]]:11-17: error: integer value -32769 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_overflow_min.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-0x8001);
|
||||
}
|
||||
@@ -290,16 +274,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+11]]:11: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+8]]:11: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+5]]:11-18: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+4]]:11-18: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_int32_arg.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i32);
|
||||
}
|
||||
@@ -527,9 +505,7 @@ import Cpp library "bit_int_24_param.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_bit_int_24_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: bit_int_24` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_bit_int_24_param.carbon:[[@LINE+2]]:3-12: error: semantics TODO: `Unsupported: parameter type: bit_int_24` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1);
|
||||
//@dump-sem-ir-end
|
||||
@@ -1168,7 +1144,7 @@ fn F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc12: Core.CharLiteral = char_value U+0058 [concrete = constants.%.d16]
|
||||
// CHECK:STDOUT: %.loc10: Core.CharLiteral = char_value U+0058 [concrete = constants.%.d16]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1221,13 +1197,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc13_11.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc11_11.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc13_11.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_11.2(%int_1) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc13_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc13_11.2: %i32 = converted %int_1, %.loc13_11.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc13_11.2)
|
||||
// CHECK:STDOUT: %bound_method.loc11_11.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc11_11.2(%int_1) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc11_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc11_11.2: %i32 = converted %int_1, %.loc11_11.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+8
-24
@@ -54,13 +54,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "int_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_max.carbon:[[@LINE+8]]:11: error: integer value 2147483648 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(0x8000_0000);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_max.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_max.carbon:[[@LINE+4]]:11-21: error: integer value 2147483648 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_int_param_overflow_max.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_param.h:2:14: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x8000_0000);
|
||||
}
|
||||
@@ -84,13 +80,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "int_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_min.carbon:[[@LINE+8]]:11: error: integer value -2147483649 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(-0x8000_0001);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_min.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_min.carbon:[[@LINE+4]]:11-22: error: integer value -2147483649 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_int_param_overflow_min.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_param.h:2:14: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-0x8000_0001);
|
||||
}
|
||||
@@ -164,25 +156,17 @@ import Cpp library "unsigned_int_param.h";
|
||||
fn F() {
|
||||
Cpp.foo(0);
|
||||
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+8]]:11: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: Cpp.foo(-1);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+4]]:11-12: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: included from: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./unsigned_int_param.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-1);
|
||||
|
||||
Cpp.foo(0x0_FFFF_FFFF);
|
||||
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+8]]:11: error: integer value 4294967296 too large for type `u32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(0x1_0000_0000);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-20]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+4]]:11-23: error: integer value 4294967296 too large for type `u32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./unsigned_int_param.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x1_0000_0000);
|
||||
}
|
||||
|
||||
+30
-119
@@ -25,57 +25,29 @@ auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6: error: argument type 'ForwardDeclaredClass' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_param1(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// 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]
|
||||
// CHECK:STDERR: 2 | class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_param_type.h";
|
||||
|
||||
fn F(p: Cpp.ForwardDeclaredClass*) {
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:3-25: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6: error: argument type 'ForwardDeclaredClass' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 5 | auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// 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]
|
||||
// CHECK:STDERR: 2 | class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: | ^
|
||||
Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+28]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_param2(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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-5]]:23: error: forming value of incomplete type `Cpp.ForwardDeclaredClass` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-23]]:10: in file included here [InCppInclude]
|
||||
// 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: class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo_decl_param1(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:23: error: forming value of incomplete type `Cpp.ForwardDeclaredClass` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo_decl_param2(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-35]]:10: in file included here [InCppInclude]
|
||||
// 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: class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-39]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_param2(*p);
|
||||
}
|
||||
@@ -118,25 +90,15 @@ auto foo_non_copyable_param(NonCopyableClass) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:6: error: call to deleted constructor of 'NonCopyableClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_non_copyable_param(NonCopyableClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// 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: 3 | NonCopyableClass(const NonCopyableClass&) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:45: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_non_copyable_param(NonCopyableClass) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
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+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_non_copyable_param(c);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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
|
||||
@@ -172,24 +134,14 @@ fn F() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// 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: 3 | MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "move_only_param_type.h";
|
||||
|
||||
fn F(c: Cpp.MoveOnlyClass) {
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_move_only_param(c);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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);
|
||||
}
|
||||
@@ -198,24 +150,14 @@ fn F(c: Cpp.MoveOnlyClass) {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// 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: 3 | MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "move_only_param_type.h";
|
||||
|
||||
fn F(ref c: Cpp.MoveOnlyClass) {
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_move_only_param(c);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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);
|
||||
}
|
||||
@@ -224,24 +166,14 @@ fn F(ref c: Cpp.MoveOnlyClass) {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// 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: 3 | MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
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+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_move_only_param(Cpp.move_move_only(ref c));
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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));
|
||||
}
|
||||
@@ -427,13 +359,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:3: error: member access into incomplete class `Cpp.Incomplete` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: Cpp.Incomplete.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// 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: class Incomplete;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.Incomplete.foo();
|
||||
}
|
||||
@@ -496,36 +424,19 @@ auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// 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: 4 | auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: forward declaration of 'DeclValueReturnClass' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | class DeclValueReturnClass;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_return_type.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+16]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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+12]]:3: error: function returns incomplete type `Cpp.DeclValueReturnClass` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// 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: class DeclValueReturnClass;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:33: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_value_return();
|
||||
}
|
||||
@@ -664,7 +575,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%c.param: %NonCopyableClass) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <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)
|
||||
|
||||
@@ -72,9 +72,7 @@ constexpr int invalid_const_fn(int a) {
|
||||
}
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_invalid_constant_eval.carbon:[[@LINE+4]]:19: error: array bound is not a constant [InvalidArrayExpr]
|
||||
// CHECK:STDERR: let a: array(i32, Cpp.invalid_const_fn(5)) = (1, 2, 3);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_invalid_constant_eval.carbon:[[@LINE+2]]:19-41: error: array bound is not a constant [InvalidArrayExpr]
|
||||
// CHECK:STDERR:
|
||||
let a: array(i32, Cpp.invalid_const_fn(5)) = (1, 2, 3);
|
||||
|
||||
@@ -103,28 +101,16 @@ var a: i32 = 0;
|
||||
|
||||
// TODO: This is failing when building the thunk, not when calling it.
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+9]]:15: error: call to consteval function 'nonconst_consteval_fn' is not a constant expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+6]]:15: note: function parameter 'r' with unknown value cannot be used in a constant expression [CppInteropParseNote]
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+3]]:15: note: declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+3]]:15: error: call to consteval function 'nonconst_consteval_fn' is not a constant expression [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+2]]:15: note: function parameter 'r' with unknown value cannot be used in a constant expression [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+1]]:15: note: declared here [CppInteropParseNote]
|
||||
consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+11]]:14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+5]]:14-41: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+7]]:14: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE-10]]:15: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+3]]:14-41: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE-6]]:15: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
|
||||
@@ -144,17 +130,13 @@ struct ConstexprC {
|
||||
// TODO: This should probably be allowed.
|
||||
eval fn F() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+3]]:27: error: expression is runtime; expected constant [EvalRequiresConstantValue]
|
||||
// CHECK:STDERR: let c: Cpp.ConstexprC = 3;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+1]]:27: error: expression is runtime; expected constant [EvalRequiresConstantValue]
|
||||
let c: Cpp.ConstexprC = 3;
|
||||
return c.a;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+4]]:19: note: in call to F here [InCallToEvalFn]
|
||||
// CHECK:STDERR: let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+2]]:19-21: note: in call to F here [InCallToEvalFn]
|
||||
// CHECK:STDERR:
|
||||
let a: array(i32, F()) = (1, 2, 3);
|
||||
|
||||
@@ -202,9 +184,9 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: %self.patt.d4e: %pattern_type.3cc = wrapper_binding_pattern self, %self.param_patt.d94 [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.type: type = fn_type @ConstexprC.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor: %ConstexprC.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc17 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -231,7 +213,7 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc17 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.3cc = ref_param_pattern [concrete = constants.%self.param_patt.d94]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.3cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d4e]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -243,46 +225,46 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: fn @F() -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc19_27.1: ref %ConstexprC = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc19: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc19_27.1: <bound method> = bound_method %int_3, %impl.elem0.loc19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc19: <specific function> = specific_function %impl.elem0.loc19, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc19_27.2: <bound method> = bound_method %int_3, %specific_fn.loc19 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc19_27.2(%int_3) [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %.loc19_27.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %.loc19_27.3: %i32 = converted %int_3, %.loc19_27.2 [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %addr: %ptr.0b8 = addr_of %.loc19_27.1
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.call: init %empty_tuple.type = call imports.%ConstexprC__carbon_thunk.decl(%.loc19_27.3, %addr)
|
||||
// CHECK:STDOUT: %.loc19_27.4: init %ConstexprC to %.loc19_27.1 = mark_in_place_init %ConstexprC__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc19_27.5: init %ConstexprC = converted %int_3, %.loc19_27.4
|
||||
// CHECK:STDOUT: %.loc19_27.6: ref %ConstexprC = temporary %.loc19_27.1, %.loc19_27.5
|
||||
// CHECK:STDOUT: %.loc19_27.7: %ConstexprC = acquire_value %.loc19_27.6
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %ConstexprC.ref [concrete = constants.%ConstexprC] {
|
||||
// CHECK:STDOUT: %.loc17_27.1: ref %ConstexprC = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc17: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc17_27.1: <bound method> = bound_method %int_3, %impl.elem0.loc17 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc17: <specific function> = specific_function %impl.elem0.loc17, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc17_27.2: <bound method> = bound_method %int_3, %specific_fn.loc17 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc17_27.2(%int_3) [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %.loc17_27.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %.loc17_27.3: %i32 = converted %int_3, %.loc17_27.2 [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %addr: %ptr.0b8 = addr_of %.loc17_27.1
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.call: init %empty_tuple.type = call imports.%ConstexprC__carbon_thunk.decl(%.loc17_27.3, %addr)
|
||||
// CHECK:STDOUT: %.loc17_27.4: init %ConstexprC to %.loc17_27.1 = mark_in_place_init %ConstexprC__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc17_27.5: init %ConstexprC = converted %int_3, %.loc17_27.4
|
||||
// CHECK:STDOUT: %.loc17_27.6: ref %ConstexprC = temporary %.loc17_27.1, %.loc17_27.5
|
||||
// CHECK:STDOUT: %.loc17_27.7: %ConstexprC = acquire_value %.loc17_27.6
|
||||
// CHECK:STDOUT: %.loc17_13: type = splice_block %ConstexprC.ref [concrete = constants.%ConstexprC] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ConstexprC.ref: type = name_ref ConstexprC, imports.%ConstexprC.decl [concrete = constants.%ConstexprC]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: %ConstexprC = wrapper_binding c, %.loc19_27.7
|
||||
// CHECK:STDOUT: %c: %ConstexprC = wrapper_binding c, %.loc17_27.7
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.3cc = value_binding_pattern c [concrete = constants.%c.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.ref: %ConstexprC = name_ref c, %c
|
||||
// CHECK:STDOUT: %a.ref: %ConstexprC.elem = name_ref a, @ConstexprC.%field_decl [concrete = @ConstexprC.%field_decl]
|
||||
// CHECK:STDOUT: %.loc20_11.1: ref %i32 = class_element_access %c.ref, element0
|
||||
// CHECK:STDOUT: %.loc20_11.2: %i32 = acquire_value %.loc20_11.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc20: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae]
|
||||
// CHECK:STDOUT: %bound_method.loc20_11.1: <bound method> = bound_method %.loc20_11.2, %impl.elem0.loc20
|
||||
// CHECK:STDOUT: %specific_fn.loc20: <specific function> = specific_function %impl.elem0.loc20, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc20_11.2: <bound method> = bound_method %.loc20_11.2, %specific_fn.loc20
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_11.2(%.loc20_11.2)
|
||||
// CHECK:STDOUT: %.loc18_11.1: ref %i32 = class_element_access %c.ref, element0
|
||||
// CHECK:STDOUT: %.loc18_11.2: %i32 = acquire_value %.loc18_11.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc18: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae]
|
||||
// CHECK:STDOUT: %bound_method.loc18_11.1: <bound method> = bound_method %.loc18_11.2, %impl.elem0.loc18
|
||||
// CHECK:STDOUT: %specific_fn.loc18: <specific function> = specific_function %impl.elem0.loc18, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc18_11.2: <bound method> = bound_method %.loc18_11.2, %specific_fn.loc18
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc18_11.2(%.loc18_11.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc19_27.6, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc19_27.6)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc17_27.6, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc17_27.6)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %ConstexprC) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17(%self.param: ref %ConstexprC) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %ConstexprC) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17(%self.param: ref %ConstexprC) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.call: init %empty_tuple.type = call imports.%ConstexprC.cpp_destructor.decl(%self.param)
|
||||
|
||||
+172
-183
@@ -46,33 +46,22 @@ fn G(n: i32) -> i32;
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+4]]:21: error: call argument of type `<type of Cpp.Function>` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: Cpp.TakesFunction(Cpp.Function);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+2]]:21-32: error: call argument of type `<type of Cpp.Function>` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesFunction(Cpp.Function);
|
||||
|
||||
var n: array(i32, 42);
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+8]]:26: error: no matching function for call to 'TakesFunction' [CppInteropParseError]
|
||||
// CHECK:STDERR: 25 | Cpp.TakesFunction(&n[0]);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./params.h:3:6: note: candidate function not viable: no known conversion from 'int * _Nonnull' to 'int (*)(int)' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | void TakesFunction(int f(int));
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+5]]:3-19: error: no matching function for call to 'TakesFunction' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_todo_call_params_2.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./params.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./params.h:3:20-29: note: no known conversion from 'int * _Nonnull' to 'int (*)(int)' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesFunction(&n[0]);
|
||||
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+11]]:21: error: cannot implicitly convert expression of type `Cpp.nullptr_t` to `<C++ type int (*)(int)>` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.TakesFunction(Cpp.nullptr);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+8]]:21: note: type `Cpp.nullptr_t` does not implement interface `Core.ImplicitAs(<C++ type int (*)(int)>)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.TakesFunction(Cpp.nullptr);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE-29]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+5]]:21-31: error: cannot implicitly convert expression of type `Cpp.nullptr_t` to `<C++ type int (*)(int)>` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+4]]:21-31: note: type `Cpp.nullptr_t` does not implement interface `Core.ImplicitAs(<C++ type int (*)(int)>)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_call_params_2.carbon:[[@LINE-20]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./params.h:3:24: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: void TakesFunction(int f(int));
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesFunction(Cpp.nullptr);
|
||||
//@dump-sem-ir-end
|
||||
@@ -737,15 +726,15 @@ fn F() {
|
||||
// CHECK:STDOUT: %TakesFunction: %TakesFunction.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.0c5: %pattern_type.d94 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.749: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt.0c5 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.421: %pattern_type.9c3 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.1f9: %pattern_type.9c3 = wrapper_binding_pattern self, %self.param_patt.421 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_41: Core.IntLiteral = int_value 41 [concrete]
|
||||
// CHECK:STDOUT: %int_40: Core.IntLiteral = int_value 40 [concrete]
|
||||
@@ -787,9 +776,9 @@ fn F() {
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc14_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -816,28 +805,28 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.d94 = ref_param_pattern [concrete = constants.%self.param_patt.0c5]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.749]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.d94 = ref_param_pattern [concrete = constants.%self.param_patt.0c5]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.749]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.9c3 = ref_param_pattern [concrete = constants.%self.param_patt.421]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.9c3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1f9]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Array.3b5 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %Array.3b5 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc16_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc14_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.9c3 = ref_param_pattern [concrete = constants.%self.param_patt.421]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.9c3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1f9]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -848,20 +837,20 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc14: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc12: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Function.ref: %Function.cpp_overload_set.type = name_ref Function, imports.%Function.cpp_overload_set.value [concrete = constants.%Function.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %n.var: ref %Array.3b5 = var_storage %n.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value constants.%Array.3b5, (constants.%DefaultOrUnformed.impl_witness.4bc) [concrete = constants.%DefaultOrUnformed.facet]
|
||||
// CHECK:STDOUT: %.loc16_24.1: %DefaultOrUnformed.type = converted constants.%Array.3b5, %DefaultOrUnformed.facet [concrete = constants.%DefaultOrUnformed.facet]
|
||||
// CHECK:STDOUT: %as_type: type = facet_access_type %.loc16_24.1 [concrete = constants.%Array.3b5]
|
||||
// CHECK:STDOUT: %.loc16_24.2: type = converted %.loc16_24.1, %as_type [concrete = constants.%Array.3b5]
|
||||
// CHECK:STDOUT: %.loc14_24.1: %DefaultOrUnformed.type = converted constants.%Array.3b5, %DefaultOrUnformed.facet [concrete = constants.%DefaultOrUnformed.facet]
|
||||
// CHECK:STDOUT: %as_type: type = facet_access_type %.loc14_24.1 [concrete = constants.%Array.3b5]
|
||||
// CHECK:STDOUT: %.loc14_24.2: type = converted %.loc14_24.1, %as_type [concrete = constants.%Array.3b5]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc16_3: ref %Array.3b5 = splice_block %n.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call: init %Array.3b5 to %.loc16_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn()
|
||||
// CHECK:STDOUT: %.loc14_3: ref %Array.3b5 = splice_block %n.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call: init %Array.3b5 to %.loc14_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn()
|
||||
// CHECK:STDOUT: assign %n.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call
|
||||
// CHECK:STDOUT: %.loc16_23: type = splice_block %Array [concrete = constants.%Array.3b5] {
|
||||
// CHECK:STDOUT: %.loc14_23: type = splice_block %Array [concrete = constants.%Array.3b5] {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42]
|
||||
// CHECK:STDOUT: %Array: type = class_type @Array, @Array(constants.%i32, constants.%int_42) [concrete = constants.%Array.3b5]
|
||||
@@ -871,218 +860,218 @@ fn F() {
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.9c3 = ref_binding_pattern n [concrete = constants.%n.patt.368]
|
||||
// CHECK:STDOUT: %n.var_patt: %pattern_type.9c3 = var_pattern %n.patt [concrete = constants.%n.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc25: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc20: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %n.ref: ref %Array.3b5 = name_ref n, %n
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %impl.elem0: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc25_24.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc20_24.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc25_24.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc25_24.2(%int_0) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc25_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc25_24.2: %i32 = converted %int_0, %.loc25_24.1 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc25_25: ref %i32 = array_index %n.ref, %.loc25_24.2
|
||||
// CHECK:STDOUT: %addr: %ptr.a17 = addr_of %.loc25_25
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc38: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %bound_method.loc20_24.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc20_24.2(%int_0) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_24.2: %i32 = converted %int_0, %.loc20_24.1 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_25: ref %i32 = array_index %n.ref, %.loc20_24.2
|
||||
// CHECK:STDOUT: %addr: %ptr.a17 = addr_of %.loc20_25
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc27: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %nullptr.ref: %Cpp.nullptr_t = name_ref nullptr, %uninit [concrete = constants.%uninit]
|
||||
// CHECK:STDOUT: %.loc38: %.659 = converted %nullptr.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc27: %.659 = converted %nullptr.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %TakesFunction.call: init %empty_tuple.type = call imports.%TakesFunction.decl(<error>)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%n.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.1(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.1(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.1(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.1(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.1(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.1(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.2(%self.param: ref %Array.3b5) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.2(%self.param: ref %Array.3b5) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_41: Core.IntLiteral = int_value 41 [concrete = constants.%int_41]
|
||||
// CHECK:STDOUT: %.loc16_3.1: ref %i32 = array_index %self.param, %int_41
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.1: <bound method> = bound_method %.loc16_3.1, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.1(%.loc16_3.1)
|
||||
// CHECK:STDOUT: %.loc14_3.1: ref %i32 = array_index %self.param, %int_41
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.1: <bound method> = bound_method %.loc14_3.1, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.1(%.loc14_3.1)
|
||||
// CHECK:STDOUT: %int_40: Core.IntLiteral = int_value 40 [concrete = constants.%int_40]
|
||||
// CHECK:STDOUT: %.loc16_3.2: ref %i32 = array_index %self.param, %int_40
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.2: <bound method> = bound_method %.loc16_3.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.2(%.loc16_3.2)
|
||||
// CHECK:STDOUT: %.loc14_3.2: ref %i32 = array_index %self.param, %int_40
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.2: <bound method> = bound_method %.loc14_3.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.2(%.loc14_3.2)
|
||||
// CHECK:STDOUT: %int_39: Core.IntLiteral = int_value 39 [concrete = constants.%int_39]
|
||||
// CHECK:STDOUT: %.loc16_3.3: ref %i32 = array_index %self.param, %int_39
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.3: <bound method> = bound_method %.loc16_3.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.3(%.loc16_3.3)
|
||||
// CHECK:STDOUT: %.loc14_3.3: ref %i32 = array_index %self.param, %int_39
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.3: <bound method> = bound_method %.loc14_3.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.3(%.loc14_3.3)
|
||||
// CHECK:STDOUT: %int_38: Core.IntLiteral = int_value 38 [concrete = constants.%int_38]
|
||||
// CHECK:STDOUT: %.loc16_3.4: ref %i32 = array_index %self.param, %int_38
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.4: <bound method> = bound_method %.loc16_3.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.4(%.loc16_3.4)
|
||||
// CHECK:STDOUT: %.loc14_3.4: ref %i32 = array_index %self.param, %int_38
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.4: <bound method> = bound_method %.loc14_3.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.4(%.loc14_3.4)
|
||||
// CHECK:STDOUT: %int_37: Core.IntLiteral = int_value 37 [concrete = constants.%int_37]
|
||||
// CHECK:STDOUT: %.loc16_3.5: ref %i32 = array_index %self.param, %int_37
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.5: <bound method> = bound_method %.loc16_3.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.5: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.5(%.loc16_3.5)
|
||||
// CHECK:STDOUT: %.loc14_3.5: ref %i32 = array_index %self.param, %int_37
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.5: <bound method> = bound_method %.loc14_3.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.5: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.5(%.loc14_3.5)
|
||||
// CHECK:STDOUT: %int_36: Core.IntLiteral = int_value 36 [concrete = constants.%int_36]
|
||||
// CHECK:STDOUT: %.loc16_3.6: ref %i32 = array_index %self.param, %int_36
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.6: <bound method> = bound_method %.loc16_3.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.6: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.6(%.loc16_3.6)
|
||||
// CHECK:STDOUT: %.loc14_3.6: ref %i32 = array_index %self.param, %int_36
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.6: <bound method> = bound_method %.loc14_3.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.6: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.6(%.loc14_3.6)
|
||||
// CHECK:STDOUT: %int_35: Core.IntLiteral = int_value 35 [concrete = constants.%int_35]
|
||||
// CHECK:STDOUT: %.loc16_3.7: ref %i32 = array_index %self.param, %int_35
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.7: <bound method> = bound_method %.loc16_3.7, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.7(%.loc16_3.7)
|
||||
// CHECK:STDOUT: %.loc14_3.7: ref %i32 = array_index %self.param, %int_35
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.7: <bound method> = bound_method %.loc14_3.7, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.7(%.loc14_3.7)
|
||||
// CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [concrete = constants.%int_34]
|
||||
// CHECK:STDOUT: %.loc16_3.8: ref %i32 = array_index %self.param, %int_34
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.8: <bound method> = bound_method %.loc16_3.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.8(%.loc16_3.8)
|
||||
// CHECK:STDOUT: %.loc14_3.8: ref %i32 = array_index %self.param, %int_34
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.8: <bound method> = bound_method %.loc14_3.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.8(%.loc14_3.8)
|
||||
// CHECK:STDOUT: %int_33: Core.IntLiteral = int_value 33 [concrete = constants.%int_33]
|
||||
// CHECK:STDOUT: %.loc16_3.9: ref %i32 = array_index %self.param, %int_33
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.9: <bound method> = bound_method %.loc16_3.9, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.9(%.loc16_3.9)
|
||||
// CHECK:STDOUT: %.loc14_3.9: ref %i32 = array_index %self.param, %int_33
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.9: <bound method> = bound_method %.loc14_3.9, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.9(%.loc14_3.9)
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %.loc16_3.10: ref %i32 = array_index %self.param, %int_32
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.10: <bound method> = bound_method %.loc16_3.10, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.10(%.loc16_3.10)
|
||||
// CHECK:STDOUT: %.loc14_3.10: ref %i32 = array_index %self.param, %int_32
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.10: <bound method> = bound_method %.loc14_3.10, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.10(%.loc14_3.10)
|
||||
// CHECK:STDOUT: %int_31: Core.IntLiteral = int_value 31 [concrete = constants.%int_31]
|
||||
// CHECK:STDOUT: %.loc16_3.11: ref %i32 = array_index %self.param, %int_31
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.11: <bound method> = bound_method %.loc16_3.11, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.11(%.loc16_3.11)
|
||||
// CHECK:STDOUT: %.loc14_3.11: ref %i32 = array_index %self.param, %int_31
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.11: <bound method> = bound_method %.loc14_3.11, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.11(%.loc14_3.11)
|
||||
// CHECK:STDOUT: %int_30: Core.IntLiteral = int_value 30 [concrete = constants.%int_30]
|
||||
// CHECK:STDOUT: %.loc16_3.12: ref %i32 = array_index %self.param, %int_30
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.12: <bound method> = bound_method %.loc16_3.12, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.12(%.loc16_3.12)
|
||||
// CHECK:STDOUT: %.loc14_3.12: ref %i32 = array_index %self.param, %int_30
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.12: <bound method> = bound_method %.loc14_3.12, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.12(%.loc14_3.12)
|
||||
// CHECK:STDOUT: %int_29: Core.IntLiteral = int_value 29 [concrete = constants.%int_29]
|
||||
// CHECK:STDOUT: %.loc16_3.13: ref %i32 = array_index %self.param, %int_29
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.13: <bound method> = bound_method %.loc16_3.13, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.13(%.loc16_3.13)
|
||||
// CHECK:STDOUT: %.loc14_3.13: ref %i32 = array_index %self.param, %int_29
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.13: <bound method> = bound_method %.loc14_3.13, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.13(%.loc14_3.13)
|
||||
// CHECK:STDOUT: %int_28: Core.IntLiteral = int_value 28 [concrete = constants.%int_28]
|
||||
// CHECK:STDOUT: %.loc16_3.14: ref %i32 = array_index %self.param, %int_28
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.14: <bound method> = bound_method %.loc16_3.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.14: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.14(%.loc16_3.14)
|
||||
// CHECK:STDOUT: %.loc14_3.14: ref %i32 = array_index %self.param, %int_28
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.14: <bound method> = bound_method %.loc14_3.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.14: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.14(%.loc14_3.14)
|
||||
// CHECK:STDOUT: %int_27: Core.IntLiteral = int_value 27 [concrete = constants.%int_27]
|
||||
// CHECK:STDOUT: %.loc16_3.15: ref %i32 = array_index %self.param, %int_27
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.15: <bound method> = bound_method %.loc16_3.15, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.15(%.loc16_3.15)
|
||||
// CHECK:STDOUT: %.loc14_3.15: ref %i32 = array_index %self.param, %int_27
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.15: <bound method> = bound_method %.loc14_3.15, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.15(%.loc14_3.15)
|
||||
// CHECK:STDOUT: %int_26: Core.IntLiteral = int_value 26 [concrete = constants.%int_26]
|
||||
// CHECK:STDOUT: %.loc16_3.16: ref %i32 = array_index %self.param, %int_26
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.16: <bound method> = bound_method %.loc16_3.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.16(%.loc16_3.16)
|
||||
// CHECK:STDOUT: %.loc14_3.16: ref %i32 = array_index %self.param, %int_26
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.16: <bound method> = bound_method %.loc14_3.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.16(%.loc14_3.16)
|
||||
// CHECK:STDOUT: %int_25: Core.IntLiteral = int_value 25 [concrete = constants.%int_25]
|
||||
// CHECK:STDOUT: %.loc16_3.17: ref %i32 = array_index %self.param, %int_25
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.17: <bound method> = bound_method %.loc16_3.17, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.17(%.loc16_3.17)
|
||||
// CHECK:STDOUT: %.loc14_3.17: ref %i32 = array_index %self.param, %int_25
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.17: <bound method> = bound_method %.loc14_3.17, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.17(%.loc14_3.17)
|
||||
// CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [concrete = constants.%int_24]
|
||||
// CHECK:STDOUT: %.loc16_3.18: ref %i32 = array_index %self.param, %int_24
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.18: <bound method> = bound_method %.loc16_3.18, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.18(%.loc16_3.18)
|
||||
// CHECK:STDOUT: %.loc14_3.18: ref %i32 = array_index %self.param, %int_24
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.18: <bound method> = bound_method %.loc14_3.18, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.18(%.loc14_3.18)
|
||||
// CHECK:STDOUT: %int_23: Core.IntLiteral = int_value 23 [concrete = constants.%int_23]
|
||||
// CHECK:STDOUT: %.loc16_3.19: ref %i32 = array_index %self.param, %int_23
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.19: <bound method> = bound_method %.loc16_3.19, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.19(%.loc16_3.19)
|
||||
// CHECK:STDOUT: %.loc14_3.19: ref %i32 = array_index %self.param, %int_23
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.19: <bound method> = bound_method %.loc14_3.19, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.19(%.loc14_3.19)
|
||||
// CHECK:STDOUT: %int_22: Core.IntLiteral = int_value 22 [concrete = constants.%int_22]
|
||||
// CHECK:STDOUT: %.loc16_3.20: ref %i32 = array_index %self.param, %int_22
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.20: <bound method> = bound_method %.loc16_3.20, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.20(%.loc16_3.20)
|
||||
// CHECK:STDOUT: %.loc14_3.20: ref %i32 = array_index %self.param, %int_22
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.20: <bound method> = bound_method %.loc14_3.20, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.20(%.loc14_3.20)
|
||||
// CHECK:STDOUT: %int_21: Core.IntLiteral = int_value 21 [concrete = constants.%int_21]
|
||||
// CHECK:STDOUT: %.loc16_3.21: ref %i32 = array_index %self.param, %int_21
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.21: <bound method> = bound_method %.loc16_3.21, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.21(%.loc16_3.21)
|
||||
// CHECK:STDOUT: %.loc14_3.21: ref %i32 = array_index %self.param, %int_21
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.21: <bound method> = bound_method %.loc14_3.21, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.21(%.loc14_3.21)
|
||||
// CHECK:STDOUT: %int_20: Core.IntLiteral = int_value 20 [concrete = constants.%int_20]
|
||||
// CHECK:STDOUT: %.loc16_3.22: ref %i32 = array_index %self.param, %int_20
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.22: <bound method> = bound_method %.loc16_3.22, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.22(%.loc16_3.22)
|
||||
// CHECK:STDOUT: %.loc14_3.22: ref %i32 = array_index %self.param, %int_20
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.22: <bound method> = bound_method %.loc14_3.22, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.22(%.loc14_3.22)
|
||||
// CHECK:STDOUT: %int_19: Core.IntLiteral = int_value 19 [concrete = constants.%int_19]
|
||||
// CHECK:STDOUT: %.loc16_3.23: ref %i32 = array_index %self.param, %int_19
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.23: <bound method> = bound_method %.loc16_3.23, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.23(%.loc16_3.23)
|
||||
// CHECK:STDOUT: %.loc14_3.23: ref %i32 = array_index %self.param, %int_19
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.23: <bound method> = bound_method %.loc14_3.23, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.23(%.loc14_3.23)
|
||||
// CHECK:STDOUT: %int_18: Core.IntLiteral = int_value 18 [concrete = constants.%int_18]
|
||||
// CHECK:STDOUT: %.loc16_3.24: ref %i32 = array_index %self.param, %int_18
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.24: <bound method> = bound_method %.loc16_3.24, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.24(%.loc16_3.24)
|
||||
// CHECK:STDOUT: %.loc14_3.24: ref %i32 = array_index %self.param, %int_18
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.24: <bound method> = bound_method %.loc14_3.24, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.24(%.loc14_3.24)
|
||||
// CHECK:STDOUT: %int_17: Core.IntLiteral = int_value 17 [concrete = constants.%int_17]
|
||||
// CHECK:STDOUT: %.loc16_3.25: ref %i32 = array_index %self.param, %int_17
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.25: <bound method> = bound_method %.loc16_3.25, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.25(%.loc16_3.25)
|
||||
// CHECK:STDOUT: %.loc14_3.25: ref %i32 = array_index %self.param, %int_17
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.25: <bound method> = bound_method %.loc14_3.25, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.25(%.loc14_3.25)
|
||||
// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
|
||||
// CHECK:STDOUT: %.loc16_3.26: ref %i32 = array_index %self.param, %int_16
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.26: <bound method> = bound_method %.loc16_3.26, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.26(%.loc16_3.26)
|
||||
// CHECK:STDOUT: %.loc14_3.26: ref %i32 = array_index %self.param, %int_16
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.26: <bound method> = bound_method %.loc14_3.26, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.26(%.loc14_3.26)
|
||||
// CHECK:STDOUT: %int_15: Core.IntLiteral = int_value 15 [concrete = constants.%int_15]
|
||||
// CHECK:STDOUT: %.loc16_3.27: ref %i32 = array_index %self.param, %int_15
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.27: <bound method> = bound_method %.loc16_3.27, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.27(%.loc16_3.27)
|
||||
// CHECK:STDOUT: %.loc14_3.27: ref %i32 = array_index %self.param, %int_15
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.27: <bound method> = bound_method %.loc14_3.27, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.27(%.loc14_3.27)
|
||||
// CHECK:STDOUT: %int_14: Core.IntLiteral = int_value 14 [concrete = constants.%int_14]
|
||||
// CHECK:STDOUT: %.loc16_3.28: ref %i32 = array_index %self.param, %int_14
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.28: <bound method> = bound_method %.loc16_3.28, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.28: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.28(%.loc16_3.28)
|
||||
// CHECK:STDOUT: %.loc14_3.28: ref %i32 = array_index %self.param, %int_14
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.28: <bound method> = bound_method %.loc14_3.28, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.28: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.28(%.loc14_3.28)
|
||||
// CHECK:STDOUT: %int_13: Core.IntLiteral = int_value 13 [concrete = constants.%int_13]
|
||||
// CHECK:STDOUT: %.loc16_3.29: ref %i32 = array_index %self.param, %int_13
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.29: <bound method> = bound_method %.loc16_3.29, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.29: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.29(%.loc16_3.29)
|
||||
// CHECK:STDOUT: %.loc14_3.29: ref %i32 = array_index %self.param, %int_13
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.29: <bound method> = bound_method %.loc14_3.29, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.29: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.29(%.loc14_3.29)
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12]
|
||||
// CHECK:STDOUT: %.loc16_3.30: ref %i32 = array_index %self.param, %int_12
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.30: <bound method> = bound_method %.loc16_3.30, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.30(%.loc16_3.30)
|
||||
// CHECK:STDOUT: %.loc14_3.30: ref %i32 = array_index %self.param, %int_12
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.30: <bound method> = bound_method %.loc14_3.30, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.30(%.loc14_3.30)
|
||||
// CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [concrete = constants.%int_11]
|
||||
// CHECK:STDOUT: %.loc16_3.31: ref %i32 = array_index %self.param, %int_11
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.31: <bound method> = bound_method %.loc16_3.31, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.31: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.31(%.loc16_3.31)
|
||||
// CHECK:STDOUT: %.loc14_3.31: ref %i32 = array_index %self.param, %int_11
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.31: <bound method> = bound_method %.loc14_3.31, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.31: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.31(%.loc14_3.31)
|
||||
// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete = constants.%int_10]
|
||||
// CHECK:STDOUT: %.loc16_3.32: ref %i32 = array_index %self.param, %int_10
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.32: <bound method> = bound_method %.loc16_3.32, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.32(%.loc16_3.32)
|
||||
// CHECK:STDOUT: %.loc14_3.32: ref %i32 = array_index %self.param, %int_10
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.32: <bound method> = bound_method %.loc14_3.32, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.32(%.loc14_3.32)
|
||||
// CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9]
|
||||
// CHECK:STDOUT: %.loc16_3.33: ref %i32 = array_index %self.param, %int_9
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.33: <bound method> = bound_method %.loc16_3.33, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.33(%.loc16_3.33)
|
||||
// CHECK:STDOUT: %.loc14_3.33: ref %i32 = array_index %self.param, %int_9
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.33: <bound method> = bound_method %.loc14_3.33, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.33(%.loc14_3.33)
|
||||
// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8]
|
||||
// CHECK:STDOUT: %.loc16_3.34: ref %i32 = array_index %self.param, %int_8
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.34: <bound method> = bound_method %.loc16_3.34, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.34(%.loc16_3.34)
|
||||
// CHECK:STDOUT: %.loc14_3.34: ref %i32 = array_index %self.param, %int_8
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.34: <bound method> = bound_method %.loc14_3.34, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.34(%.loc14_3.34)
|
||||
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7]
|
||||
// CHECK:STDOUT: %.loc16_3.35: ref %i32 = array_index %self.param, %int_7
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.35: <bound method> = bound_method %.loc16_3.35, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.35: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.35(%.loc16_3.35)
|
||||
// CHECK:STDOUT: %.loc14_3.35: ref %i32 = array_index %self.param, %int_7
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.35: <bound method> = bound_method %.loc14_3.35, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.35: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.35(%.loc14_3.35)
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6]
|
||||
// CHECK:STDOUT: %.loc16_3.36: ref %i32 = array_index %self.param, %int_6
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.36: <bound method> = bound_method %.loc16_3.36, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.36(%.loc16_3.36)
|
||||
// CHECK:STDOUT: %.loc14_3.36: ref %i32 = array_index %self.param, %int_6
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.36: <bound method> = bound_method %.loc14_3.36, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.36(%.loc14_3.36)
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5]
|
||||
// CHECK:STDOUT: %.loc16_3.37: ref %i32 = array_index %self.param, %int_5
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.37: <bound method> = bound_method %.loc16_3.37, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.37: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.37(%.loc16_3.37)
|
||||
// CHECK:STDOUT: %.loc14_3.37: ref %i32 = array_index %self.param, %int_5
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.37: <bound method> = bound_method %.loc14_3.37, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.37: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.37(%.loc14_3.37)
|
||||
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4]
|
||||
// CHECK:STDOUT: %.loc16_3.38: ref %i32 = array_index %self.param, %int_4
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.38: <bound method> = bound_method %.loc16_3.38, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.38: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.38(%.loc16_3.38)
|
||||
// CHECK:STDOUT: %.loc14_3.38: ref %i32 = array_index %self.param, %int_4
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.38: <bound method> = bound_method %.loc14_3.38, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.38: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.38(%.loc14_3.38)
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc16_3.39: ref %i32 = array_index %self.param, %int_3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.39: <bound method> = bound_method %.loc16_3.39, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.39: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.39(%.loc16_3.39)
|
||||
// CHECK:STDOUT: %.loc14_3.39: ref %i32 = array_index %self.param, %int_3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.39: <bound method> = bound_method %.loc14_3.39, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.39: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.39(%.loc14_3.39)
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc16_3.40: ref %i32 = array_index %self.param, %int_2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.40: <bound method> = bound_method %.loc16_3.40, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.40: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.40(%.loc16_3.40)
|
||||
// CHECK:STDOUT: %.loc14_3.40: ref %i32 = array_index %self.param, %int_2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.40: <bound method> = bound_method %.loc14_3.40, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.40: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.40(%.loc14_3.40)
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc16_3.41: ref %i32 = array_index %self.param, %int_1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.41: <bound method> = bound_method %.loc16_3.41, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.41(%.loc16_3.41)
|
||||
// CHECK:STDOUT: %.loc14_3.41: ref %i32 = array_index %self.param, %int_1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.41: <bound method> = bound_method %.loc14_3.41, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.41(%.loc14_3.41)
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc16_3.42: ref %i32 = array_index %self.param, %int_0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.42: <bound method> = bound_method %.loc16_3.42, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.42: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.42(%.loc16_3.42)
|
||||
// CHECK:STDOUT: %.loc14_3.42: ref %i32 = array_index %self.param, %int_0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.42: <bound method> = bound_method %.loc14_3.42, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.42: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.42(%.loc14_3.42)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %Array.3b5) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %Array.3b5) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.2(%self.param: ref %Array.3b5) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.2(%self.param: ref %Array.3b5) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param)
|
||||
|
||||
@@ -63,73 +63,52 @@ import Cpp library "functions.h";
|
||||
|
||||
fn Call() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:23: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: 16 | Cpp.GlobalNoReturn(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable: requires at least 2 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto GlobalNoReturn(int a, int b, int c = 1, int d = 2) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-20: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:2:21-54: note: requires at least 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalNoReturn(1);
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:22: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: 26 | Cpp.GlobalNoReturn();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-17]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable: requires at least 2 arguments, but 0 were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto GlobalNoReturn(int a, int b, int c = 1, int d = 2) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-20: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:2:21-54: note: requires at least 2 arguments, but 0 were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalNoReturn();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:24: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: 36 | Cpp.GlobalReturnInt(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable: requires at least 2 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto GlobalReturnInt(int a, int b, int c = 1, int d = 2) -> int;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-19]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:3:22-55: note: requires at least 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalReturnInt(1);
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:23: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: 46 | Cpp.GlobalReturnInt();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-37]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable: requires at least 2 arguments, but 0 were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto GlobalReturnInt(int a, int b, int c = 1, int d = 2) -> int;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-26]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:3:22-55: note: requires at least 2 arguments, but 0 were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalReturnInt();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:19: error: no matching function for call to 'B' [CppInteropParseError]
|
||||
// CHECK:STDERR: 56 | ({} as Cpp.X).B();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-47]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:6:8: note: candidate function not viable: requires at least argument 'a', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | void B(int a, int b = 1);
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'B' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-33]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:6:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:6:10-25: note: requires at least argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
({} as Cpp.X).B();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:11: error: no matching function for call to 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: 66 | Cpp.X.C();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-57]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:7:15: note: candidate function not viable: requires at least argument 'a', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | static void C(int a, int b = 1);
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-9: error: no matching function for call to 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-40]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:7:15: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:7:17-32: note: requires at least argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.X.C();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:19: error: no matching function for call to 'D' [CppInteropParseError]
|
||||
// CHECK:STDERR: 76 | ({} as Cpp.X).D();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-67]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:8:8: note: candidate function not viable: requires at least non-object argument 'a', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 8 | void D(this X, int a, int b = 1);
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'D' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-47]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:8:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:8:10-33: note: requires at least non-object argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
({} as Cpp.X).D();
|
||||
//@dump-sem-ir-end
|
||||
@@ -937,9 +916,9 @@ fn Call() {
|
||||
// CHECK:STDOUT: %self.patt.3ab: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt.a14 [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc56 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc41 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc56 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc41 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.414, %Destroy.WithSelf.SelfDestruct.db3 [concrete]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete]
|
||||
@@ -970,7 +949,7 @@ fn Call() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc56 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc41 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.a14]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3ab]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -981,46 +960,46 @@ fn Call() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Call() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc16: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc16: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc26: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc36: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc36: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc36: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc46: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc46: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc56_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc56: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc56: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc56_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc56_5.3: init %X to %.loc56_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc56_7.1: init %X = converted %.loc56_5.1, %.loc56_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc56_7.2: ref %X = temporary %.loc56_5.2, %.loc56_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc13: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc20: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc27: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc34: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc34: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc41_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc41: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc41: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc41_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc41_5.3: init %X to %.loc41_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc41_7.1: init %X = converted %.loc41_5.1, %.loc41_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc41_7.2: ref %X = temporary %.loc41_5.2, %.loc41_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bound_method.loc56: <bound method> = bound_method %.loc56_7.2, %B.ref [concrete = constants.%bound_method.f8c]
|
||||
// CHECK:STDOUT: %bound_method.loc41: <bound method> = bound_method %.loc41_7.2, %B.ref [concrete = constants.%bound_method.f8c]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc56: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc66: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc66: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc41: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc48: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc48: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc76_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc76: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc76: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc76_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc76_5.3: init %X to %.loc76_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc76_7.1: init %X = converted %.loc76_5.1, %.loc76_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc76_7.2: ref %X = temporary %.loc76_5.2, %.loc76_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %.loc55_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc55: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc55: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc55_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc55_5.3: init %X to %.loc55_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc55_7.1: init %X = converted %.loc55_5.1, %.loc55_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc55_7.2: ref %X = temporary %.loc55_5.2, %.loc55_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bound_method.loc76: <bound method> = bound_method %.loc76_7.2, %D.ref [concrete = constants.%bound_method.9a8]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc76: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414)
|
||||
// CHECK:STDOUT: %bound_method.loc55: <bound method> = bound_method %.loc55_7.2, %D.ref [concrete = constants.%bound_method.9a8]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc55: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc56(%self.param: ref %X) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41(%self.param: ref %X) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc56(%self.param: ref %X) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc41(%self.param: ref %X) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call imports.%X.cpp_destructor.decl(%self.param)
|
||||
|
||||
@@ -37,9 +37,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "global.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_global_use_different_name.carbon:[[@LINE+4]]:3: error: member name `bar` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.bar();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_import_global_use_different_name.carbon:[[@LINE+2]]:3-9: error: member name `bar` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.bar();
|
||||
}
|
||||
@@ -59,9 +57,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "special_name.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_special_name_call_unescaped.carbon:[[@LINE+4]]:3: error: member name `base` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.base();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_special_name_call_unescaped.carbon:[[@LINE+2]]:3-10: error: member name `base` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.base();
|
||||
}
|
||||
@@ -85,13 +81,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "special_name.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE+8]]:15: error: no matching function for call to 'base' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.r#base(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./special_name.h:2:6: note: candidate function not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto base() -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE+5]]:3-12: error: no matching function for call to 'base' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./special_name.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./special_name.h:2:10-11: note: requires 0 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.r#base(1);
|
||||
}
|
||||
@@ -133,9 +126,7 @@ import Cpp library "variadic.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_variadic.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: Variadic function` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.variadic_foo(8);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_variadic.carbon:[[@LINE+2]]:3-21: error: semantics TODO: `Unsupported: Variadic function` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.variadic_foo(8);
|
||||
//@dump-sem-ir-end
|
||||
@@ -148,9 +139,7 @@ fn F() {
|
||||
// --- static.h
|
||||
|
||||
// TODO: Promote this warning to an error by default.
|
||||
// CHECK:STDERR: ./static.h:[[@LINE+3]]:13: warning: function 'static_foo' has internal linkage but is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | static auto static_foo() -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: ./static.h:[[@LINE+1]]:13: warning: function 'static_foo' has internal linkage but is not defined [CppInteropParseWarning]
|
||||
static auto static_foo() -> void;
|
||||
|
||||
// --- todo_fail_import_static.carbon
|
||||
@@ -161,9 +150,7 @@ import Cpp library "static.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: todo_fail_import_static.carbon:[[@LINE+4]]:18: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.static_foo();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: todo_fail_import_static.carbon:[[@LINE+2]]:18: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Cpp.static_foo();
|
||||
//@dump-sem-ir-end
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/function_ptr.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/function_ptr.carbon
|
||||
// CHECK:STDERR: error: calling function with incomplete return type 'Incomplete' [CppInteropParseError]
|
||||
|
||||
// --- simple_callback.h
|
||||
|
||||
@@ -147,24 +146,17 @@ fn F() {
|
||||
// --- fail_use_forward_decl.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: error: calling function with incomplete return type 'Incomplete' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_use_forward_decl.carbon:[[@LINE+2]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./forward_decl.h:2:7: note: forward declaration of 'Incomplete' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | class Incomplete;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "forward_decl.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+13]]:3: note: in thunk for C++ function pointer type used here [InCppFunctionPointerThunk]
|
||||
// CHECK:STDERR: Cpp.ReturnCallback()();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+7]]:3-24: note: in thunk for C++ function pointer type used here [InCppFunctionPointerThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+9]]:3: error: function returns incomplete type `Cpp.Incomplete` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: Cpp.ReturnCallback()();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+5]]:3-24: error: function returns incomplete type `Cpp.Incomplete` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: included from: fail_use_forward_decl.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./forward_decl.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
Cpp.ReturnCallback()();
|
||||
@@ -180,9 +172,7 @@ using MyCallbackType = void(*)(int);
|
||||
fn MyCallback(generic arg: i32);
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_convert_generic_arg.carbon:[[@LINE+4]]:43: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: var unused fn_ptr: Cpp.MyCallbackType = MyCallback;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_convert_generic_arg.carbon:[[@LINE+2]]:43-52: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
var unused fn_ptr: Cpp.MyCallbackType = MyCallback;
|
||||
}
|
||||
@@ -197,12 +187,8 @@ using MyCallbackType = void(*)(int);
|
||||
fn MyCallback(arg: i32) -> i32;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_convert_type_mismatch.carbon:[[@LINE+7]]:43: error: can't convert exported function pointer to `void (*)(int)` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: var unused fn_ptr: Cpp.MyCallbackType = MyCallback;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_convert_type_mismatch.carbon:[[@LINE-6]]:1: note: function exported with pointer type `int (*)(int)` [ExportedFromFunction]
|
||||
// CHECK:STDERR: fn MyCallback(arg: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_convert_type_mismatch.carbon:[[@LINE+3]]:43-52: error: can't convert exported function pointer to `void (*)(int)` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: fail_convert_type_mismatch.carbon:[[@LINE-4]]:1-31: note: function exported with pointer type `int (*)(int)` [ExportedFromFunction]
|
||||
// CHECK:STDERR:
|
||||
var unused fn_ptr: Cpp.MyCallbackType = MyCallback;
|
||||
}
|
||||
|
||||
@@ -37,9 +37,7 @@ fn MyF() {
|
||||
// --- without_definition.h
|
||||
|
||||
// TODO: Promote this warning to an error by default.
|
||||
// CHECK:STDERR: ./without_definition.h:[[@LINE+3]]:13: warning: inline function 'inline_without_def' is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | inline void inline_without_def();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: ./without_definition.h:[[@LINE+1]]:13: warning: inline function 'inline_without_def' is not defined [CppInteropParseWarning]
|
||||
inline void inline_without_def();
|
||||
|
||||
// --- todo_fail_import_without_definition.carbon
|
||||
@@ -50,9 +48,7 @@ import Cpp library "without_definition.h";
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: todo_fail_import_without_definition.carbon:[[@LINE+4]]:26: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.inline_without_def();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: todo_fail_import_without_definition.carbon:[[@LINE+2]]:26: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Cpp.inline_without_def();
|
||||
|
||||
@@ -135,12 +131,12 @@ fn MyF() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc12: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc12: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc15: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc15: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc10: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc10: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc13: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc13: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -75,22 +75,14 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "method_ptr.h";
|
||||
|
||||
fn F(c: Cpp.C) {
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+18]]:3: error: member name of type `<C++ type void (C::*)(void) const>` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase]
|
||||
// CHECK:STDERR: c.(Cpp.GetMethodPtr())(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+10]]:3-24: error: member name of type `<C++ type void (C::*)(void) const>` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+14]]:3: error: semantics TODO: `invoking a C++ member function pointer is unsupported` [SemanticsTodo]
|
||||
// CHECK:STDERR: c.(Cpp.GetMethodPtr())(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+8]]:3-28: error: semantics TODO: `invoking a C++ member function pointer is unsupported` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: error: called object type 'void (C::*)() const' is not a function or function pointer [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+9]]:3: note: in thunk for C++ function pointer type used here [InCppFunctionPointerThunk]
|
||||
// CHECK:STDERR: c.(Cpp.GetMethodPtr())(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+5]]:3-28: note: in thunk for C++ function pointer type used here [InCppFunctionPointerThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+5]]:3: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: c.(Cpp.GetMethodPtr())(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+3]]:3-28: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
c.(Cpp.GetMethodPtr())(42);
|
||||
@@ -104,12 +96,8 @@ import Cpp library "method_ptr.h";
|
||||
fn F(ref c: Cpp.C);
|
||||
|
||||
fn G() {
|
||||
// CHECK:STDERR: fail_pass_function_for_method.carbon:[[@LINE+7]]:39: error: can't convert exported function pointer to `void (C::*)(void) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: var unused ptr: Cpp.MethodPtrType = F;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_pass_function_for_method.carbon:[[@LINE-6]]:1: note: function exported with pointer type `void (*)(class C &)` [ExportedFromFunction]
|
||||
// CHECK:STDERR: fn F(ref c: Cpp.C);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_function_for_method.carbon:[[@LINE+3]]:39: error: can't convert exported function pointer to `void (C::*)(void) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: fail_pass_function_for_method.carbon:[[@LINE-4]]:1-19: note: function exported with pointer type `void (*)(class C &)` [ExportedFromFunction]
|
||||
// CHECK:STDERR:
|
||||
var unused ptr: Cpp.MethodPtrType = F;
|
||||
}
|
||||
@@ -124,12 +112,8 @@ class C {
|
||||
}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_wrong_parent_type.carbon:[[@LINE+7]]:39: error: can't convert exported member function pointer to `void (C::*)(void) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: var unused ptr: Cpp.MethodPtrType = C.Method;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_parent_type.carbon:[[@LINE-7]]:3: note: function exported with pointer type `void (Carbon::C::*)(void) const` [ExportedFromFunction]
|
||||
// CHECK:STDERR: fn Method(self);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_parent_type.carbon:[[@LINE+3]]:39-46: error: can't convert exported member function pointer to `void (C::*)(void) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: fail_wrong_parent_type.carbon:[[@LINE-5]]:3-18: note: function exported with pointer type `void (Carbon::C::*)(void) const` [ExportedFromFunction]
|
||||
// CHECK:STDERR:
|
||||
var unused ptr: Cpp.MethodPtrType = C.Method;
|
||||
}
|
||||
@@ -149,12 +133,8 @@ using MethodPtrType = void(Carbon::C::*)(float) const;
|
||||
|
||||
fn G() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:39: error: can't convert exported member function pointer to `void (Carbon::C::*)(float) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: var unused ptr: Cpp.MethodPtrType = C.Method;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-12]]:3: note: function exported with pointer type `void (Carbon::C::*)(int) const` [ExportedFromFunction]
|
||||
// CHECK:STDERR: fn Method(self, i: i32);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:39-46: error: can't convert exported member function pointer to `void (Carbon::C::*)(float) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-10]]:3-26: note: function exported with pointer type `void (Carbon::C::*)(int) const` [ExportedFromFunction]
|
||||
// CHECK:STDERR:
|
||||
var unused ptr: Cpp.MethodPtrType = C.Method;
|
||||
//@dump-sem-ir-end
|
||||
@@ -481,11 +461,11 @@ fn G() {
|
||||
// CHECK:STDOUT: %ptr.var_patt: %pattern_type.4b7 = var_pattern %ptr.patt [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.952: %pattern_type.4b7 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.a35: %pattern_type.4b7 = wrapper_binding_pattern self, %self.param_patt.952 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc18 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -497,14 +477,14 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.4b7 = ref_param_pattern [concrete = constants.%self.param_patt.952]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.4b7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a35]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %.659 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %.659 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc18 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.4b7 = ref_param_pattern [concrete = constants.%self.param_patt.952]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.4b7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a35]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -519,7 +499,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %Method.ref: %C.Method.type = name_ref Method, @C.%C.Method.decl [concrete = constants.%C.Method]
|
||||
// CHECK:STDOUT: assign %ptr.var, <error>
|
||||
// CHECK:STDOUT: %.loc22: type = splice_block %MethodPtrType.ref [concrete = constants.%.659] {
|
||||
// CHECK:STDOUT: %.loc18: type = splice_block %MethodPtrType.ref [concrete = constants.%.659] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %MethodPtrType.ref: type = name_ref MethodPtrType, constants.%.659 [concrete = constants.%.659]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -536,16 +516,16 @@ fn G() {
|
||||
// CHECK:STDOUT: fn @C.Method__carbon_thunk(%self.param: ref %C, %_.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc22_40.1: %C = acquire_value %self.param
|
||||
// CHECK:STDOUT: %.loc22_40.2: %i32 = acquire_value %_.param
|
||||
// CHECK:STDOUT: %.loc18_40.1: %C = acquire_value %self.param
|
||||
// CHECK:STDOUT: %.loc18_40.2: %i32 = acquire_value %_.param
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22(%self.param: ref %.659) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18(%self.param: ref %.659) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %.659) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18(%self.param: ref %.659) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %.659) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18(%self.param: ref %.659) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param)
|
||||
|
||||
+8
-14
@@ -22,20 +22,14 @@ void F2(X x);
|
||||
|
||||
fn Call() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+7]]:10: error: no matching function for call to 'F1' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.F1();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-9]]:6: note: candidate function not viable: requires single argument 'x', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | void F1(X x);
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-8: error: no matching function for call to 'F1' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-7]]:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-8]]:9-11: note: requires single argument 'x', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.F1();
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+7]]:10: error: no matching function for call to 'F2' [CppInteropParseError]
|
||||
// CHECK:STDERR: 27 | Cpp.F2();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-16]]:6: note: candidate function not viable: requires single argument 'x', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void F2(X x);
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-8: error: no matching function for call to 'F2' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-11]]:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-12]]:9-11: note: requires single argument 'x', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.F2();
|
||||
//@dump-sem-ir-end
|
||||
@@ -63,9 +57,9 @@ fn Call() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Call() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %F1.ref: %F1.cpp_overload_set.type = name_ref F1, imports.%F1.cpp_overload_set.value [concrete = constants.%F1.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %F2.ref: %F2.cpp_overload_set.type = name_ref F2, imports.%F2.cpp_overload_set.value [concrete = constants.%F2.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -140,13 +140,9 @@ import Cpp library "int_literal.h";
|
||||
fn F() {
|
||||
// TODO: get rid of the second error message here.
|
||||
// i128_max + 1
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+8]]:44: error: integer value 170141183460469231731687303715884105728 too large to fit in a signed C++ integer type; requires 129 bits, but max is 128 [IntTooLargeForCppType]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:44-82: error: integer value 170141183460469231731687303715884105728 too large to fit in a signed C++ integer type; requires 129 bits, but max is 128 [IntTooLargeForCppType]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:44: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+2]]:44-82: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR:
|
||||
let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
}
|
||||
@@ -178,13 +174,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "negative_literal_passed_to_unsigned.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+8]]:27: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: Cpp.neg_to_unsigned_foo(-1);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+4]]:27-28: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: included from: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./negative_literal_passed_to_unsigned.h:2:39: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto neg_to_unsigned_foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.neg_to_unsigned_foo(-1);
|
||||
}
|
||||
@@ -211,13 +203,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "floating_point_literal.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+8]]:25: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.float_literal_foo(1.8e+308);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+4]]:25-32: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_large_floating_point_literal.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./floating_point_literal.h:3:31: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto float_literal_foo(double a) -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.float_literal_foo(1.8e+308);
|
||||
}
|
||||
@@ -261,68 +249,38 @@ import Cpp library "struct_init.h";
|
||||
fn MakeThreeFields() -> {.a: i32, .b: i32, .c: i32};
|
||||
|
||||
fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: i32, .c: i32}) {
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-46: error: cannot implicitly convert expression of type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-46: note: type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3});
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-24]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-27: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-27: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-37]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-31: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-21]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-50]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-39: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-39: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-28]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(MakeThreeFields());
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.b = 1, .c = 2, .a = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.b = 1, .c = 2, .a = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-63]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-46: error: cannot implicitly convert expression of type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-46: note: type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-35]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.b = 1, .c = 2, .a = 3});
|
||||
}
|
||||
@@ -334,23 +292,17 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "struct_init.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+8]]:55: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3, .d = 4});
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_struct_init_field_mismatch.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./struct_init.h:10:22-34: note: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3, .d = 4});
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+8]]:47: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: 25 | Cpp.PassThreeFields({.a = 1, .x = 2, .c = 3});
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_struct_init_field_mismatch.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./struct_init.h:10:22-34: note: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.a = 1, .x = 2, .c = 3});
|
||||
}
|
||||
@@ -362,9 +314,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "struct_init.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_struct_init_unsupported_field_name.carbon:[[@LINE+4]]:23: error: field name `base` cannot be mapped into C++ [CppCallFieldNameNotSupported]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.base = 1});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_unsupported_field_name.carbon:[[@LINE+2]]:23-33: error: field name `base` cannot be mapped into C++ [CppCallFieldNameNotSupported]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.base = 1});
|
||||
}
|
||||
@@ -381,55 +331,31 @@ import Cpp library "struct_init.h";
|
||||
fn MakeEmpty() -> ();
|
||||
|
||||
fn Empty(value: (), ref reference: ()) {
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-21: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-21: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(());
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-24: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-24: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-40]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-28: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-28: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-24]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(MakeEmpty());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(MakeEmpty());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-53]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-30: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-30: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-31]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(MakeEmpty());
|
||||
}
|
||||
@@ -437,55 +363,31 @@ fn Empty(value: (), ref reference: ()) {
|
||||
fn MakeThreeFields() -> (i32, i32, i32);
|
||||
|
||||
fn ThreeFields(value: (i32, i32, i32), ref reference: (i32, i32, i32)) {
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields((1, 2, 3));
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields((1, 2, 3));
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-70]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-31: note: type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-42]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields((1, 2, 3));
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-83]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-27: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-27: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-49]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-96]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-31: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-56]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-109]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-39: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-39: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-63]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(MakeThreeFields());
|
||||
}
|
||||
@@ -508,29 +410,17 @@ import Cpp library "int_from_struct.h";
|
||||
fn F() {
|
||||
// C++ permits `{}` to be used to initialize an int, but Carbon does not.
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+11]]:15: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassInt({});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+8]]:15: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassInt({});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+5]]:15-16: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+4]]:15-16: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_from_struct.h:2:18: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassInt(int n) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassInt({});
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+11]]:15: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassInt(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+8]]:15: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassInt(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE-24]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+5]]:15-16: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+4]]:15-16: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_from_struct.h:2:18: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassInt(int n) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassInt(());
|
||||
}
|
||||
@@ -545,29 +435,17 @@ fn F() {
|
||||
// C++ overload resolution prefers to convert `{}` to `int` rather than to an
|
||||
// empty struct. So that's the overload we pick, even though we can't call it.
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassOverloaded({});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+8]]:22: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassOverloaded({});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE-12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+5]]:22-23: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+4]]:22-23: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct_overloaded.carbon:[[@LINE-8]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_from_struct.h:6:25: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassOverloaded(int n) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassOverloaded({});
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassOverloaded(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+8]]:22: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassOverloaded(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE-25]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+5]]:22-23: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+4]]:22-23: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct_overloaded.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_from_struct.h:6:25: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassOverloaded(int n) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassOverloaded(());
|
||||
}
|
||||
@@ -592,13 +470,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "nested_structs.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE+8]]:44: error: no matching function for call to 'TakeB' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.TakeB({.a = {.x = 1, .z = 2}, .n = 3});
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:6: note: candidate function not viable: cannot convert initializer list argument to 'B' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 11 | void TakeB(B);
|
||||
// CHECK:STDERR: | ^ ~
|
||||
// CHECK:STDERR: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE+5]]:3-11: error: no matching function for call to 'TakeB' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:12: note: cannot convert initializer list argument to 'B' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakeB({.a = {.x = 1, .z = 2}, .n = 3});
|
||||
}
|
||||
@@ -610,16 +485,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "nested_structs.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+11]]:13: error: cannot implicitly convert expression of type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` to `Cpp.B` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.TakeB({.a = {.x = 1, .y = 2}, .n = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+8]]:13: note: type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.B)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.TakeB({.a = {.x = 1, .y = 2}, .n = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+5]]:13-43: error: cannot implicitly convert expression of type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` to `Cpp.B` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+4]]:13-43: note: type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.B)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_pass_nested_structs.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:13: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: void TakeB(B);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakeB({.a = {.x = 1, .y = 2}, .n = 3});
|
||||
}
|
||||
@@ -653,16 +522,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "signedness_change.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.signedness_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+8]]:22: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.signedness_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+5]]:22-29: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+4]]:22-29: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_signedness_change_rejected.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./signedness_change.h:2:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto signedness_foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.signedness_foo(1 as i32);
|
||||
}
|
||||
@@ -678,16 +541,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "downsizing_rejected.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.downsizing_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+8]]:22: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.downsizing_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+5]]:22-29: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+4]]:22-29: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_import_downsizing_rejected.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./downsizing_rejected.h:2:27: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto downsizing_foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.downsizing_foo(1 as i32);
|
||||
}
|
||||
@@ -707,13 +564,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "no_viable_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+8]]:29: error: no matching function for call to 'no_viable_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.no_viable_foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:6: note: candidate function not viable: requires 2 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto no_viable_foo(short a, int b) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+5]]:3-19: error: no matching function for call to 'no_viable_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_no_viable_function.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:20-33: note: requires 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.no_viable_foo(1 as i64);
|
||||
}
|
||||
@@ -734,17 +588,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "ambiguous_overload.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+12]]:29: error: call to 'ambiguous_foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.ambiguous_foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+5]]:3-19: error: call to 'ambiguous_foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_ambiguous_overload.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./ambiguous_overload.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto ambiguous_foo(short a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./ambiguous_overload.h:3:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto ambiguous_foo(int a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.ambiguous_foo(1 as i64);
|
||||
}
|
||||
@@ -765,17 +612,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "deleted_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+12]]:27: error: call to deleted function 'deleted_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.deleted_foo(1 as i32);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+5]]:3-17: error: call to deleted function 'deleted_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_deleted_function.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted_function.h:3:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto deleted_foo(int a) -> void = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted_function.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto deleted_foo(short a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.deleted_foo(1 as i32);
|
||||
}
|
||||
@@ -793,12 +633,8 @@ interface I {}
|
||||
fn EchoValue[ValueT: I](unused generic value: ValueT) {}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE+7]]:3: error: cannot convert type `<type of Cpp.missing_impl_foo>` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EchoValue(Cpp.missing_impl_foo);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EchoValue[ValueT: I](unused generic value: ValueT) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE+3]]:3-33: error: cannot convert type `<type of Cpp.missing_impl_foo>` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE-4]]:1-55: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EchoValue(Cpp.missing_impl_foo);
|
||||
}
|
||||
+5
-15
@@ -26,9 +26,7 @@ import Cpp library "unsupported_primitive_type.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_primitive_type.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(11);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_primitive_type.carbon:[[@LINE+2]]:3-13: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(11);
|
||||
//@dump-sem-ir-end
|
||||
@@ -50,9 +48,7 @@ import Cpp library "unsupported_primitive_type_among_params.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_primitive_type_among_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(1, 20);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_primitive_type_among_params.carbon:[[@LINE+2]]:3-16: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1, 20);
|
||||
//@dump-sem-ir-end
|
||||
@@ -74,13 +70,9 @@ import Cpp library "int_param.h";
|
||||
|
||||
// This doesn't have a direct type mapping in `getIntTypeForBitwidth`.
|
||||
fn F(x: i512) {
|
||||
// CHECK:STDERR: fail_large_int.carbon:[[@LINE+8]]:11: error: call argument of type `i512` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: Cpp.foo(x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_large_int.carbon:[[@LINE+4]]:11: error: call argument of type `i512` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: min_prelude/parts/int.carbon:10:1: error: semantics TODO: `interop with non-identifier package name` [SemanticsTodo]
|
||||
// CHECK:STDERR: class Int(N: IntLiteral) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: min_prelude/parts/int.carbon:10:1-26: error: semantics TODO: `interop with non-identifier package name` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(x);
|
||||
}
|
||||
@@ -93,9 +85,7 @@ import Cpp library "int_param.h";
|
||||
|
||||
// This doesn't fit as an embedded `IntId` value.
|
||||
fn F(x: i8388608) {
|
||||
// CHECK:STDERR: fail_very_large_int.carbon:[[@LINE+4]]:11: error: call argument of type `i8388608` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: Cpp.foo(x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_very_large_int.carbon:[[@LINE+2]]:11: error: call argument of type `i8388608` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(x);
|
||||
}
|
||||
|
||||
@@ -43,13 +43,10 @@ fn G() -> const Cpp.NonNullableParamS;
|
||||
|
||||
fn F() {
|
||||
var s: const Cpp.NonNullableParamS = G();
|
||||
// CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE+8]]:32: error: no matching function for call to 'non_nullable_param_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 18 | Cpp.non_nullable_param_foo(&s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_nullable_pointer_param.h:4:6: note: candidate function not viable: 1st argument ('const NonNullableParamS * _Nonnull') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | auto non_nullable_param_foo(NonNullableParamS* _Nonnull) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE+5]]:3-28: error: no matching function for call to 'non_nullable_param_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./non_nullable_pointer_param.h:4:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./non_nullable_pointer_param.h:4:29-55: note: 1st argument ('const NonNullableParamS * _Nonnull') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.non_nullable_param_foo(&s);
|
||||
}
|
||||
@@ -417,12 +414,8 @@ import Cpp library "deduced_pointer_param.h";
|
||||
|
||||
fn F() {
|
||||
// This could return a null pointer, so should not be given the type `Cpp.DeducedPointerS*`.
|
||||
// CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+7]]:40: error: cannot implicitly convert expression of type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` to `Cpp.DeducedPointerS*` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused a: Cpp.DeducedPointerS* = Cpp.Indirect({} as Cpp.DeducedPointerS);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+4]]:40: note: type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(Cpp.DeducedPointerS*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused a: Cpp.DeducedPointerS* = Cpp.Indirect({} as Cpp.DeducedPointerS);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+3]]:40-78: error: cannot implicitly convert expression of type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` to `Cpp.DeducedPointerS*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+2]]:40-78: note: type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(Cpp.DeducedPointerS*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused a: Cpp.DeducedPointerS* = Cpp.Indirect({} as Cpp.DeducedPointerS);
|
||||
}
|
||||
|
||||
+154
-195
@@ -44,45 +44,33 @@ fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var v: Cpp.S;
|
||||
let s: Cpp.S = v;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 18 | Cpp.TakesLValue(s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(s);
|
||||
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:35: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | Cpp.TakesLValue(s as const Cpp.S);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(s as const Cpp.S);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | Cpp.TakesLValue(t);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-30]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'S &' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-22]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: no known conversion from 'T' to 'S &' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(t);
|
||||
|
||||
var u: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:35: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 50 | Cpp.TakesLValue(u as const Cpp.S);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-41]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-30]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(u as const Cpp.S);
|
||||
//@dump-sem-ir-end
|
||||
@@ -135,13 +123,10 @@ import Cpp library "param_rvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
let s: Cpp.S = {};
|
||||
// CHECK:STDERR: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 16 | Cpp.TakesRValue(s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(s);
|
||||
}
|
||||
@@ -155,34 +140,25 @@ import Cpp library "param_rvalue_ref.h";
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var s: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.TakesRValue(s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: expects an rvalue for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: expects an rvalue for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(s);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | Cpp.TakesRValue(t);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'S' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: no known conversion from 'T' to 'S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(t);
|
||||
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:47: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 38 | Cpp.TakesRValue(({} as Cpp.S) as const Cpp.S);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-29]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-21]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(({} as Cpp.S) as const Cpp.S);
|
||||
//@dump-sem-ir-end
|
||||
@@ -237,13 +213,10 @@ import Cpp library "param_const_lvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE+8]]:25: error: no matching function for call to 'TakesConstLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 16 | Cpp.TakesConstLValue(t);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_lvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesConstLValue(const S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_lvalue_ref.h:5:23-30: note: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesConstLValue(t);
|
||||
}
|
||||
@@ -296,24 +269,18 @@ import Cpp library "param_const_rvalue_ref.h";
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var s: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+8]]:25: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.TakesConstRValue(s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable: expects an rvalue for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesConstRValue(const S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:23-31: note: expects an rvalue for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesConstRValue(s);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+8]]:25: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | Cpp.TakesConstRValue(t);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesConstRValue(const S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:23-31: note: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesConstRValue(t);
|
||||
//@dump-sem-ir-end
|
||||
@@ -392,12 +359,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "return_const_lvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+7]]:29: error: cannot implicitly convert expression of type `const Cpp.S` to `Cpp.S` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused ref s: Cpp.S = Cpp.ReturnConstLValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+4]]:29: note: type `const Cpp.S` does not implement interface `Core.ImplicitAs(Cpp.S)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused ref s: Cpp.S = Cpp.ReturnConstLValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+3]]:29-51: error: cannot implicitly convert expression of type `const Cpp.S` to `Cpp.S` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+2]]:29-51: note: type `const Cpp.S` does not implement interface `Core.ImplicitAs(Cpp.S)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused ref s: Cpp.S = Cpp.ReturnConstLValue();
|
||||
}
|
||||
@@ -471,12 +434,8 @@ template<typename T> void TakeAnything_ExpectConstLRef_ByRef(T&&) {
|
||||
''';
|
||||
|
||||
fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE+7]]:42: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: Cpp.TakeAnything_ExpectConstLRef_ByRef(ref x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE-9]]:65: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: template<typename T> void TakeAnything_ExpectConstLRef_ByRef(T&&) {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE+3]]:42-46: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE-7]]:65: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakeAnything_ExpectConstLRef_ByRef(ref x);
|
||||
}
|
||||
@@ -613,17 +572,17 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete]
|
||||
// CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc41 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc41 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.0e6: %pattern_type.5f6 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc30 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc30 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -652,14 +611,14 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc41 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc32 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc30 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -698,28 +657,28 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = value_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc18: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc18: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc28: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc28: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc28: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc28: type = const_type %S.ref.loc28 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc28_21.1: %const = as_compatible %s.ref.loc28
|
||||
// CHECK:STDOUT: %.loc28_21.2: %const = converted %s.ref.loc28, %.loc28_21.1
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc15: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc15: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc22: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc22: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc22: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc22: type = const_type %S.ref.loc22 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc22_21.1: %const = as_compatible %s.ref.loc22
|
||||
// CHECK:STDOUT: %.loc22_21.2: %const = converted %s.ref.loc22, %.loc22_21.1
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc30: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc30_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc30 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc30: type = facet_access_type %.loc30_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc30_15.2: type = converted %.loc30_15.1, %as_type.loc30 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc24: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc24_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc24 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc24: type = facet_access_type %.loc24_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc24_15.2: type = converted %.loc24_15.1, %as_type.loc24 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc30_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc30: init %T.ed0 to %.loc30_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc30
|
||||
// CHECK:STDOUT: %.loc30_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc24_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc24: init %T.ed0 to %.loc24_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc24
|
||||
// CHECK:STDOUT: %.loc24_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -727,56 +686,56 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc39: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc39: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc30: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %u.var: ref %S = var_storage %u.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc41: %DefaultOrUnformed.type = facet_value constants.%S, (constants.%DefaultOrUnformed.impl_witness.e4a) [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %.loc41_15.1: %DefaultOrUnformed.type = converted constants.%S, %DefaultOrUnformed.facet.loc41 [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %as_type.loc41: type = facet_access_type %.loc41_15.1 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc41_15.2: type = converted %.loc41_15.1, %as_type.loc41 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc32: %DefaultOrUnformed.type = facet_value constants.%S, (constants.%DefaultOrUnformed.impl_witness.e4a) [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %.loc32_15.1: %DefaultOrUnformed.type = converted constants.%S, %DefaultOrUnformed.facet.loc32 [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %as_type.loc32: type = facet_access_type %.loc32_15.1 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc32_15.2: type = converted %.loc32_15.1, %as_type.loc32 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc41_3: ref %S = splice_block %u.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc41: init %S to %.loc41_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.3()
|
||||
// CHECK:STDOUT: assign %u.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc41
|
||||
// CHECK:STDOUT: %.loc41_13: type = splice_block %S.ref.loc41 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc41: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc41: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc32_3: ref %S = splice_block %u.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc32: init %S to %.loc32_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.3()
|
||||
// CHECK:STDOUT: assign %u.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc32
|
||||
// CHECK:STDOUT: %.loc32_13: type = splice_block %S.ref.loc32 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc32: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %u: ref %S = wrapper_binding u, %u.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %u.patt: %pattern_type.0f5 = ref_binding_pattern u [concrete = constants.%u.patt]
|
||||
// CHECK:STDOUT: %u.var_patt: %pattern_type.0f5 = var_pattern %u.patt [concrete = constants.%u.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc50_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc50: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc38: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %u.ref: ref %S = name_ref u, %u
|
||||
// CHECK:STDOUT: %Cpp.ref.loc50_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc50: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc50: type = const_type %S.ref.loc50 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc50_21.1: ref %const = as_compatible %u.ref
|
||||
// CHECK:STDOUT: %.loc50_21.2: ref %const = converted %u.ref, %.loc50_21.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc41: <bound method> = bound_method %u.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc41(%u.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc30: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc30(%t.var)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc38: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc38: type = const_type %S.ref.loc38 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc38_21.1: ref %const = as_compatible %u.ref
|
||||
// CHECK:STDOUT: %.loc38_21.2: ref %const = converted %u.ref, %.loc38_21.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc32: <bound method> = bound_method %u.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc32(%u.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%v.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41(%self.param: ref %S) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32(%self.param: ref %S) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc41(%self.param: ref %S) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32(%self.param: ref %S) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param)
|
||||
@@ -871,9 +830,9 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete]
|
||||
@@ -910,7 +869,7 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -946,20 +905,20 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = ref_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.0f5 = var_pattern %s.patt [concrete = constants.%s.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc17: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc14: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc19: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc19_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc19 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc19: type = facet_access_type %.loc19_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc19_15.2: type = converted %.loc19_15.1, %as_type.loc19 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc16: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc16_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc16 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc16: type = facet_access_type %.loc16_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc16_15.2: type = converted %.loc16_15.1, %as_type.loc16 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc19_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc19: init %T.ed0 to %.loc19_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc19
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc16_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16: init %T.ed0 to %.loc16_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16
|
||||
// CHECK:STDOUT: %.loc16_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -967,32 +926,32 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc28: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc22: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc38: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc38_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc38_29: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc38_21.2: ref %S = temporary_storage
|
||||
// CHECK:STDOUT: %.loc38_21.3: init %S to %.loc38_21.2 = class_init () [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc38_23: init %S = converted %.loc38_21.1, %.loc38_21.3 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc38_45: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const: type = const_type %S.ref.loc38_45 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc38_33.1: init %const = as_compatible %.loc38_23 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %.loc38_33.2: init %const = converted %.loc38_23, %.loc38_33.1 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%t.var)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc29: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc29_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc29_29: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc29_21.2: ref %S = temporary_storage
|
||||
// CHECK:STDOUT: %.loc29_21.3: init %S to %.loc29_21.2 = class_init () [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc29_23: init %S = converted %.loc29_21.1, %.loc29_21.3 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc29_45: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const: type = const_type %S.ref.loc29_45 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc29_33.1: init %const = as_compatible %.loc29_23 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %.loc29_33.2: init %const = converted %.loc29_23, %.loc29_33.1 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param)
|
||||
@@ -1323,9 +1282,9 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete]
|
||||
@@ -1362,7 +1321,7 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -1398,20 +1357,20 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = ref_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.0f5 = var_pattern %s.patt [concrete = constants.%s.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc17: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc14: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc19: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc19_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc19 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc19: type = facet_access_type %.loc19_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc19_15.2: type = converted %.loc19_15.1, %as_type.loc19 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc16: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc16_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc16 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc16: type = facet_access_type %.loc16_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc16_15.2: type = converted %.loc16_15.1, %as_type.loc16 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc19_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc19: init %T.ed0 to %.loc19_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc19
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc16_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16: init %T.ed0 to %.loc16_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16
|
||||
// CHECK:STDOUT: %.loc16_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -1419,19 +1378,19 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc28: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc22: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param)
|
||||
|
||||
@@ -48,9 +48,7 @@ auto UndeducedReturn();
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
// CHECK:STDERR: fail_return_undeduced_auto.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: return type: auto` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.UndeducedReturn();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_undeduced_auto.carbon:[[@LINE+2]]:3-23: error: semantics TODO: `Unsupported: return type: auto` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.UndeducedReturn();
|
||||
}
|
||||
|
||||
@@ -25,57 +25,29 @@ auto foo2(ForwardDeclaredStruct) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6: error: argument type 'ForwardDeclaredStruct' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo1(ForwardDeclaredStruct) -> void;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6-9: error: argument type 'ForwardDeclaredStruct' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:8: note: forward declaration of 'ForwardDeclaredStruct' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | struct ForwardDeclaredStruct;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_param_type.h";
|
||||
|
||||
fn F(p: Cpp.ForwardDeclaredStruct*) {
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo1(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:3-14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6: error: argument type 'ForwardDeclaredStruct' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 5 | auto foo2(ForwardDeclaredStruct) -> void;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6-9: error: argument type 'ForwardDeclaredStruct' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:8: note: forward declaration of 'ForwardDeclaredStruct' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | struct ForwardDeclaredStruct;
|
||||
// CHECK:STDERR: | ^
|
||||
Cpp.foo1(*p);
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+28]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo2(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3-14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:12: error: forming value of incomplete type `Cpp.ForwardDeclaredStruct` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo1(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-23]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-3]]:12-13: error: forming value of incomplete type `Cpp.ForwardDeclaredStruct` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct ForwardDeclaredStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:32: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo1(ForwardDeclaredStruct) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:12: error: forming value of incomplete type `Cpp.ForwardDeclaredStruct` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo2(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-35]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:12-13: error: forming value of incomplete type `Cpp.ForwardDeclaredStruct` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct ForwardDeclaredStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-39]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:32: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo2(ForwardDeclaredStruct) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo2(*p);
|
||||
}
|
||||
@@ -118,25 +90,15 @@ auto foo_non_copyable(NonCopyableStruct) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:6: error: call to deleted constructor of 'NonCopyableStruct' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_non_copyable(NonCopyableStruct) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:6-21: error: call to deleted constructor of 'NonCopyableStruct' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:3:3: note: 'NonCopyableStruct' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | NonCopyableStruct(const NonCopyableStruct&) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:40: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_non_copyable(NonCopyableStruct) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "non_copyable_param_type.h";
|
||||
|
||||
fn F(s: Cpp.NonCopyableStruct) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_non_copyable(s);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+2]]:3-25: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_non_copyable(s);
|
||||
//@dump-sem-ir-end
|
||||
@@ -321,13 +283,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:3: error: member access into incomplete class `Cpp.IncompleteStruct` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: Cpp.IncompleteStruct.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+4]]:3-26: error: member access into incomplete class `Cpp.IncompleteStruct` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct IncompleteStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.IncompleteStruct.foo();
|
||||
}
|
||||
@@ -391,36 +349,19 @@ auto foo_decl_value_return() -> DeclValueReturnStruct;
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: We should only produce one error here.
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnStruct' [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnStruct;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// 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 'DeclValueReturnStruct' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: note: 'foo_decl_value_return' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnStruct;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:8: note: forward declaration of 'DeclValueReturnStruct' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | struct DeclValueReturnStruct;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_return_type.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+16]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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+12]]:3: error: function returns incomplete type `Cpp.DeclValueReturnStruct` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+5]]:3-29: error: function returns incomplete type `Cpp.DeclValueReturnStruct` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct DeclValueReturnStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:33: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo_decl_value_return() -> DeclValueReturnStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_value_return();
|
||||
}
|
||||
@@ -559,7 +500,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%s.param: %NonCopyableStruct) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo_non_copyable.ref: %foo_non_copyable.cpp_overload_set.type = name_ref foo_non_copyable, imports.%foo_non_copyable.cpp_overload_set.value [concrete = constants.%foo_non_copyable.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref: %NonCopyableStruct = name_ref s, %s
|
||||
// CHECK:STDOUT: %foo_non_copyable.call: init %empty_tuple.type = call imports.%foo_non_copyable.decl(%s.ref)
|
||||
|
||||
@@ -87,12 +87,9 @@ template<int N> void fn_arg_not_template_arg_f();
|
||||
|
||||
fn Call() {
|
||||
// We treat this as a function argument, even though that makes the call fail.
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE+7]]:34: error: no matching function for call to 'fn_arg_not_template_arg_f' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.fn_arg_not_template_arg_f(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE-8]]:22: note: candidate function template not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | template<int N> void fn_arg_not_template_arg_f();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE+4]]:3-31: error: no matching function for call to 'fn_arg_not_template_arg_f' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE-6]]:22: note: candidate function template not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE-7]]:47-48: note: requires 0 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.fn_arg_not_template_arg_f(1);
|
||||
}
|
||||
|
||||
@@ -25,57 +25,29 @@ auto foo2(ForwardDeclaredUnion) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6: error: argument type 'ForwardDeclaredUnion' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo1(ForwardDeclaredUnion) -> void;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6-9: error: argument type 'ForwardDeclaredUnion' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: forward declaration of 'ForwardDeclaredUnion' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | union ForwardDeclaredUnion;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_param_type.h";
|
||||
|
||||
fn F(p: Cpp.ForwardDeclaredUnion*) {
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo1(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:3-14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6: error: argument type 'ForwardDeclaredUnion' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 5 | auto foo2(ForwardDeclaredUnion) -> void;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6-9: error: argument type 'ForwardDeclaredUnion' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: forward declaration of 'ForwardDeclaredUnion' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | union ForwardDeclaredUnion;
|
||||
// CHECK:STDERR: | ^
|
||||
Cpp.foo1(*p);
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+28]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo2(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3-14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:12: error: forming value of incomplete type `Cpp.ForwardDeclaredUnion` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo1(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-23]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-3]]:12-13: error: forming value of incomplete type `Cpp.ForwardDeclaredUnion` [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: union ForwardDeclaredUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:31: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo1(ForwardDeclaredUnion) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:12: error: forming value of incomplete type `Cpp.ForwardDeclaredUnion` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo2(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-35]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:12-13: error: forming value of incomplete type `Cpp.ForwardDeclaredUnion` [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: union ForwardDeclaredUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-39]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:31: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo2(ForwardDeclaredUnion) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo2(*p);
|
||||
}
|
||||
@@ -282,13 +254,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:3: error: member access into incomplete class `Cpp.IncompleteUnion` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: Cpp.IncompleteUnion.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+4]]:3-25: error: member access into incomplete class `Cpp.IncompleteUnion` [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: union IncompleteUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.IncompleteUnion.foo();
|
||||
}
|
||||
@@ -351,36 +319,19 @@ auto foo_decl_value_return() -> DeclValueReturnUnion;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnUnion' [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnUnion;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// 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 'DeclValueReturnUnion' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: note: 'foo_decl_value_return' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnUnion;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: forward declaration of 'DeclValueReturnUnion' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | union DeclValueReturnUnion;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_return_type.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+16]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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+12]]:3: error: function returns incomplete type `Cpp.DeclValueReturnUnion` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+5]]:3-29: error: function returns incomplete type `Cpp.DeclValueReturnUnion` [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: union DeclValueReturnUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:33: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo_decl_value_return() -> DeclValueReturnUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_value_return();
|
||||
}
|
||||
|
||||
+21
-25
@@ -112,12 +112,8 @@ import Cpp library "conversions.h";
|
||||
|
||||
fn ConstructorExplicit(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_conditionally_explicit_implicit.carbon:[[@LINE+7]]:42: error: cannot implicitly convert expression of type `Source` to `Cpp.ConditionallyExplicit` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.ConditionallyExplicitTrue = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_conditionally_explicit_implicit.carbon:[[@LINE+4]]:42: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.ConditionallyExplicit)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.ConditionallyExplicitTrue = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_conditionally_explicit_implicit.carbon:[[@LINE+3]]:42: error: cannot implicitly convert expression of type `Source` to `Cpp.ConditionallyExplicit` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_conditionally_explicit_implicit.carbon:[[@LINE+2]]:42: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.ConditionallyExplicit)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.ConditionallyExplicitTrue = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -631,9 +627,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) {
|
||||
// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc21 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc17 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -662,7 +658,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc21 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc17 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -674,9 +670,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) {
|
||||
// CHECK:STDOUT: fn @ConstructorExplicit(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc15_42: %ConditionallyExplicit.9d4 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %ConditionallyExplicitTrue.ref [concrete = constants.%ConditionallyExplicit.9d4] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc11_42: %ConditionallyExplicit.9d4 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %ConditionallyExplicitTrue.ref [concrete = constants.%ConditionallyExplicit.9d4] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ConditionallyExplicitTrue.ref: type = name_ref ConditionallyExplicitTrue, imports.%ConditionallyExplicit.decl.6ab [concrete = constants.%ConditionallyExplicit.9d4]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %ConditionallyExplicit.9d4 = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -689,30 +685,30 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) {
|
||||
// CHECK:STDOUT: fn @ConversionExplicit(%s.param: %ConditionallyExplicit.3cd) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %ConditionallyExplicit.3cd = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc21_21.1: ref %Dest.980 = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc21_21.1
|
||||
// CHECK:STDOUT: %.loc17_21.1: ref %Dest.980 = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc17_21.1
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr)
|
||||
// CHECK:STDOUT: %.loc21_21.2: init %Dest.980 to %.loc21_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc21_21.3: init %Dest.980 = converted %s.ref, %.loc21_21.2
|
||||
// CHECK:STDOUT: %.loc21_21.4: ref %Dest.980 = temporary %.loc21_21.1, %.loc21_21.3
|
||||
// CHECK:STDOUT: %.loc21_21.5: %Dest.980 = acquire_value %.loc21_21.4
|
||||
// CHECK:STDOUT: %.loc21_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc17_21.2: init %Dest.980 to %.loc17_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc17_21.3: init %Dest.980 = converted %s.ref, %.loc17_21.2
|
||||
// CHECK:STDOUT: %.loc17_21.4: ref %Dest.980 = temporary %.loc17_21.1, %.loc17_21.3
|
||||
// CHECK:STDOUT: %.loc17_21.5: %Dest.980 = acquire_value %.loc17_21.4
|
||||
// CHECK:STDOUT: %.loc17_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, %.loc21_21.5
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, %.loc17_21.5
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc21_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc21_21.4)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc17_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc17_21.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21(%self.param: ref %Dest.980) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17(%self.param: ref %Dest.980) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21(%self.param: ref %Dest.980) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17(%self.param: ref %Dest.980) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param)
|
||||
|
||||
+14
-42
@@ -83,87 +83,59 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "types.h";
|
||||
|
||||
fn CopyDeletedCopy(c: Cpp.DeletedCopy) -> Cpp.DeletedCopy {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+8]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | return c;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:14:3: note: 'DeletedCopy' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 14 | DeletedCopy(const DeletedCopy&) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyMoveOnly(c: Cpp.MoveOnly) -> Cpp.MoveOnly {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+8]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: 27 | return c;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE-18]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:19:3: note: copy constructor is implicitly deleted because 'MoveOnly' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: 19 | MoveOnly(MoveOnly&&);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyDeletedMove(c: Cpp.DeletedMove) -> Cpp.DeletedMove {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+8]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | return c;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE-30]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-20]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:24:3: note: copy constructor is implicitly deleted because 'DeletedMove' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: 24 | DeletedMove(DeletedMove&&) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyNonConstCopy(c: Cpp.NonConstCopy) -> Cpp.NonConstCopy {
|
||||
// TODO: List candidates here.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+7]]:10: error: cannot copy value of type `NonConstCopy` [CopyOfUncopyableType]
|
||||
// CHECK:STDERR: return c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: note: type `Cpp.NonConstCopy` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: cannot copy value of type `NonConstCopy` [CopyOfUncopyableType]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+2]]:10: note: type `Cpp.NonConstCopy` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyAmbiguousCopy(c: Cpp.AmbiguousCopy) -> Cpp.AmbiguousCopy {
|
||||
// TODO: List candidates here.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+7]]:10: error: cannot copy value of type `AmbiguousCopy` [CopyOfUncopyableType]
|
||||
// CHECK:STDERR: return c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: note: type `Cpp.AmbiguousCopy` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: cannot copy value of type `AmbiguousCopy` [CopyOfUncopyableType]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+2]]:10: note: type `Cpp.AmbiguousCopy` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyPrivateCopy(c: Cpp.PrivateCopy) -> Cpp.PrivateCopy {
|
||||
// TODO: Note is missing location.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+8]]:10: error: cannot access private member `PrivateCopy` of type `Cpp.PrivateCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: return c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE-67]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: cannot access private member `PrivateCopy` of type `Cpp.PrivateCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-45]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:40:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: PrivateCopy(const PrivateCopy&);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyProtectedCopy(c: Cpp.ProtectedCopy) -> Cpp.ProtectedCopy {
|
||||
// TODO: Note is missing location.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+8]]:10: error: cannot access protected member `ProtectedCopy` of type `Cpp.ProtectedCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: return c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE-80]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: cannot access protected member `ProtectedCopy` of type `Cpp.ProtectedCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-54]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:45:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ProtectedCopy(const ProtectedCopy&);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -149,27 +149,15 @@ namespace N {
|
||||
class MutableRange {
|
||||
struct Iterator {};
|
||||
public:
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+11]]:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: friend auto begin(MutableRange&) -> Iterator;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Begin(self) -> Iterator;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+5]]:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
friend auto begin(MutableRange&) -> Iterator;
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+10]]:32: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: friend auto end(MutableRange&) -> Iterator;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn End(self) -> Sentinel;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+4]]:32: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
friend auto end(MutableRange&) -> Iterator;
|
||||
};
|
||||
@@ -210,9 +198,7 @@ import Cpp inline '''c++
|
||||
namespace N {
|
||||
class MutableRangeWithSentinel {
|
||||
struct Iterator {
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+5]]:31: error: unknown type name 'ValueType' [CppInteropParseError]
|
||||
// CHECK:STDERR: 14 | auto operator*() const -> ValueType&;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+3]]:31: error: unknown type name 'ValueType' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
auto operator*() const -> ValueType&;
|
||||
@@ -224,27 +210,15 @@ class MutableRangeWithSentinel {
|
||||
friend auto operator!=(Sentinel, Iterator) -> bool;
|
||||
};
|
||||
public:
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+11]]:46: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: friend auto begin(MutableRangeWithSentinel&) -> Iterator;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Begin(self) -> Iterator;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+5]]:46: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
friend auto begin(MutableRangeWithSentinel&) -> Iterator;
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+10]]:44: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: friend auto end(MutableRangeWithSentinel&) -> Sentinel;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn End(self) -> Sentinel;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+4]]:44: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
friend auto end(MutableRangeWithSentinel&) -> Sentinel;
|
||||
};
|
||||
@@ -267,27 +241,15 @@ class MutableAndConstRange {
|
||||
struct Iterator {};
|
||||
struct ConstIterator {};
|
||||
public:
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+11]]:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: friend auto begin(MutableAndConstRange&) -> Iterator;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Begin(self) -> Iterator;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+5]]:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
friend auto begin(MutableAndConstRange&) -> Iterator;
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+10]]:40: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: friend auto end(MutableAndConstRange&) -> Iterator;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn End(self) -> Sentinel;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+4]]:40: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
friend auto end(MutableAndConstRange&) -> Iterator;
|
||||
|
||||
@@ -386,48 +348,24 @@ struct EndFunctionDeleted {
|
||||
''';
|
||||
|
||||
fn Test() {
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+10]]:47: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: 38 | Core.AssertIsNotRange(Cpp.BeginMethodDeleted);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-24]]:8: note: 'begin' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | auto begin() = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsNotRange(unused generic S: IsRange where .Result = false) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:47: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-22]]:8: note: 'begin' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36-67: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
Core.AssertIsNotRange(Cpp.BeginMethodDeleted);
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+10]]:45: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: 49 | Core.AssertIsNotRange(Cpp.EndMethodDeleted);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-29]]:8: note: 'end' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 13 | auto end() = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsNotRange(unused generic S: IsRange where .Result = false) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:45: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-21]]:8: note: 'end' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36-67: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
Core.AssertIsNotRange(Cpp.EndMethodDeleted);
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+10]]:49: error: call to deleted function 'begin' [CppInteropParseError]
|
||||
// CHECK:STDERR: 60 | Core.AssertIsNotRange(Cpp.BeginFunctionDeleted);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-36]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 17 | friend auto begin(const BeginFunctionDeleted&) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsNotRange(unused generic S: IsRange where .Result = false) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:49: error: call to deleted function 'begin' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-22]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36-67: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
Core.AssertIsNotRange(Cpp.BeginFunctionDeleted);
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+10]]:47: error: call to deleted function 'end' [CppInteropParseError]
|
||||
// CHECK:STDERR: 71 | Core.AssertIsNotRange(Cpp.EndFunctionDeleted);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-41]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 23 | friend auto end(const EndFunctionDeleted&) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn AssertIsNotRange(unused generic S: IsRange where .Result = false) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:47: error: call to deleted function 'end' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-21]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36-67: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
Core.AssertIsNotRange(Cpp.EndFunctionDeleted);
|
||||
}
|
||||
+84
-121
@@ -77,13 +77,9 @@ class Derived {
|
||||
|
||||
fn DestroyClassWithProtectedBaseDestructor() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE+8]]:3: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: var unused a: Derived = {.base = {}};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE+4]]:3-23: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:33:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ~ProtectedDestructor();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var unused a: Derived = {.base = {}};
|
||||
//@dump-sem-ir-end
|
||||
@@ -102,13 +98,9 @@ class Derived {
|
||||
fn DestroyClassWithPrivateBaseDestructor() {
|
||||
//@dump-sem-ir-begin
|
||||
// TODO: We should not allow this, as the destructor of the base class is private.
|
||||
// CHECK:STDERR: fail_destroy_private_base_destructor.carbon:[[@LINE+8]]:3: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: var unused a: Derived = {.base = {}};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_destroy_private_base_destructor.carbon:[[@LINE-12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_private_base_destructor.carbon:[[@LINE+4]]:3-23: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_destroy_private_base_destructor.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:28:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ~PrivateDestructor();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var unused a: Derived = {.base = {}};
|
||||
//@dump-sem-ir-end
|
||||
@@ -121,61 +113,36 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "types.h";
|
||||
|
||||
fn AmbiguousDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+20]]:17: error: binding pattern has incomplete type `AmbiguousDestructor` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: var unused a: Cpp.AmbiguousDestructor = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+7]]:17-39: error: binding pattern has incomplete type `AmbiguousDestructor` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: included from: fail_destroy_nondestroyable.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:13:7: note: destructor of class 'AmbiguousDestructorT<>' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: 13 | class AmbiguousDestructorT {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:13:7: note: in instantiation of template class 'AmbiguousDestructorT<>' requested here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 13 | class AmbiguousDestructorT {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:15:3: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 15 | ~AmbiguousDestructorT() requires (N != 1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-18]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:16:3: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 16 | ~AmbiguousDestructorT() requires (N != 2);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
var unused a: Cpp.AmbiguousDestructor = {};
|
||||
}
|
||||
|
||||
fn DeletedDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+8]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | var unused a: Cpp.DeletedDestructor = {};
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-30]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_destroy_nondestroyable.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:23:3: note: '~DeletedDestructor' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 23 | ~DeletedDestructor() = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
var unused a: Cpp.DeletedDestructor = {};
|
||||
}
|
||||
|
||||
fn PrivateDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+8]]:3: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: var unused a: Cpp.PrivateDestructor = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-42]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:3-37: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_destroy_nondestroyable.carbon:[[@LINE-23]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:28:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ~PrivateDestructor();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var unused a: Cpp.PrivateDestructor = {};
|
||||
}
|
||||
|
||||
fn ProtectedDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+8]]:3: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: var unused a: Cpp.ProtectedDestructor = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE-54]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:3-39: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_destroy_nondestroyable.carbon:[[@LINE-31]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:33:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ~ProtectedDestructor();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var unused a: Cpp.ProtectedDestructor = {};
|
||||
}
|
||||
@@ -213,13 +180,9 @@ class AdaptNoDestroy {
|
||||
fn Make() -> AdaptNoDestroy;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_no_destroy.carbon:[[@LINE+8]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | var _: AdaptNoDestroy = Make();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_no_destroy.carbon:[[@LINE-12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_no_destroy.carbon:[[@LINE+4]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_no_destroy.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:23:3: note: '~DeletedDestructor' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 23 | ~DeletedDestructor() = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
var _: AdaptNoDestroy = Make();
|
||||
}
|
||||
@@ -457,24 +420,24 @@ fn F() {
|
||||
// CHECK:STDOUT: %self.patt.26a: %pattern_type.b4a = wrapper_binding_pattern self, %self.param_patt.446 [concrete]
|
||||
// CHECK:STDOUT: %ProtectedDestructor.cpp_destructor.type: type = fn_type @ProtectedDestructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %ProtectedDestructor.cpp_destructor: %ProtectedDestructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.237: type = pattern_type %struct_type.base.454 [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.2b9: %pattern_type.237 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.caa: %pattern_type.237 = wrapper_binding_pattern self, %self.param_patt.2b9 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.a2b: %pattern_type.746 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.d8a: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt.a2b [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc16_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -487,35 +450,35 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.b4a = ref_param_pattern [concrete = constants.%self.param_patt.446]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.b4a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26a]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %ProtectedDestructor = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %ProtectedDestructor = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.237 = ref_param_pattern [concrete = constants.%self.param_patt.2b9]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.237 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.caa]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %struct_type.base.454 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %struct_type.base.454 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.237 = ref_param_pattern [concrete = constants.%self.param_patt.2b9]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.237 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.caa]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %struct_type.base.454 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %struct_type.base.454 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Derived = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %Derived = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc20_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc16_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -527,15 +490,15 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @DestroyClassWithProtectedBaseDestructor() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.var: ref %Derived = var_storage %a.var_patt
|
||||
// CHECK:STDOUT: %.loc20_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc20_38.1: %struct_type.base.f5e = struct_literal (%.loc20_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc20_38.2: ref %.a6c = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc20_37.2: init %.a6c to %.loc20_38.2 = class_init () [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc20_38.3: init %.a6c = converted %.loc20_37.1, %.loc20_37.2 [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc20_38.4: init %ProtectedDestructor = as_compatible %.loc20_38.3 [concrete = constants.%ProtectedDestructor.val]
|
||||
// CHECK:STDOUT: %.loc20_38.5: init %Derived to %a.var = class_init (%.loc20_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc20_3: init %Derived = converted %.loc20_38.1, %.loc20_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc20_3
|
||||
// CHECK:STDOUT: %.loc16_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc16_38.1: %struct_type.base.f5e = struct_literal (%.loc16_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc16_38.2: ref %.a6c = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc16_37.2: init %.a6c to %.loc16_38.2 = class_init () [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc16_38.3: init %.a6c = converted %.loc16_37.1, %.loc16_37.2 [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc16_38.4: init %ProtectedDestructor = as_compatible %.loc16_38.3 [concrete = constants.%ProtectedDestructor.val]
|
||||
// CHECK:STDOUT: %.loc16_38.5: init %Derived to %a.var = class_init (%.loc16_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc16_3: init %Derived = converted %.loc16_38.1, %.loc16_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc16_3
|
||||
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived]
|
||||
// CHECK:STDOUT: %a: ref %Derived = wrapper_binding a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -547,44 +510,44 @@ fn F() {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.1(%self.param: ref %ProtectedDestructor) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.1(%self.param: ref %ProtectedDestructor) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.1(%self.param: ref %ProtectedDestructor) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.1(%self.param: ref %ProtectedDestructor) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %ProtectedDestructor.cpp_destructor.call: init %empty_tuple.type = call imports.%ProtectedDestructor.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.1(%self.param: ref %struct_type.base.454) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.1(%self.param: ref %struct_type.base.454) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc20: ref %ProtectedDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc20, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc20)
|
||||
// CHECK:STDOUT: %.loc16: ref %ProtectedDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc16)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %struct_type.base.454) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %struct_type.base.454) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.2(%self.param: ref %struct_type.base.454) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.2(%self.param: ref %struct_type.base.454) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %base.ref: %Derived.elem = name_ref base, @Derived.%.loc7 [concrete = @Derived.%.loc7]
|
||||
// CHECK:STDOUT: %.loc20: ref %ProtectedDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc20, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc20)
|
||||
// CHECK:STDOUT: %.loc16: ref %ProtectedDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc16)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.3(%self.param: ref %Derived) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.3(%self.param: ref %Derived) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.3(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.3(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param)
|
||||
@@ -616,24 +579,24 @@ fn F() {
|
||||
// CHECK:STDOUT: %self.patt.7ec: %pattern_type.af2 = wrapper_binding_pattern self, %self.param_patt.bd1 [concrete]
|
||||
// CHECK:STDOUT: %PrivateDestructor.cpp_destructor.type: type = fn_type @PrivateDestructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %PrivateDestructor.cpp_destructor: %PrivateDestructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc21_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc17_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9c9: type = pattern_type %struct_type.base.9aa [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.a59: %pattern_type.9c9 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.078: %pattern_type.9c9 = wrapper_binding_pattern self, %self.param_patt.a59 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc21_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc17_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.a2b: %pattern_type.746 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.d8a: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt.a2b [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc21_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc17_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -646,35 +609,35 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc21_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc17_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.af2 = ref_param_pattern [concrete = constants.%self.param_patt.bd1]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.af2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ec]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %PrivateDestructor = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %PrivateDestructor = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.9c9 = ref_param_pattern [concrete = constants.%self.param_patt.a59]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.9c9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.078]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %struct_type.base.9aa = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %struct_type.base.9aa = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc21_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc17_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.9c9 = ref_param_pattern [concrete = constants.%self.param_patt.a59]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.9c9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.078]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %struct_type.base.9aa = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %struct_type.base.9aa = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Derived = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %Derived = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc21_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc17_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -686,15 +649,15 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @DestroyClassWithPrivateBaseDestructor() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.var: ref %Derived = var_storage %a.var_patt
|
||||
// CHECK:STDOUT: %.loc21_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc21_38.1: %struct_type.base.f5e = struct_literal (%.loc21_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc21_38.2: ref %.c73 = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc21_37.2: init %.c73 to %.loc21_38.2 = class_init () [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc21_38.3: init %.c73 = converted %.loc21_37.1, %.loc21_37.2 [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc21_38.4: init %PrivateDestructor = as_compatible %.loc21_38.3 [concrete = constants.%PrivateDestructor.val]
|
||||
// CHECK:STDOUT: %.loc21_38.5: init %Derived to %a.var = class_init (%.loc21_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc21_3: init %Derived = converted %.loc21_38.1, %.loc21_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc21_3
|
||||
// CHECK:STDOUT: %.loc17_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc17_38.1: %struct_type.base.f5e = struct_literal (%.loc17_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc17_38.2: ref %.c73 = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc17_37.2: init %.c73 to %.loc17_38.2 = class_init () [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc17_38.3: init %.c73 = converted %.loc17_37.1, %.loc17_37.2 [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc17_38.4: init %PrivateDestructor = as_compatible %.loc17_38.3 [concrete = constants.%PrivateDestructor.val]
|
||||
// CHECK:STDOUT: %.loc17_38.5: init %Derived to %a.var = class_init (%.loc17_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc17_3: init %Derived = converted %.loc17_38.1, %.loc17_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc17_3
|
||||
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived]
|
||||
// CHECK:STDOUT: %a: ref %Derived = wrapper_binding a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -706,44 +669,44 @@ fn F() {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.1(%self.param: ref %PrivateDestructor) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_3.1(%self.param: ref %PrivateDestructor) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.1(%self.param: ref %PrivateDestructor) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_3.1(%self.param: ref %PrivateDestructor) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %PrivateDestructor.cpp_destructor.call: init %empty_tuple.type = call imports.%PrivateDestructor.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21_3.1(%self.param: ref %struct_type.base.9aa) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_3.1(%self.param: ref %struct_type.base.9aa) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc21: ref %PrivateDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc21, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc21)
|
||||
// CHECK:STDOUT: %.loc17: ref %PrivateDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc17, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc17)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.2(%self.param: ref %struct_type.base.9aa) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_3.2(%self.param: ref %struct_type.base.9aa) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.2(%self.param: ref %struct_type.base.9aa) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_3.2(%self.param: ref %struct_type.base.9aa) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %base.ref: %Derived.elem = name_ref base, @Derived.%.loc7 [concrete = @Derived.%.loc7]
|
||||
// CHECK:STDOUT: %.loc21: ref %PrivateDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc21, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc21)
|
||||
// CHECK:STDOUT: %.loc17: ref %PrivateDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc17, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc17)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.3(%self.param: ref %Derived) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_3.3(%self.param: ref %Derived) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.3(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_3.3(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param)
|
||||
|
||||
+164
-234
@@ -92,12 +92,8 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn NonConstConversionTest(s: Cpp.NonConstConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_expr_category.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `NonConstConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:21: note: type `Cpp.NonConstConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_expr_category.carbon:[[@LINE+3]]:21: error: cannot implicitly convert expression of type `NonConstConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_expr_category.carbon:[[@LINE+2]]:21: note: type `Cpp.NonConstConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -111,13 +107,9 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn InaccessibleConstructorTest(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+8]]:40: error: cannot access private member `InaccessibleConstructor` of type `Cpp.InaccessibleConstructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.InaccessibleConstructor = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:40: error: cannot access private member `InaccessibleConstructor` of type `Cpp.InaccessibleConstructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_access.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:21:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: InaccessibleConstructor(Source);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.InaccessibleConstructor = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -125,13 +117,9 @@ fn InaccessibleConstructorTest(s: Cpp.Source) {
|
||||
|
||||
fn InaccessibleConversionTest(s: Cpp.InaccessibleConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+8]]:21: error: cannot access private member `<C++ operator>` of type `Cpp.InaccessibleConversion` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE-21]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:21: error: cannot access private member `<C++ operator>` of type `Cpp.InaccessibleConversion` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_access.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:26:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: operator Dest() const;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -145,12 +133,8 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn DeletedConstructorTest(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+7]]:35: error: cannot implicitly convert expression of type `Source` to `Cpp.DeletedConstructor` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.DeletedConstructor = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:35: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.DeletedConstructor)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.DeletedConstructor = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+3]]:35: error: cannot implicitly convert expression of type `Source` to `Cpp.DeletedConstructor` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+2]]:35: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.DeletedConstructor)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.DeletedConstructor = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -158,12 +142,8 @@ fn DeletedConstructorTest(s: Cpp.Source) {
|
||||
|
||||
fn DeletedConversionTest(s: Cpp.DeletedConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `DeletedConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:21: note: type `Cpp.DeletedConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+3]]:21: error: cannot implicitly convert expression of type `DeletedConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+2]]:21: note: type `Cpp.DeletedConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -177,12 +157,8 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn ExplicitConstructorTest(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+7]]:36: error: cannot implicitly convert expression of type `Source` to `Cpp.ExplicitConstructor` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.ExplicitConstructor = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+4]]:36: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.ExplicitConstructor)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.ExplicitConstructor = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+3]]:36: error: cannot implicitly convert expression of type `Source` to `Cpp.ExplicitConstructor` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+2]]:36: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.ExplicitConstructor)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.ExplicitConstructor = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -190,12 +166,8 @@ fn ExplicitConstructorTest(s: Cpp.Source) {
|
||||
|
||||
fn ExplicitConversionTest(s: Cpp.ExplicitConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `ExplicitConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+4]]:21: note: type `Cpp.ExplicitConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+3]]:21: error: cannot implicitly convert expression of type `ExplicitConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+2]]:21: note: type `Cpp.ExplicitConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -221,16 +193,10 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn IntConstructorTest(u: u32) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+11]]:31: error: cannot implicitly convert expression of type `u32` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.IntConstructor = u;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+8]]:31: note: type `u32` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.IntConstructor = u;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+5]]:31: error: cannot implicitly convert expression of type `u32` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+4]]:31: note: type `u32` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:38:21: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: IntConstructor(int);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.IntConstructor = u;
|
||||
//@dump-sem-ir-end
|
||||
@@ -300,28 +266,16 @@ import Cpp library "aggregate.h";
|
||||
|
||||
fn InitFromTuple() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `()` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = ();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+4]]:26: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = ();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+3]]:26-27: error: cannot implicitly convert expression of type `()` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+2]]:26-27: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = ();
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `(Core.IntLiteral,)` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = (1,);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+4]]:26: note: type `(Core.IntLiteral,)` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = (1,);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+3]]:26-29: error: cannot implicitly convert expression of type `(Core.IntLiteral,)` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+2]]:26-29: note: type `(Core.IntLiteral,)` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = (1,);
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral)` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = (1, 2);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+4]]:26: note: type `(Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = (1, 2);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+3]]:26-31: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral)` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+2]]:26-31: note: type `(Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = (1, 2);
|
||||
//@dump-sem-ir-end
|
||||
@@ -335,28 +289,16 @@ import Cpp library "aggregate.h";
|
||||
|
||||
fn InitFromStruct() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `{}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = {};
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+4]]:26: note: type `{}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = {};
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+3]]:26-27: error: cannot implicitly convert expression of type `{}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+2]]:26-27: note: type `{}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = {};
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = {.x = 1};
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+4]]:26: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = {.x = 1};
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+3]]:26-33: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+2]]:26-33: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = {.x = 1};
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = {.x = 1, .y = 2};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+4]]:26: note: type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = {.x = 1, .y = 2};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+3]]:26-41: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+2]]:26-41: note: type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = {.x = 1, .y = 2};
|
||||
//@dump-sem-ir-end
|
||||
@@ -384,28 +326,16 @@ import Cpp library "aggregate.h";
|
||||
|
||||
fn InitFromStruct() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+7]]:29: error: cannot implicitly convert expression of type `{}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.NonAggregate = {};
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+4]]:29: note: type `{}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.NonAggregate = {};
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+3]]:29-30: error: cannot implicitly convert expression of type `{}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+2]]:29-30: note: type `{}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.NonAggregate = {};
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+7]]:29: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.NonAggregate = {.x = 1};
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+4]]:29: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.NonAggregate = {.x = 1};
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+3]]:29-36: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+2]]:29-36: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.NonAggregate = {.x = 1};
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+7]]:29: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.NonAggregate = {.x = 1, .y = 2};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+4]]:29: note: type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let _: Cpp.NonAggregate = {.x = 1, .y = 2};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+3]]:29-44: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+2]]:29-44: note: type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.NonAggregate = {.x = 1, .y = 2};
|
||||
//@dump-sem-ir-end
|
||||
@@ -624,9 +554,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @NonConstConversionTest(%s.param: %NonConstConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %NonConstConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc15_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc11_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -653,9 +583,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %self.patt.2ae: %pattern_type.824 = wrapper_binding_pattern self, %self.param_patt.244 [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.type: type = fn_type @InaccessibleConstructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor: %InaccessibleConstructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %InaccessibleConversion: type = class_type @InaccessibleConversion [concrete]
|
||||
// CHECK:STDOUT: %Dest: type = class_type @Dest [concrete]
|
||||
@@ -668,9 +598,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc30 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc30 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -709,14 +639,14 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.824 = ref_param_pattern [concrete = constants.%self.param_patt.244]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.824 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2ae]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %InaccessibleConstructor = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %InaccessibleConstructor = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc30 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -728,32 +658,32 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @InaccessibleConstructorTest(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc16_40.1: ref %InaccessibleConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc16_40.2: ref %Source = value_as_ref %s.ref
|
||||
// CHECK:STDOUT: %addr.loc16_40.1: %ptr.5f6 = addr_of %.loc16_40.2
|
||||
// CHECK:STDOUT: %addr.loc16_40.2: %ptr.859 = addr_of %.loc16_40.1
|
||||
// CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InaccessibleConstructor__carbon_thunk.decl(%addr.loc16_40.1, %addr.loc16_40.2)
|
||||
// CHECK:STDOUT: %.loc16_40.3: init %InaccessibleConstructor to %.loc16_40.1 = mark_in_place_init %InaccessibleConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc16_40.4: init %InaccessibleConstructor = converted %s.ref, %.loc16_40.3
|
||||
// CHECK:STDOUT: %.loc16_40.5: ref %InaccessibleConstructor = temporary %.loc16_40.1, %.loc16_40.4
|
||||
// CHECK:STDOUT: %.loc16_40.6: %InaccessibleConstructor = acquire_value %.loc16_40.5
|
||||
// CHECK:STDOUT: %.loc16_13: type = splice_block %InaccessibleConstructor.ref [concrete = constants.%InaccessibleConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc12_40.1: ref %InaccessibleConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc12_40.2: ref %Source = value_as_ref %s.ref
|
||||
// CHECK:STDOUT: %addr.loc12_40.1: %ptr.5f6 = addr_of %.loc12_40.2
|
||||
// CHECK:STDOUT: %addr.loc12_40.2: %ptr.859 = addr_of %.loc12_40.1
|
||||
// CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InaccessibleConstructor__carbon_thunk.decl(%addr.loc12_40.1, %addr.loc12_40.2)
|
||||
// CHECK:STDOUT: %.loc12_40.3: init %InaccessibleConstructor to %.loc12_40.1 = mark_in_place_init %InaccessibleConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc12_40.4: init %InaccessibleConstructor = converted %s.ref, %.loc12_40.3
|
||||
// CHECK:STDOUT: %.loc12_40.5: ref %InaccessibleConstructor = temporary %.loc12_40.1, %.loc12_40.4
|
||||
// CHECK:STDOUT: %.loc12_40.6: %InaccessibleConstructor = acquire_value %.loc12_40.5
|
||||
// CHECK:STDOUT: %.loc12_13: type = splice_block %InaccessibleConstructor.ref [concrete = constants.%InaccessibleConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.ref: type = name_ref InaccessibleConstructor, imports.%InaccessibleConstructor.decl [concrete = constants.%InaccessibleConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %InaccessibleConstructor = wrapper_binding _, %.loc16_40.6
|
||||
// CHECK:STDOUT: %_: %InaccessibleConstructor = wrapper_binding _, %.loc12_40.6
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.824 = value_binding_pattern _ [concrete = constants.%_.patt.f1f]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc16_40.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc16_40.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc12_40.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc12_40.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %InaccessibleConstructor) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %InaccessibleConstructor) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %InaccessibleConstructor) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %InaccessibleConstructor) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%InaccessibleConstructor.cpp_destructor.decl(%self.param)
|
||||
@@ -763,30 +693,30 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @InaccessibleConversionTest(%s.param: %InaccessibleConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %InaccessibleConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc30_21.1: ref %Dest = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc30_21.1
|
||||
// CHECK:STDOUT: %.loc22_21.1: ref %Dest = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc22_21.1
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr)
|
||||
// CHECK:STDOUT: %.loc30_21.2: init %Dest to %.loc30_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc30_21.3: init %Dest = converted %s.ref, %.loc30_21.2
|
||||
// CHECK:STDOUT: %.loc30_21.4: ref %Dest = temporary %.loc30_21.1, %.loc30_21.3
|
||||
// CHECK:STDOUT: %.loc30_21.5: %Dest = acquire_value %.loc30_21.4
|
||||
// CHECK:STDOUT: %.loc30_13: type = splice_block %Dest.ref [concrete = constants.%Dest] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc22_21.2: init %Dest to %.loc22_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc22_21.3: init %Dest = converted %s.ref, %.loc22_21.2
|
||||
// CHECK:STDOUT: %.loc22_21.4: ref %Dest = temporary %.loc22_21.1, %.loc22_21.3
|
||||
// CHECK:STDOUT: %.loc22_21.5: %Dest = acquire_value %.loc22_21.4
|
||||
// CHECK:STDOUT: %.loc22_13: type = splice_block %Dest.ref [concrete = constants.%Dest] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest = wrapper_binding _, %.loc30_21.5
|
||||
// CHECK:STDOUT: %_: %Dest = wrapper_binding _, %.loc22_21.5
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc30_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc30_21.4)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc22_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc22_21.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30(%self.param: ref %Dest) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %Dest) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30(%self.param: ref %Dest) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %Dest) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param)
|
||||
@@ -824,9 +754,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @DeletedConstructorTest(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc15_35: %DeletedConstructor = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %DeletedConstructor.ref [concrete = constants.%DeletedConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc11_35: %DeletedConstructor = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %DeletedConstructor.ref [concrete = constants.%DeletedConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %DeletedConstructor.ref: type = name_ref DeletedConstructor, imports.%DeletedConstructor.decl [concrete = constants.%DeletedConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %DeletedConstructor = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -839,9 +769,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @DeletedConversionTest(%s.param: %DeletedConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %DeletedConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc28_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc28_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc20_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc20_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -882,9 +812,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @ExplicitConstructorTest(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc15_36: %ExplicitConstructor = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %ExplicitConstructor.ref [concrete = constants.%ExplicitConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc11_36: %ExplicitConstructor = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %ExplicitConstructor.ref [concrete = constants.%ExplicitConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ExplicitConstructor.ref: type = name_ref ExplicitConstructor, imports.%ExplicitConstructor.decl [concrete = constants.%ExplicitConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %ExplicitConstructor = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -897,9 +827,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @ExplicitConversionTest(%s.param: %ExplicitConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %ExplicitConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc28_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc28_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc20_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc20_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -1011,9 +941,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: %self.patt.f11: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt.ab8 [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.type: type = fn_type @IntConstructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor: %IntConstructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc13 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1036,7 +966,7 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc13 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.c4e = ref_param_pattern [concrete = constants.%self.param_patt.ab8]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f11]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -1048,31 +978,31 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @IntConstructorTest(%u.param: %u32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %u.ref: %u32 = name_ref u, %u
|
||||
// CHECK:STDOUT: %.loc19_31.1: ref %IntConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc19_31.2: %i32 = converted %u.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr: %ptr.100 = addr_of %.loc19_31.1
|
||||
// CHECK:STDOUT: %.loc13_31.1: ref %IntConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc13_31.2: %i32 = converted %u.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr: %ptr.100 = addr_of %.loc13_31.1
|
||||
// CHECK:STDOUT: %IntConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%IntConstructor__carbon_thunk.decl(<error>, %addr)
|
||||
// CHECK:STDOUT: %.loc19_31.3: init %IntConstructor to %.loc19_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc19_31.4: init %IntConstructor = converted %u.ref, %.loc19_31.3
|
||||
// CHECK:STDOUT: %.loc19_31.5: ref %IntConstructor = temporary %.loc19_31.1, %.loc19_31.4
|
||||
// CHECK:STDOUT: %.loc19_31.6: %IntConstructor = acquire_value %.loc19_31.5
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %IntConstructor.ref [concrete = constants.%IntConstructor] {
|
||||
// CHECK:STDOUT: %.loc13_31.3: init %IntConstructor to %.loc13_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc13_31.4: init %IntConstructor = converted %u.ref, %.loc13_31.3
|
||||
// CHECK:STDOUT: %.loc13_31.5: ref %IntConstructor = temporary %.loc13_31.1, %.loc13_31.4
|
||||
// CHECK:STDOUT: %.loc13_31.6: %IntConstructor = acquire_value %.loc13_31.5
|
||||
// CHECK:STDOUT: %.loc13_13: type = splice_block %IntConstructor.ref [concrete = constants.%IntConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %IntConstructor.ref: type = name_ref IntConstructor, imports.%IntConstructor.decl [concrete = constants.%IntConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %IntConstructor = wrapper_binding _, %.loc19_31.6
|
||||
// CHECK:STDOUT: %_: %IntConstructor = wrapper_binding _, %.loc13_31.6
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.c4e = value_binding_pattern _ [concrete = constants.%_.patt.151]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc19_31.5, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc19_31.5)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc13_31.5, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc13_31.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %IntConstructor) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13(%self.param: ref %IntConstructor) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %IntConstructor) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13(%self.param: ref %IntConstructor) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%IntConstructor.cpp_destructor.decl(%self.param)
|
||||
@@ -1444,8 +1374,19 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InitFromTuple() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc15_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc15_27.2: %Aggregate = converted %.loc15_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc11_27.2: %Aggregate = converted %.loc11_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %Aggregate.ref.loc11 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc11: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc11: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc11: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc15_29.1: %tuple.type.985 = tuple_literal (%int_1.loc15) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %.loc15_29.2: %Aggregate = converted %.loc15_29.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %Aggregate.ref.loc15 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc15: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
@@ -1454,28 +1395,17 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc15: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc23_29.1: %tuple.type.985 = tuple_literal (%int_1.loc23) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %.loc23_29.2: %Aggregate = converted %.loc23_29.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc23_13: type = splice_block %Aggregate.ref.loc23 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc23: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc23: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc23: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc31: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc31_31.1: %tuple.type.f94 = tuple_literal (%int_1.loc31, %int_2) [concrete = constants.%tuple.ad8]
|
||||
// CHECK:STDOUT: %.loc31_31.2: %Aggregate = converted %.loc31_31.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc31_13: type = splice_block %Aggregate.ref.loc31 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc31: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc31: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: %.loc19_31.1: %tuple.type.f94 = tuple_literal (%int_1.loc19, %int_2) [concrete = constants.%tuple.ad8]
|
||||
// CHECK:STDOUT: %.loc19_31.2: %Aggregate = converted %.loc19_31.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %Aggregate.ref.loc19 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc19: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc31: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc19: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc31: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: %_.patt.loc19: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1507,8 +1437,19 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InitFromStruct() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc15_27.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc15_27.2: %Aggregate = converted %.loc15_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_27.2: %Aggregate = converted %.loc11_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %Aggregate.ref.loc11 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc11: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc11: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc11: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc15_33.1: %struct_type.x = struct_literal (%int_1.loc15) [concrete = constants.%struct.147]
|
||||
// CHECK:STDOUT: %.loc15_33.2: %Aggregate = converted %.loc15_33.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %Aggregate.ref.loc15 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc15: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
@@ -1517,28 +1458,17 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc15: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc23_33.1: %struct_type.x = struct_literal (%int_1.loc23) [concrete = constants.%struct.147]
|
||||
// CHECK:STDOUT: %.loc23_33.2: %Aggregate = converted %.loc23_33.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc23_13: type = splice_block %Aggregate.ref.loc23 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc23: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc23: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc23: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc31: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc31_41.1: %struct_type.x.y = struct_literal (%int_1.loc31, %int_2) [concrete = constants.%struct.004]
|
||||
// CHECK:STDOUT: %.loc31_41.2: %Aggregate = converted %.loc31_41.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc31_13: type = splice_block %Aggregate.ref.loc31 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc31: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc31: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: %.loc19_41.1: %struct_type.x.y = struct_literal (%int_1.loc19, %int_2) [concrete = constants.%struct.004]
|
||||
// CHECK:STDOUT: %.loc19_41.2: %Aggregate = converted %.loc19_41.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %Aggregate.ref.loc19 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc19: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc31: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc19: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc31: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: %_.patt.loc19: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1754,8 +1684,19 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InitFromStruct() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc15_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc15_30.2: %NonAggregate = converted %.loc15_30.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_30.2: %NonAggregate = converted %.loc11_30.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %NonAggregate.ref.loc11 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc11: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc11: %NonAggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc11: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc15_36.1: %struct_type.x = struct_literal (%int_1.loc15) [concrete = constants.%struct.147]
|
||||
// CHECK:STDOUT: %.loc15_36.2: %NonAggregate = converted %.loc15_36.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %NonAggregate.ref.loc15 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc15: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
@@ -1764,28 +1705,17 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc15: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc23_36.1: %struct_type.x = struct_literal (%int_1.loc23) [concrete = constants.%struct.147]
|
||||
// CHECK:STDOUT: %.loc23_36.2: %NonAggregate = converted %.loc23_36.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc23_13: type = splice_block %NonAggregate.ref.loc23 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc23: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc23: %NonAggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc23: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc31: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc31_44.1: %struct_type.x.y = struct_literal (%int_1.loc31, %int_2) [concrete = constants.%struct.004]
|
||||
// CHECK:STDOUT: %.loc31_44.2: %NonAggregate = converted %.loc31_44.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc31_13: type = splice_block %NonAggregate.ref.loc31 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc31: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc31: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
// CHECK:STDOUT: %.loc19_44.1: %struct_type.x.y = struct_literal (%int_1.loc19, %int_2) [concrete = constants.%struct.004]
|
||||
// CHECK:STDOUT: %.loc19_44.2: %NonAggregate = converted %.loc19_44.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %NonAggregate.ref.loc19 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc19: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc31: %NonAggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc19: %NonAggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc31: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: %_.patt.loc19: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+4
-12
@@ -15,9 +15,7 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_macro_with_error.carbon:[[@LINE+4]]:1: error: unknown type name 'error' [CppInteropParseError]
|
||||
// CHECK:STDERR: 9 | error has_error;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_macro_with_error.carbon:[[@LINE+2]]:1: error: unknown type name 'error' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
error has_error;
|
||||
#define macro_with_error has_error.member
|
||||
@@ -25,16 +23,10 @@ error has_error;
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_macro_with_error.carbon:[[@LINE+11]]:3: error: failed to parse macro Cpp.macro_with_error to a valid constant expression [InCppMacroEvaluation]
|
||||
// CHECK:STDERR: Cpp.macro_with_error;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_macro_with_error.carbon:[[@LINE+8]]:3: note: in `Cpp` name lookup for `macro_with_error` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.macro_with_error;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_macro_with_error.carbon:[[@LINE+5]]:3-22: error: failed to parse macro Cpp.macro_with_error to a valid constant expression [InCppMacroEvaluation]
|
||||
// CHECK:STDERR: fail_macro_with_error.carbon:[[@LINE+4]]:3-22: note: in `Cpp` name lookup for `macro_with_error` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_macro_with_error.carbon:[[@LINE+4]]:3: error: member name `macro_with_error` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.macro_with_error;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_macro_with_error.carbon:[[@LINE+2]]:3-22: error: member name `macro_with_error` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.macro_with_error;
|
||||
//@dump-sem-ir-end
|
||||
|
||||
+57
-172
@@ -41,7 +41,7 @@ fn F() {
|
||||
}
|
||||
|
||||
// --- bad_suffix.h
|
||||
// CHECK:STDERR: ./bad_suffix.h:[[@LINE+1]]:24: in expansion of macro defined here [InCppMacroExpansion]
|
||||
// CHECK:STDERR: expanded from macro defined at: ./bad_suffix.h:[[@LINE+1]]:24 [InCppMacroExpansion]
|
||||
#define CONFIG_VALUE 42f
|
||||
|
||||
// --- fail_import_bad_suffix.carbon
|
||||
@@ -51,31 +51,19 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "bad_suffix.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+20]]:6: error: invalid digit 'f' in decimal constant [CppInteropParseError]
|
||||
// CHECK:STDERR: 27 | Cpp.CONFIG_VALUE;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: 2 | #define CONFIG_VALUE 42f
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+15]]:3: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.CONFIG_VALUE;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+8]]:6: error: invalid digit 'f' in decimal constant [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+7]]:3-18: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+11]]:3: error: failed to parse macro Cpp.CONFIG_VALUE to a valid constant expression [InCppMacroEvaluation]
|
||||
// CHECK:STDERR: Cpp.CONFIG_VALUE;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+8]]:3: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.CONFIG_VALUE;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+5]]:3-18: error: failed to parse macro Cpp.CONFIG_VALUE to a valid constant expression [InCppMacroEvaluation]
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+4]]:3-18: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+4]]:3: error: member name `CONFIG_VALUE` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.CONFIG_VALUE;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_bad_suffix.carbon:[[@LINE+2]]:3-18: error: member name `CONFIG_VALUE` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.CONFIG_VALUE;
|
||||
}
|
||||
|
||||
// --- integer_literal_too_big.h
|
||||
// CHECK:STDERR: ./integer_literal_too_big.h:[[@LINE+1]]:22: in expansion of macro defined here [InCppMacroExpansion]
|
||||
// CHECK:STDERR: expanded from macro defined at: ./integer_literal_too_big.h:[[@LINE+1]]:22 [InCppMacroExpansion]
|
||||
#define CONFIG_VALUE 18446744073709551616
|
||||
|
||||
// --- fail_import_integer_literal_too_big.carbon
|
||||
@@ -85,14 +73,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "integer_literal_too_big.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+9]]:6: error: integer literal is too large to be represented in any integer type [CppInteropParseError]
|
||||
// CHECK:STDERR: 16 | Cpp.CONFIG_VALUE;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: 2 | #define CONFIG_VALUE 18446744073709551616
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+4]]:3: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.CONFIG_VALUE;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+3]]:6: error: integer literal is too large to be represented in any integer type [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+2]]:3-18: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
Cpp.CONFIG_VALUE;
|
||||
}
|
||||
@@ -104,9 +86,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "integer_literal_replacement_token.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_assign_to_object_like_macro.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR: Cpp.CONFIG_VALUE = 3;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_assign_to_object_like_macro.carbon:[[@LINE+2]]:3-18: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR:
|
||||
Cpp.CONFIG_VALUE = 3;
|
||||
}
|
||||
@@ -126,9 +106,7 @@ import Cpp library "macro_in_nested_scope.h";
|
||||
fn F() {
|
||||
let unused a: i32 = Cpp.CONFIG_VALUE;
|
||||
|
||||
// CHECK:STDERR: fail_import_macro_in_nested_scope.carbon:[[@LINE+4]]:23: error: member name `CONFIG_VALUE` not found in `Cpp.N` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused b: i32 = Cpp.N.CONFIG_VALUE;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_macro_in_nested_scope.carbon:[[@LINE+2]]:23-40: error: member name `CONFIG_VALUE` not found in `Cpp.N` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused b: i32 = Cpp.N.CONFIG_VALUE;
|
||||
}
|
||||
@@ -168,16 +146,10 @@ import Cpp library "no_replacement_token.h";
|
||||
|
||||
fn F() {
|
||||
// TODO: Get rid of the second error.
|
||||
// CHECK:STDERR: fail_import_no_replacement_token.carbon:[[@LINE+11]]:3: error: semantics TODO: `Unsupported: macro with 0 replacement tokens` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.MACRO_NAME;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_no_replacement_token.carbon:[[@LINE+8]]:3: note: in `Cpp` name lookup for `MACRO_NAME` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.MACRO_NAME;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_no_replacement_token.carbon:[[@LINE+5]]:3-16: error: semantics TODO: `Unsupported: macro with 0 replacement tokens` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_import_no_replacement_token.carbon:[[@LINE+4]]:3-16: note: in `Cpp` name lookup for `MACRO_NAME` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_no_replacement_token.carbon:[[@LINE+4]]:3: error: member name `MACRO_NAME` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.MACRO_NAME;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_no_replacement_token.carbon:[[@LINE+2]]:3-16: error: member name `MACRO_NAME` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.MACRO_NAME;
|
||||
}
|
||||
@@ -292,40 +264,22 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "unsupported_string_literal_types.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+11]]:2: error: semantics TODO: `Unsupported: string literal type: const char16_t[6]` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.Utf16Greeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+8]]:2: note: in `Cpp` name lookup for `Utf16Greeting` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.Utf16Greeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+5]]:2-18: error: semantics TODO: `Unsupported: string literal type: const char16_t[6]` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+4]]:2-18: note: in `Cpp` name lookup for `Utf16Greeting` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+4]]:2: error: member name `Utf16Greeting` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.Utf16Greeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+2]]:2-18: error: member name `Utf16Greeting` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.Utf16Greeting;
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+11]]:2: error: semantics TODO: `Unsupported: string literal type: const char32_t[6]` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.Utf32Greeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+8]]:2: note: in `Cpp` name lookup for `Utf32Greeting` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.Utf32Greeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+5]]:2-18: error: semantics TODO: `Unsupported: string literal type: const char32_t[6]` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+4]]:2-18: note: in `Cpp` name lookup for `Utf32Greeting` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+4]]:2: error: member name `Utf32Greeting` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.Utf32Greeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+2]]:2-18: error: member name `Utf32Greeting` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.Utf32Greeting;
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+11]]:2: error: semantics TODO: `Unsupported: string literal type: const wchar_t[6]` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.WideGreeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+8]]:2: note: in `Cpp` name lookup for `WideGreeting` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.WideGreeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+5]]:2-17: error: semantics TODO: `Unsupported: string literal type: const wchar_t[6]` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+4]]:2-17: note: in `Cpp` name lookup for `WideGreeting` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+4]]:2: error: member name `WideGreeting` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.WideGreeting;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_string_literal_types.carbon:[[@LINE+2]]:2-17: error: member name `WideGreeting` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.WideGreeting;
|
||||
}
|
||||
@@ -339,16 +293,10 @@ import Cpp inline '''
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_bad_string.carbon:[[@LINE+11]]:2: error: failed to parse macro Cpp.BadString to a valid constant expression [InCppMacroEvaluation]
|
||||
// CHECK:STDERR: Cpp.BadString;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_string.carbon:[[@LINE+8]]:2: note: in `Cpp` name lookup for `BadString` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.BadString;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_string.carbon:[[@LINE+5]]:2-14: error: failed to parse macro Cpp.BadString to a valid constant expression [InCppMacroEvaluation]
|
||||
// CHECK:STDERR: fail_bad_string.carbon:[[@LINE+4]]:2-14: note: in `Cpp` name lookup for `BadString` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_bad_string.carbon:[[@LINE+4]]:2: error: member name `BadString` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.BadString;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_string.carbon:[[@LINE+2]]:2-14: error: member name `BadString` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.BadString;
|
||||
}
|
||||
@@ -382,16 +330,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "unsupported_floating_point_literal_macro.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_unsupported_floating_point_literal_macro.carbon:[[@LINE+11]]:3: error: semantics TODO: `Unsupported: macro evaluated to a constant of type: long double` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.MyLongDouble;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_floating_point_literal_macro.carbon:[[@LINE+8]]:3: note: in `Cpp` name lookup for `MyLongDouble` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.MyLongDouble;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_floating_point_literal_macro.carbon:[[@LINE+5]]:3-18: error: semantics TODO: `Unsupported: macro evaluated to a constant of type: long double` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_import_unsupported_floating_point_literal_macro.carbon:[[@LINE+4]]:3-18: note: in `Cpp` name lookup for `MyLongDouble` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_unsupported_floating_point_literal_macro.carbon:[[@LINE+4]]:3: error: member name `MyLongDouble` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.MyLongDouble;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_floating_point_literal_macro.carbon:[[@LINE+2]]:3-18: error: member name `MyLongDouble` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.MyLongDouble;
|
||||
}
|
||||
@@ -403,9 +345,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "floating_point_literal_macro.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_assign_to_float.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR: Cpp.MyDouble = 1.0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_assign_to_float.carbon:[[@LINE+2]]:3-14: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR:
|
||||
Cpp.MyDouble = 1.0;
|
||||
}
|
||||
@@ -458,7 +398,7 @@ fn F() {
|
||||
|
||||
// --- multiple_characters.h
|
||||
|
||||
// CHECK:STDERR: ./multiple_characters.h:[[@LINE+1]]:24: in expansion of macro defined here [InCppMacroExpansion]
|
||||
// CHECK:STDERR: expanded from macro defined at: ./multiple_characters.h:[[@LINE+1]]:24 [InCppMacroExpansion]
|
||||
#define MULTIPLE_CHARS 'AB'
|
||||
|
||||
// --- import_multiple_characters.carbon
|
||||
@@ -468,14 +408,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "multiple_characters.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: import_multiple_characters.carbon:[[@LINE+9]]:25: warning: multi-character character constant [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 16 | let unused a: i32 = Cpp.MULTIPLE_CHARS;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: 3 | #define MULTIPLE_CHARS 'AB'
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: import_multiple_characters.carbon:[[@LINE+4]]:22: note: in `Cpp` name lookup for `MULTIPLE_CHARS` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused a: i32 = Cpp.MULTIPLE_CHARS;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: import_multiple_characters.carbon:[[@LINE+3]]:25: warning: multi-character character constant [CppInteropParseWarning]
|
||||
// CHECK:STDERR: import_multiple_characters.carbon:[[@LINE+2]]:22-39: note: in `Cpp` name lookup for `MULTIPLE_CHARS` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
let unused a: i32 = Cpp.MULTIPLE_CHARS;
|
||||
}
|
||||
@@ -493,40 +427,22 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "unsupported_character_literal_types.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:23: error: semantics TODO: `Unsupported: macro evaluated to a constant of type: char16_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused a: char = Cpp.M_UTF16_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:23: note: in `Cpp` name lookup for `M_UTF16_CHAR` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused a: char = Cpp.M_UTF16_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+5]]:23-38: error: semantics TODO: `Unsupported: macro evaluated to a constant of type: char16_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23-38: note: in `Cpp` name lookup for `M_UTF16_CHAR` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23: error: member name `M_UTF16_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused a: char = Cpp.M_UTF16_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+2]]:23-38: error: member name `M_UTF16_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused a: char = Cpp.M_UTF16_CHAR;
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:23: error: semantics TODO: `Unsupported: macro evaluated to a constant of type: char32_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused b: char = Cpp.M_UTF32_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:23: note: in `Cpp` name lookup for `M_UTF32_CHAR` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused b: char = Cpp.M_UTF32_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+5]]:23-38: error: semantics TODO: `Unsupported: macro evaluated to a constant of type: char32_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23-38: note: in `Cpp` name lookup for `M_UTF32_CHAR` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23: error: member name `M_UTF32_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused b: char = Cpp.M_UTF32_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+2]]:23-38: error: member name `M_UTF32_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused b: char = Cpp.M_UTF32_CHAR;
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+11]]:23: error: semantics TODO: `Unsupported: macro evaluated to a constant of type: wchar_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused c: char = Cpp.M_WIDE_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+8]]:23: note: in `Cpp` name lookup for `M_WIDE_CHAR` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused c: char = Cpp.M_WIDE_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+5]]:23-37: error: semantics TODO: `Unsupported: macro evaluated to a constant of type: wchar_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23-37: note: in `Cpp` name lookup for `M_WIDE_CHAR` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+4]]:23: error: member name `M_WIDE_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused c: char = Cpp.M_WIDE_CHAR;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unsupported_character_literal_types.carbon:[[@LINE+2]]:23-37: error: member name `M_WIDE_CHAR` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused c: char = Cpp.M_WIDE_CHAR;
|
||||
}
|
||||
@@ -538,9 +454,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "character_literals.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_assign_to_character_literals.carbon:[[@LINE+4]]:2: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR: Cpp.M_LOWERCASE = 'b';
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_assign_to_character_literals.carbon:[[@LINE+2]]:2-16: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR:
|
||||
Cpp.M_LOWERCASE = 'b';
|
||||
}
|
||||
@@ -592,9 +506,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "boolean_literal_macro.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_assign_to_boolean_literal_macro.carbon:[[@LINE+4]]:2: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR: Cpp.M_TRUE = false;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_assign_to_boolean_literal_macro.carbon:[[@LINE+2]]:2-11: error: expression is not assignable [AssignmentToNonAssignable]
|
||||
// CHECK:STDERR:
|
||||
Cpp.M_TRUE = false;
|
||||
}
|
||||
@@ -738,9 +650,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "macro_undefined.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_macro_undefined.carbon:[[@LINE+4]]:23: error: member name `UNDEF_VALUE` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused a: i32 = Cpp.UNDEF_VALUE;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_macro_undefined.carbon:[[@LINE+2]]:23-37: error: member name `UNDEF_VALUE` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused a: i32 = Cpp.UNDEF_VALUE;
|
||||
}
|
||||
@@ -773,14 +683,9 @@ fn F() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: import_macro_defined_twice.carbon:[[@LINE+9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: import_macro_defined_twice.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./macro_defined_twice.h:3:9: warning: 'TWICE_DEF' macro redefined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 3 | #define TWICE_DEF 2
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: import_macro_defined_twice.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./macro_defined_twice.h:2:9: note: previous definition is here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | #define TWICE_DEF 1
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "macro_defined_twice.h";
|
||||
|
||||
@@ -805,9 +710,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "function_like_macros.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_import_function_like_macros.carbon:[[@LINE+4]]:23: error: member name `MAX` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused a: i32 = Cpp.MAX(1,2);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_function_like_macros.carbon:[[@LINE+2]]:23-29: error: member name `MAX` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused a: i32 = Cpp.MAX(1,2);
|
||||
}
|
||||
@@ -827,9 +730,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "predefined_macros.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_import_predefined_macros.carbon:[[@LINE+4]]:30: error: member name `__LINE__` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused line_num: i32 = Cpp.__LINE__;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_predefined_macros.carbon:[[@LINE+2]]:30-41: error: member name `__LINE__` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused line_num: i32 = Cpp.__LINE__;
|
||||
}
|
||||
@@ -854,9 +755,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "header_guard_macros.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_header_guard_macros.carbon:[[@LINE+4]]:3: error: member name `HEADER_GUARD_MACRO_H_` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.HEADER_GUARD_MACRO_H_;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_header_guard_macros.carbon:[[@LINE+2]]:3-27: error: member name `HEADER_GUARD_MACRO_H_` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.HEADER_GUARD_MACRO_H_;
|
||||
}
|
||||
@@ -934,19 +833,11 @@ Struct s;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_assign_array.carbon:[[@LINE+14]]:3: error: semantics TODO: `lvalue path contains an array type` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.m = 2;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_assign_array.carbon:[[@LINE+11]]:3: note: in `Cpp` name lookup for `m` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.m = 2;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_assign_array.carbon:[[@LINE+6]]:3-7: error: semantics TODO: `lvalue path contains an array type` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_assign_array.carbon:[[@LINE+5]]:3-7: note: in `Cpp` name lookup for `m` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_assign_array.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Core.IntLiteral` to `array(i32, 3)` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.m = 2;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_assign_array.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(array(i32, 3))` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.m = 2;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_assign_array.carbon:[[@LINE+3]]:3-11: error: cannot implicitly convert expression of type `Core.IntLiteral` to `array(i32, 3)` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_assign_array.carbon:[[@LINE+2]]:3-11: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(array(i32, 3))` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
Cpp.m = 2;
|
||||
}
|
||||
@@ -964,16 +855,10 @@ struct DerivedB : BaseA {} b_obj;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_assign_base_class_member.carbon:[[@LINE+11]]:3: error: semantics TODO: `lvalue path contains a base class subobject` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.m = 2;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_assign_base_class_member.carbon:[[@LINE+8]]:3: note: in `Cpp` name lookup for `m` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.m = 2;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_assign_base_class_member.carbon:[[@LINE+5]]:3-7: error: semantics TODO: `lvalue path contains a base class subobject` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_assign_base_class_member.carbon:[[@LINE+4]]:3-7: note: in `Cpp` name lookup for `m` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_assign_base_class_member.carbon:[[@LINE+4]]:3: error: member name `m` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.m = 2;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_assign_base_class_member.carbon:[[@LINE+2]]:3-7: error: member name `m` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.m = 2;
|
||||
}
|
||||
@@ -2283,7 +2168,7 @@ let _: C(1) = {} as C(Cpp.COUNT);
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %TWICE_DEF.ref: %i32 = name_ref TWICE_DEF, constants.%int_2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %a: %i32 = wrapper_binding a, %TWICE_DEF.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.d94 = value_binding_pattern a [concrete = constants.%a.patt]
|
||||
|
||||
+15
-42
@@ -40,9 +40,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "single.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_namespace_wrong_member_name.carbon:[[@LINE+4]]:3: error: member name `not_foo` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.my_namespace.not_foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_namespace_wrong_member_name.carbon:[[@LINE+2]]:3-26: error: member name `not_foo` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.my_namespace.not_foo();
|
||||
}
|
||||
@@ -54,9 +52,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "single.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_namespace_wrong_name.carbon:[[@LINE+4]]:3: error: member name `not_my_namespace` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.not_my_namespace.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_namespace_wrong_name.carbon:[[@LINE+2]]:3-22: error: member name `not_my_namespace` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.not_my_namespace.foo();
|
||||
}
|
||||
@@ -132,24 +128,15 @@ fn MyF() {
|
||||
// file split.
|
||||
// TODO: Pass a location into Clang when performing C++ name lookup so that
|
||||
// its error has a location attached.
|
||||
// CHECK:STDERR: fail_import_inline_ambiguity.carbon:[[@LINE+13]]:3: error: name `error` not found [NameNotFound]
|
||||
// CHECK:STDERR: error;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_import_inline_ambiguity.carbon:[[@LINE+6]]:3-7: error: name `error` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: error: reference to 'N' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_import_inline_ambiguity.carbon:[[@LINE-13]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_inline_ambiguity.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./inline_ambiguity.h:2:11: note: candidate found by name lookup is 'N' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | namespace N { void foo(); }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_inline_ambiguity.carbon:[[@LINE-17]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./inline_ambiguity.h:3:30: note: candidate found by name lookup is '(anonymous namespace)::N' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | inline namespace { namespace N {} }
|
||||
// CHECK:STDERR: | ^
|
||||
error;
|
||||
|
||||
// CHECK:STDERR: fail_import_inline_ambiguity.carbon:[[@LINE+4]]:3: note: in `Cpp` name lookup for `N` [InCppNameLookup]
|
||||
// CHECK:STDERR: Cpp.N.foo();
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_import_inline_ambiguity.carbon:[[@LINE+2]]:3-7: note: in `Cpp` name lookup for `N` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
Cpp.N.foo();
|
||||
}
|
||||
@@ -191,9 +178,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "special_name.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_special_name_call_unescpaed.carbon:[[@LINE+4]]:3: error: member name `base` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.base.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_special_name_call_unescpaed.carbon:[[@LINE+2]]:3-10: error: member name `base` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.base.foo();
|
||||
}
|
||||
@@ -256,12 +241,10 @@ fn CallFoo() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_import.carbon:[[@LINE+8]]:1: in import [InImport]
|
||||
// CHECK:STDERR: namespace_alias.carbon:4:1: error: semantics TODO: `indirect import of C++ declaration with no direct Cpp import` [SemanticsTodo]
|
||||
// CHECK:STDERR: import Cpp library "single.h";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_indirect_namespace_no_import.carbon:[[@LINE+6]]:1 [InImport]
|
||||
// CHECK:STDERR: namespace_alias.carbon:4:1-30: error: semantics TODO: `indirect import of C++ declaration with no direct Cpp import` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_import.carbon:[[@LINE+3]]:1: in import [InImport]
|
||||
// CHECK:STDERR: imported from: fail_indirect_namespace_no_import.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: namespace_alias.carbon: error: semantics TODO: `indirect import of C++ declaration with no direct Cpp import` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
import library "namespace_alias";
|
||||
@@ -269,15 +252,11 @@ import library "namespace_alias";
|
||||
fn F() {
|
||||
// Imports are not implicitly re-exported, so lookup is expected to fail,
|
||||
// regardless of whether a lookup was performed in the imported file.
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_import.carbon:[[@LINE+4]]:3: error: member name `foo` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: MyNamespaceAlias.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_import.carbon:[[@LINE+2]]:3-22: error: member name `foo` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
MyNamespaceAlias.foo();
|
||||
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_import.carbon:[[@LINE+4]]:3: error: member name `bar` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: MyNamespaceAlias.bar();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_import.carbon:[[@LINE+2]]:3-22: error: member name `bar` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
MyNamespaceAlias.bar();
|
||||
}
|
||||
@@ -286,7 +265,7 @@ fn F() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_local_decl.carbon:[[@LINE+3]]:1: in import [InImport]
|
||||
// CHECK:STDERR: imported from: fail_indirect_namespace_no_local_decl.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: namespace_alias.carbon: error: semantics TODO: `use of imported C++ declaration with no corresponding local import` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
import library "namespace_alias";
|
||||
@@ -295,15 +274,11 @@ import Cpp;
|
||||
fn F() {
|
||||
// Imports are not implicitly re-exported, so name lookup is expected to
|
||||
// fail, regardless of whether a lookup was performed in the imported file.
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_local_decl.carbon:[[@LINE+4]]:3: error: member name `foo` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: MyNamespaceAlias.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_local_decl.carbon:[[@LINE+2]]:3-22: error: member name `foo` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
MyNamespaceAlias.foo();
|
||||
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_local_decl.carbon:[[@LINE+4]]:3: error: member name `bar` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: MyNamespaceAlias.bar();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_indirect_namespace_no_local_decl.carbon:[[@LINE+2]]:3-22: error: member name `bar` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
MyNamespaceAlias.bar();
|
||||
}
|
||||
@@ -337,9 +312,7 @@ namespace my_namespace {
|
||||
fn F() {
|
||||
// Cpp imports are not implicitly re-exported, so name lookup is expected to
|
||||
// fail.
|
||||
// CHECK:STDERR: fail_indirect_namespace_different_contents_invalid.carbon:[[@LINE+4]]:3: error: member name `foo` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: MyNamespaceAlias.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_indirect_namespace_different_contents_invalid.carbon:[[@LINE+2]]:3-22: error: member name `foo` not found in `Cpp.my_namespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
MyNamespaceAlias.foo();
|
||||
}
|
||||
|
||||
+15
-43
@@ -28,24 +28,16 @@ using namespace Carbon::N;
|
||||
|
||||
// Unqualified lookups search `Carbon` and `Carbon::N` (failing there without
|
||||
// triggering typo correction) and resolve to `Fallback`.
|
||||
// CHECK:STDERR: fail_negative_lookup_via_using_directive.carbon:[[@LINE+3]]:9: error: name `LaterFn` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: int a = LaterFn();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_negative_lookup_via_using_directive.carbon:[[@LINE+1]]:9: error: name `LaterFn` used before it was declared [NameUseBeforeDecl]
|
||||
int a = LaterFn();
|
||||
int b = LaterNestedFn();
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_negative_lookup_via_using_directive.carbon:[[@LINE+7]]:4: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn LaterFn() -> i32 { return 3; }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_negative_lookup_via_using_directive.carbon:[[@LINE+3]]:4-10: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_negative_lookup_via_using_directive.carbon:[[@LINE-7]]:9: error: name `LaterNestedFn` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: int b = LaterNestedFn();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_negative_lookup_via_using_directive.carbon:[[@LINE-5]]:9: error: name `LaterNestedFn` used before it was declared [NameUseBeforeDecl]
|
||||
fn LaterFn() -> i32 { return 3; }
|
||||
// CHECK:STDERR: fail_negative_lookup_via_using_directive.carbon:[[@LINE+4]]:6: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn N.LaterNestedFn() -> i32 { return 4; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_negative_lookup_via_using_directive.carbon:[[@LINE+2]]:6-18: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
fn N.LaterNestedFn() -> i32 { return 4; }
|
||||
|
||||
@@ -71,36 +63,24 @@ inline Cpp '''
|
||||
Carbon::ExportedType* p1 = nullptr;
|
||||
|
||||
void TestTypoInCarbon() {
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+4]]:11: error: no member named 'NoSuchDecl' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Carbon::NoSuchDecl();
|
||||
// CHECK:STDERR: | ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+2]]:11-20: error: no member named 'NoSuchDecl' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::NoSuchDecl();
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+8]]:11: error: no type named 'ExportedTyp' in namespace 'Carbon'; did you mean 'ExportedType'? [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | Carbon::ExportedTyp* p_typo = p1;
|
||||
// CHECK:STDERR: | ~~~~~~~~^~~~~~~~~~~
|
||||
// CHECK:STDERR: | ExportedType
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE-19]]:20: note: 'ExportedType' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class ExportedType {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+4]]:11: error: no type named 'ExportedTyp' in namespace 'Carbon'; did you mean 'ExportedType'? [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+3]]:11-21: note: replace with `ExportedType` [CppInteropFixItReplacement]
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE-15]]:20: note: 'ExportedType' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::ExportedTyp* p_typo = p1;
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+7]]:11: error: no member named 'LaterDeclared' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 36 | Carbon::LaterDeclared();
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+3]]:11-23: error: no member named 'LaterDeclared' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+3]]:11: error: name `LaterDeclared` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: Carbon::LaterDeclared();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+1]]:11: error: name `LaterDeclared` used before it was declared [NameUseBeforeDecl]
|
||||
Carbon::LaterDeclared();
|
||||
Carbon::EarlyFn();
|
||||
Carbon::ExportedType* p2 = p1;
|
||||
}
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+4]]:4: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn LaterDeclared() -> i32 { return 42; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_typo_in_carbon_namespace.carbon:[[@LINE+2]]:4-16: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
fn LaterDeclared() -> i32 { return 42; }
|
||||
|
||||
@@ -126,21 +106,15 @@ fn Nested.EarlyFn() {}
|
||||
|
||||
inline Cpp '''
|
||||
void TestTypoInNested() {
|
||||
// CHECK:STDERR: fail_typo_in_nested_namespace.carbon:[[@LINE+7]]:19: error: no member named 'LaterInNested' in namespace 'Carbon::Nested' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Carbon::Nested::LaterInNested();
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_typo_in_nested_namespace.carbon:[[@LINE+3]]:19-31: error: no member named 'LaterInNested' in namespace 'Carbon::Nested' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_typo_in_nested_namespace.carbon:[[@LINE+3]]:19: error: name `LaterInNested` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: Carbon::Nested::LaterInNested();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_typo_in_nested_namespace.carbon:[[@LINE+1]]:19: error: name `LaterInNested` used before it was declared [NameUseBeforeDecl]
|
||||
Carbon::Nested::LaterInNested();
|
||||
Carbon::Nested::EarlyFn();
|
||||
}
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_typo_in_nested_namespace.carbon:[[@LINE+4]]:11: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn Nested.LaterInNested() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_typo_in_nested_namespace.carbon:[[@LINE+2]]:11-23: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
fn Nested.LaterInNested() {}
|
||||
|
||||
@@ -165,9 +139,7 @@ class MyClass {
|
||||
inline Cpp '''
|
||||
void TestTypoInClass() {
|
||||
Carbon::MyClass::StaticMethod1();
|
||||
// CHECK:STDERR: fail_typo_in_carbon_class.carbon:[[@LINE+4]]:20: error: no member named 'NoSuchMember' in 'Carbon::MyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Carbon::MyClass::NoSuchMember();
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_typo_in_carbon_class.carbon:[[@LINE+2]]:20-31: error: no member named 'NoSuchMember' in 'Carbon::MyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::MyClass::NoSuchMember();
|
||||
Carbon::MyClass::StaticMethod1();
|
||||
|
||||
@@ -68,9 +68,7 @@ void F();
|
||||
|
||||
void G() {
|
||||
// This is not found because it looks for the identifier `Cpp`, not the keyword `Cpp`.
|
||||
// CHECK:STDERR: fail_carbon_cpp.carbon:[[@LINE+4]]:11: error: no member named 'Cpp' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 14 | Carbon::Cpp::F();
|
||||
// CHECK:STDERR: | ~~~~~~~~^
|
||||
// CHECK:STDERR: fail_carbon_cpp.carbon:[[@LINE+2]]:11: error: no member named 'Cpp' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::Cpp::F();
|
||||
}
|
||||
@@ -87,13 +85,9 @@ inline Cpp '''
|
||||
void FRaw();
|
||||
|
||||
void GRaw() {
|
||||
// CHECK:STDERR: fail_carbon_raw_cpp.carbon:[[@LINE+8]]:16: error: semantics TODO: `interop with translation unit decl` [SemanticsTodo]
|
||||
// CHECK:STDERR: Carbon::Cpp::FRaw();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_carbon_raw_cpp.carbon:[[@LINE+4]]:16: error: semantics TODO: `interop with translation unit decl` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_carbon_raw_cpp.carbon:[[@LINE+4]]:11: error: no member named 'Cpp' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Carbon::Cpp::FRaw();
|
||||
// CHECK:STDERR: | ~~~~~~~~^
|
||||
// CHECK:STDERR: fail_carbon_raw_cpp.carbon:[[@LINE+2]]:11: error: no member named 'Cpp' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::Cpp::FRaw();
|
||||
}
|
||||
|
||||
@@ -51,24 +51,16 @@ enum class EC { e1, e2, e3 };
|
||||
''';
|
||||
|
||||
fn TestEnumClass(a: Cpp.EC, b: Cpp.EC) {
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.BitAndWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.EC = a & b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+2]]:19-23: error: cannot access member of interface `Core.BitAndWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.EC = a & b;
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.BitOrWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.EC = a | b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+2]]:19-23: error: cannot access member of interface `Core.BitOrWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.EC = a | b;
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.BitXorWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.EC = a ^ b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+2]]:19-23: error: cannot access member of interface `Core.BitXorWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.EC = a ^ b;
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.BitComplement` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.EC = ^a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+2]]:19-20: error: cannot access member of interface `Core.BitComplement` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.EC = ^a;
|
||||
}
|
||||
@@ -145,163 +137,105 @@ struct ConvertibleToFloat {
|
||||
|
||||
fn TestInteger(a: Cpp.ConvertibleToInt, b: Cpp.ConvertibleToInt) {
|
||||
// Test arithmetic.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.AddWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a + b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.AddWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a + b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.SubWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a - b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.SubWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a - b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.MulWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a * b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.MulWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a * b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.DivWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a / b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.DivWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a / b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.ModWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a % b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.ModWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a % b;
|
||||
|
||||
// Test bitwise.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.BitAndWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a & b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.BitAndWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a & b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.BitOrWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a | b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.BitOrWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a | b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.BitXorWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a ^ b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.BitXorWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a ^ b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.LeftShiftWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a << b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-21: error: cannot access member of interface `Core.LeftShiftWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a << b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.RightShiftWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a >> b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-21: error: cannot access member of interface `Core.RightShiftWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a >> b;
|
||||
|
||||
// Test comparison.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a == b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a == b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a != b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a != b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a < b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a < b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a <= b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a <= b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a > b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a > b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a >= b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a >= b);
|
||||
|
||||
// Test unary.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.Negate` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = -a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-17: error: cannot access member of interface `Core.Negate` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = -a;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.BitComplement` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = ^a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-17: error: cannot access member of interface `Core.BitComplement` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = ^a;
|
||||
}
|
||||
|
||||
fn TestFloat(a: Cpp.ConvertibleToFloat, b: Cpp.ConvertibleToFloat) {
|
||||
// Test arithmetic.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.AddWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = a + b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.AddWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = a + b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.SubWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = a - b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.SubWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = a - b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.MulWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = a * b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.MulWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = a * b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.DivWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = a / b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.DivWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = a / b;
|
||||
|
||||
// Test comparison.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a == b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a == b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a != b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a != b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a < b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a < b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a <= b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a <= b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a > b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a > b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a >= b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a >= b);
|
||||
|
||||
// Test unary.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.Negate` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = -a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-17: error: cannot access member of interface `Core.Negate` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = -a;
|
||||
}
|
||||
@@ -62,9 +62,7 @@ public:
|
||||
''';
|
||||
|
||||
fn TestDerefPass(var int_ptr: Cpp.MultiDeref) -> ref i32 {
|
||||
// CHECK:STDERR: fail_todo_multi_deref.carbon:[[@LINE+4]]:10: error: semantics TODO: `operator* overload sets not implemented yet` [SemanticsTodo]
|
||||
// CHECK:STDERR: return int_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_multi_deref.carbon:[[@LINE+2]]:10-41: error: semantics TODO: `operator* overload sets not implemented yet` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
return int_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
}
|
||||
@@ -91,9 +89,7 @@ public:
|
||||
''';
|
||||
|
||||
fn TestDerefPass(var int_ptr: Cpp.MaybeDeref(i32)) -> ref i32 {
|
||||
// CHECK:STDERR: fail_todo_maybe_deref.carbon:[[@LINE+4]]:10: error: semantics TODO: `operator* overload sets not implemented yet` [SemanticsTodo]
|
||||
// CHECK:STDERR: return int_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_maybe_deref.carbon:[[@LINE+2]]:10-41: error: semantics TODO: `operator* overload sets not implemented yet` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
return int_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
}
|
||||
@@ -107,9 +103,7 @@ class NotAPtr {};
|
||||
''';
|
||||
|
||||
fn TestDerefFail(not_ptr: Cpp.NotAPtr) {
|
||||
// CHECK:STDERR: fail_not_a_ptr.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.CppUnsafeDeref` in type `Cpp.NotAPtr` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: not_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_not_a_ptr.carbon:[[@LINE+2]]:3-34: error: cannot access member of interface `Core.CppUnsafeDeref` in type `Cpp.NotAPtr` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
not_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
}
|
||||
|
||||
+39
-117
@@ -93,15 +93,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp inline '''c++
|
||||
struct NeqBoolish {
|
||||
auto operator==(NeqBoolish) const -> bool;
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+9]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator!=(NeqBoolish) const -> int;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator!=(NeqBoolish) const -> int;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:14:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: default fn NotEqual(self, other: Other) -> bool {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+3]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+2]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:14:3-51: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
auto operator!=(NeqBoolish) const -> int;
|
||||
};
|
||||
|
||||
@@ -120,48 +114,22 @@ struct BothBoolish {
|
||||
};
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-18]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator==(EqBoolish) const -> int*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-21]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator==(EqBoolish) const -> int*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:13:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Equal(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+30]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-16]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-17]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:13:3-39: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+12]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-22]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator==(BothBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-25]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator==(BothBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:13:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Equal(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-12]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-13]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:13:3-39: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+7]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-34]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator!=(BothBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-37]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator!=(BothBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:14:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: default fn NotEqual(self, other: Other) -> bool {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+4]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-16]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-17]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:14:3-51: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+2]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
x == y;
|
||||
@@ -200,29 +168,19 @@ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
}
|
||||
|
||||
fn Test(default_eq_only: Cpp.DefaultEqOnly,
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+4]]:33: error: member name `DefaultSpaceshipOnly` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: default_spaceship_only: Cpp.DefaultSpaceshipOnly,
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+2]]:33-56: error: member name `DefaultSpaceshipOnly` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
default_spaceship_only: Cpp.DefaultSpaceshipOnly,
|
||||
only_eq_declared: Cpp.OnlyEqDeclared) {
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: EqWith(default_eq_only, default_eq_only);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-15]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+3]]:3-42: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-11]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(default_eq_only, default_eq_only);
|
||||
|
||||
EqWith(default_spaceship_only, default_spaceship_only);
|
||||
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: EqWith(only_eq_declared, only_eq_declared);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-26]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+3]]:3-44: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-18]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(only_eq_declared, only_eq_declared);
|
||||
}
|
||||
@@ -277,82 +235,46 @@ fn Test(only_neq: Cpp.OnlyNeq,
|
||||
deleted_neq: Cpp.DeletedNeq,
|
||||
non_const_eq: Cpp.NonConstEq,
|
||||
a2: Cpp.A2, b2: Cpp.B2) {
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.OnlyNeq` into type implementing `Core.EqWith(Cpp.OnlyNeq)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(only_neq, only_neq);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-15]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-28: error: cannot convert type `Cpp.OnlyNeq` into type implementing `Core.EqWith(Cpp.OnlyNeq)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-13]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(only_neq, only_neq);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+8]]:10: error: name `only_non_default_spaceship` not found [NameNotFound]
|
||||
// CHECK:STDERR: EqWith(only_non_default_spaceship, only_non_default_spaceship);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+4]]:10-35: error: name `only_non_default_spaceship` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+4]]:38: error: name `only_non_default_spaceship` not found [NameNotFound]
|
||||
// CHECK:STDERR: EqWith(only_non_default_spaceship, only_non_default_spaceship);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+2]]:38-63: error: name `only_non_default_spaceship` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
EqWith(only_non_default_spaceship, only_non_default_spaceship);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.EqWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(no_relevant_members, no_relevant_members);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-34]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-50: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.EqWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-24]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(no_relevant_members, no_relevant_members);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.EqReturnsVoid` into type implementing `Core.EqWith(Cpp.EqReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(eq_returns_void, eq_returns_void);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-42: error: cannot convert type `Cpp.EqReturnsVoid` into type implementing `Core.EqWith(Cpp.EqReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-29]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(eq_returns_void, eq_returns_void);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NeqReturnsVoid` into type implementing `Core.EqWith(Cpp.NeqReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(neq_returns_void, neq_returns_void);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-52]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-44: error: cannot convert type `Cpp.NeqReturnsVoid` into type implementing `Core.EqWith(Cpp.NeqReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-34]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(neq_returns_void, neq_returns_void);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+13]]:34: error: overload resolution selected deleted operator '!=' [CppInteropParseError]
|
||||
// CHECK:STDERR: 109 | EqWith(deleted_neq, deleted_neq);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-77]]:8: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | auto operator==(DeletedNeq) const -> bool;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-79]]:8: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 23 | auto operator!=(DeletedNeq) const -> bool = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-67]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+5]]:34: error: overload resolution selected deleted operator '!=' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-55]]:8: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-55]]:8: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-41]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(deleted_neq, deleted_neq);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: EqWith(non_const_eq, non_const_eq);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-76]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-36: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-46]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(non_const_eq, non_const_eq);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.A2` into type implementing `Core.EqWith(Cpp.B2)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(a2, b2);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-85]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-16: error: cannot convert type `Cpp.A2` into type implementing `Core.EqWith(Cpp.B2)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-51]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(a2, b2);
|
||||
}
|
||||
|
||||
+90
-189
@@ -69,18 +69,12 @@ import Cpp library "prefix_inc_and_dec.h";
|
||||
|
||||
fn F() {
|
||||
var prefix: Cpp.Prefix = Cpp.Prefix.Prefix();
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+8]]:9: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR: prefix++;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+4]]:9-10: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: prefix++;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+2]]:3-11: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
prefix++;
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+4]]:9: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR: prefix--;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+2]]:9-10: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR:
|
||||
prefix--;
|
||||
}
|
||||
@@ -99,14 +93,10 @@ import Cpp library "postfix_inc_and_dec.h";
|
||||
|
||||
fn F() {
|
||||
var postfix: Cpp.Postfix = Cpp.Postfix.Postfix();
|
||||
// CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Inc` in type `Cpp.Postfix` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: ++postfix;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+2]]:3-11: error: cannot access member of interface `Core.Inc` in type `Cpp.Postfix` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
++postfix;
|
||||
// CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Dec` in type `Cpp.Postfix` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: --postfix;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+2]]:3-11: error: cannot access member of interface `Core.Dec` in type `Cpp.Postfix` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
--postfix;
|
||||
}
|
||||
@@ -221,12 +211,8 @@ fn F() {
|
||||
var c: Cpp.BinaryC = {};
|
||||
|
||||
// Simple assignment.
|
||||
// CHECK:STDERR: fail_todo_import_assignment.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Core.IntLiteral` to `Cpp.BinaryC` [ConversionFailure]
|
||||
// CHECK:STDERR: c = 42;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_assignment.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(Cpp.BinaryC)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: c = 42;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_assignment.carbon:[[@LINE+3]]:3-8: error: cannot implicitly convert expression of type `Core.IntLiteral` to `Cpp.BinaryC` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_import_assignment.carbon:[[@LINE+2]]:3-8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(Cpp.BinaryC)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
c = 42;
|
||||
}
|
||||
@@ -256,14 +242,10 @@ import Cpp library "binary_operators.h";
|
||||
fn F() {
|
||||
let c1: Cpp.BinaryC = Cpp.BinaryC.BinaryC();
|
||||
// TODO: Include a list of non-viable candidate operators with this diagnostic.
|
||||
// CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+4]]:32: error: cannot access member of interface `Core.AddWith(Core.IntLiteral)` in type `Cpp.BinaryC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c2: Cpp.BinaryC = c1 + 5;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+2]]:32-37: error: cannot access member of interface `Core.AddWith(Core.IntLiteral)` in type `Cpp.BinaryC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c2: Cpp.BinaryC = c1 + 5;
|
||||
// CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+4]]:32: error: cannot access member of interface `Core.AddWith(Cpp.BinaryC)` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c3: Cpp.BinaryC = 6 + c1;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+2]]:32-37: error: cannot access member of interface `Core.AddWith(Cpp.BinaryC)` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c3: Cpp.BinaryC = 6 + c1;
|
||||
}
|
||||
@@ -283,15 +265,9 @@ void operator+(AmbiguousC, short);
|
||||
''';
|
||||
|
||||
fn Test(c: Cpp.AmbiguousC) {
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE+10]]:5: error: use of overloaded operator '+' is ambiguous (with operand types 'const AmbiguousC' and 'int') [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | c + 1;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE-8]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | void operator+(AmbiguousC, char);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE-10]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void operator+(AmbiguousC, short);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE+4]]:5: error: use of overloaded operator '+' is ambiguous (with operand types 'const AmbiguousC' and 'int') [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE-6]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE-6]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
c + 1;
|
||||
}
|
||||
@@ -307,15 +283,10 @@ void operator+(DeletedC, void*) = delete;
|
||||
''';
|
||||
|
||||
fn Test(c: Cpp.DeletedC) {
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+10]]:5: error: overload resolution selected deleted operator '+' [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | c + 1;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-8]]:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | void operator+(DeletedC, int) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-10]]:6: note: candidate function not viable: no known conversion from 'int' to 'void *' for 2nd argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void operator+(DeletedC, void*) = delete;
|
||||
// CHECK:STDERR: | ^ ~~~~~
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+5]]:5: error: overload resolution selected deleted operator '+' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-6]]:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-6]]:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-7]]:26-30: note: no known conversion from 'int' to 'void *' for 2nd argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
c + 1;
|
||||
}
|
||||
@@ -346,16 +317,12 @@ fn F() {
|
||||
let unused greater_than: bool = c1 > c2;
|
||||
|
||||
// Rewrite.
|
||||
// CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:32: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused less_than: bool = c1 < c2;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+2]]:32-38: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let unused less_than: bool = c1 < c2;
|
||||
|
||||
// Rewrite.
|
||||
// CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:44: error: semantics TODO: `Rewriting operator>= using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused greater_than_or_equal: bool = c1 >= c2;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+2]]:44-51: error: semantics TODO: `Rewriting operator>= using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let unused greater_than_or_equal: bool = c1 >= c2;
|
||||
|
||||
@@ -379,15 +346,9 @@ auto operator<(CDel lhs, BaseDel rhs) -> bool;
|
||||
|
||||
fn F(c: Cpp.CDel) -> bool {
|
||||
// Note that we mention `operator '<=>'` in the diagnostic.
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE+10]]:12: error: overload resolution selected deleted operator '<=>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 25 | return c < c;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE-9]]:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 9 | auto operator<=>(CDel lhs, CDel rhs) -> std::strong_ordering = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE-11]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | auto operator<(CDel lhs, BaseDel rhs) -> bool;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE+4]]:12: error: overload resolution selected deleted operator '<=>' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE-7]]:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE-7]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return c < c;
|
||||
}
|
||||
@@ -415,9 +376,7 @@ fn F() {
|
||||
let unused equal: bool = c1 == c2;
|
||||
|
||||
// Rewrite.
|
||||
// CHECK:STDERR: fail_todo_rewrite_equal.carbon:[[@LINE+4]]:32: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused not_equal: bool = c1 != c2;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_rewrite_equal.carbon:[[@LINE+2]]:32-39: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let unused not_equal: bool = c1 != c2;
|
||||
//@dump-sem-ir-end
|
||||
@@ -489,9 +448,7 @@ import Cpp library "plus_with_string_view_conversion.h";
|
||||
fn F() {
|
||||
let s1: str = "hello";
|
||||
let s2: str = "world";
|
||||
// CHECK:STDERR: fail_todo_import_plus_with_string_view_conversion.carbon:[[@LINE+4]]:46: error: cannot access member of interface `Core.AddWith(str)` in type `str` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c: Cpp.StringViewConvertibleC = s1 + s2;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_plus_with_string_view_conversion.carbon:[[@LINE+2]]:46-52: error: cannot access member of interface `Core.AddWith(str)` in type `str` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c: Cpp.StringViewConvertibleC = s1 + s2;
|
||||
}
|
||||
@@ -536,47 +493,31 @@ fn F() {
|
||||
var c: Cpp.UnsupportedUnaryC = Cpp.UnsupportedUnaryC.UnsupportedUnaryC();
|
||||
|
||||
// Arithmetic.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+12]]:37: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR: let plus: Cpp.UnsupportedUnaryC = +c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+6]]:37: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+8]]:37: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR: let plus: Cpp.UnsupportedUnaryC = +c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:37: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:37: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: let plus: Cpp.UnsupportedUnaryC = +c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:37: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let plus: Cpp.UnsupportedUnaryC = +c;
|
||||
|
||||
// Increment and Decrement.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR: c++;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:4-5: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR:
|
||||
c++;
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR: c--;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:4-5: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR:
|
||||
c--;
|
||||
|
||||
// Bitwise.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+8]]:42: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR: let not_value: Cpp.UnsupportedUnaryC = ~c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:42: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:42: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: let not_value: Cpp.UnsupportedUnaryC = ~c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:42: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR:
|
||||
let not_value: Cpp.UnsupportedUnaryC = ~c;
|
||||
|
||||
// Logical.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:51: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: let not_result: Cpp.UnsupportedUnaryC = operator!(c1);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:51: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR:
|
||||
let not_result: Cpp.UnsupportedUnaryC = operator!(c1);
|
||||
|
||||
@@ -611,42 +552,24 @@ fn F() {
|
||||
var c1: Cpp.UnsupportedBinaryC = Cpp.UnsupportedBinaryC.UnsupportedBinaryC();
|
||||
|
||||
// Logical.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+16]]:44: error: name `operator` not found [NameNotFound]
|
||||
// CHECK:STDERR: let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:44-51: error: name `operator` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+12]]:52: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR: let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+6]]:52: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:59: error: name `c2` not found [NameNotFound]
|
||||
// CHECK:STDERR: let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:59-60: error: name `c2` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:53: error: cannot take the address of non-reference expression [AddrOfNonRef]
|
||||
// CHECK:STDERR: let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+2]]:53: error: cannot take the address of non-reference expression [AddrOfNonRef]
|
||||
// CHECK:STDERR:
|
||||
let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+20]]:43: error: name `operator` not found [NameNotFound]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+10]]:43-50: error: name `operator` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+16]]:51: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:51: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+12]]:52: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+6]]:52: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:52: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:52: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:52: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+2]]:52: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
}
|
||||
@@ -731,9 +654,7 @@ fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
let c1: Cpp.GlobalOpN.C = Cpp.GlobalOpN.C.C();
|
||||
let c2: Cpp.GlobalOpN.C = Cpp.GlobalOpN.C.C();
|
||||
// CHECK:STDERR: fail_todo_import_operands_in_namespace_operator_in_global.carbon:[[@LINE+4]]:36: error: cannot access member of interface `Core.AddWith(Cpp.GlobalOpN.C)` in type `Cpp.GlobalOpN.C` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c3: Cpp.GlobalOpN.C = c1 + c2;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_operands_in_namespace_operator_in_global.carbon:[[@LINE+2]]:36-42: error: cannot access member of interface `Core.AddWith(Cpp.GlobalOpN.C)` in type `Cpp.GlobalOpN.C` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c3: Cpp.GlobalOpN.C = c1 + c2;
|
||||
//@dump-sem-ir-end
|
||||
@@ -840,9 +761,7 @@ import Cpp library "not_found.h";
|
||||
fn F() {
|
||||
let c1: Cpp.NoOperators = Cpp.NoOperators.NoOperators();
|
||||
let c2: Cpp.NoOperators = Cpp.NoOperators.NoOperators();
|
||||
// CHECK:STDERR: fail_import_not_found.carbon:[[@LINE+4]]:36: error: cannot access member of interface `Core.AddWith(Cpp.NoOperators)` in type `Cpp.NoOperators` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c3: Cpp.NoOperators = c1 + c2;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_import_not_found.carbon:[[@LINE+2]]:36-42: error: cannot access member of interface `Core.AddWith(Cpp.NoOperators)` in type `Cpp.NoOperators` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c3: Cpp.NoOperators = c1 + c2;
|
||||
}
|
||||
@@ -865,13 +784,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE+8]]:34: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: let unused result_unary: i32 = -*Cpp.CreateIncomplete();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE+4]]:34-57: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete_unary.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
let unused result_unary: i32 = -*Cpp.CreateIncomplete();
|
||||
}
|
||||
@@ -884,13 +799,9 @@ import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
var complete: Cpp.Complete = Cpp.Complete.Complete();
|
||||
// CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE+8]]:35: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: let unused result_binary: i32 = complete + *Cpp.CreateIncomplete();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE+4]]:35-68: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete_binary.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
let unused result_binary: i32 = complete + *Cpp.CreateIncomplete();
|
||||
}
|
||||
@@ -914,12 +825,8 @@ fn CreateIncomplete() -> Incomplete*;
|
||||
|
||||
fn F() {
|
||||
var complete: Cpp.CompleteCpp = Cpp.CompleteCpp.CompleteCpp();
|
||||
// CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+7]]:28: error: looking up a C++ operator with incomplete operand type `Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: let unused result: i32 = *CreateIncomplete() + complete;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE-8]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+3]]:28-57: error: looking up a C++ operator with incomplete operand type `Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE-6]]:1-17: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR:
|
||||
let unused result: i32 = *CreateIncomplete() + complete;
|
||||
}
|
||||
@@ -953,9 +860,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp inline '''
|
||||
template<typename T> struct FailTemplateB {};
|
||||
template<typename T> struct FailTemplateA {
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+3]]:19: error: type 'int' cannot be used prior to '::' because it has no members [CppInteropParseError]
|
||||
// CHECK:STDERR: 10 | friend typename T::error operator+(FailTemplateB<FailTemplateA>, FailTemplateB<FailTemplateA>);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+1]]:19: error: type 'int' cannot be used prior to '::' because it has no members [CppInteropParseError]
|
||||
friend typename T::error operator+(FailTemplateB<FailTemplateA>, FailTemplateB<FailTemplateA>);
|
||||
};
|
||||
|
||||
@@ -963,13 +868,9 @@ using FailTemplateX = FailTemplateB<FailTemplateA<int>>;
|
||||
''';
|
||||
|
||||
fn F(x: Cpp.FailTemplateX) -> i32 {
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+8]]:12: note: in instantiation of template class 'FailTemplateA<int>' requested here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 25 | return x + x;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+4]]:12: note: in instantiation of template class 'FailTemplateA<int>' requested here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.AddWith(Cpp.FailTemplateB)` in type `Cpp.FailTemplateB` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: return x + x;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+2]]:10-14: error: cannot access member of interface `Core.AddWith(Cpp.FailTemplateB)` in type `Cpp.FailTemplateB` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
return x + x;
|
||||
}
|
||||
@@ -2229,11 +2130,11 @@ fn F() {
|
||||
// CHECK:STDOUT: %operator_LessEqual__carbon_thunk: %operator_LessEqual__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc36 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc36 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.e2f: %pattern_type.bbc = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.790: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt.e2f [concrete]
|
||||
@@ -2275,14 +2176,14 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc36 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc32 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -2355,41 +2256,41 @@ fn F() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %greater_than.patt: %pattern_type.831 = value_binding_pattern greater_than [concrete = constants.%greater_than.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref.loc26: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc26: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc26: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %c1.ref.loc24: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc24: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc24: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %less_than: bool = wrapper_binding less_than, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %less_than.patt: %pattern_type.831 = value_binding_pattern less_than [concrete = constants.%less_than.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref.loc33: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc33: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc33: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %c1.ref.loc29: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc29: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc29: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %greater_than_or_equal: bool = wrapper_binding greater_than_or_equal, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %greater_than_or_equal.patt: %pattern_type.831 = value_binding_pattern greater_than_or_equal [concrete = constants.%greater_than_or_equal.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref.loc36: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc36: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc36_41.1: %C = acquire_value %c1.ref.loc36
|
||||
// CHECK:STDOUT: %.loc36_47.1: %C = acquire_value %c2.ref.loc36
|
||||
// CHECK:STDOUT: %.loc36_41.2: ref %C = value_as_ref %.loc36_41.1
|
||||
// CHECK:STDOUT: %addr.loc36_44.1: %ptr.0a2 = addr_of %.loc36_41.2
|
||||
// CHECK:STDOUT: %.loc36_47.2: ref %C = value_as_ref %.loc36_47.1
|
||||
// CHECK:STDOUT: %addr.loc36_44.2: %ptr.0a2 = addr_of %.loc36_47.2
|
||||
// CHECK:STDOUT: %.loc36_44.1: ref bool = temporary_storage
|
||||
// CHECK:STDOUT: %addr.loc36_44.3: %ptr.bb2 = addr_of %.loc36_44.1
|
||||
// CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc36_44.1, %addr.loc36_44.2, %addr.loc36_44.3)
|
||||
// CHECK:STDOUT: %.loc36_44.2: init bool to %.loc36_44.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc36_44.3: ref bool = temporary %.loc36_44.1, %.loc36_44.2
|
||||
// CHECK:STDOUT: %.loc36_44.4: bool = acquire_value %.loc36_44.3
|
||||
// CHECK:STDOUT: %.loc36_34: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %less_than_or_equal: bool = wrapper_binding less_than_or_equal, %.loc36_44.4
|
||||
// CHECK:STDOUT: %c1.ref.loc32: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc32: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc32_41.1: %C = acquire_value %c1.ref.loc32
|
||||
// CHECK:STDOUT: %.loc32_47.1: %C = acquire_value %c2.ref.loc32
|
||||
// CHECK:STDOUT: %.loc32_41.2: ref %C = value_as_ref %.loc32_41.1
|
||||
// CHECK:STDOUT: %addr.loc32_44.1: %ptr.0a2 = addr_of %.loc32_41.2
|
||||
// CHECK:STDOUT: %.loc32_47.2: ref %C = value_as_ref %.loc32_47.1
|
||||
// CHECK:STDOUT: %addr.loc32_44.2: %ptr.0a2 = addr_of %.loc32_47.2
|
||||
// CHECK:STDOUT: %.loc32_44.1: ref bool = temporary_storage
|
||||
// CHECK:STDOUT: %addr.loc32_44.3: %ptr.bb2 = addr_of %.loc32_44.1
|
||||
// CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc32_44.1, %addr.loc32_44.2, %addr.loc32_44.3)
|
||||
// CHECK:STDOUT: %.loc32_44.2: init bool to %.loc32_44.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc32_44.3: ref bool = temporary %.loc32_44.1, %.loc32_44.2
|
||||
// CHECK:STDOUT: %.loc32_44.4: bool = acquire_value %.loc32_44.3
|
||||
// CHECK:STDOUT: %.loc32_34: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %less_than_or_equal: bool = wrapper_binding less_than_or_equal, %.loc32_44.4
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = value_binding_pattern less_than_or_equal [concrete = constants.%less_than_or_equal.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc36: <bound method> = bound_method %.loc36_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc36(%.loc36_44.3)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc32: <bound method> = bound_method %.loc32_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc32(%.loc32_44.3)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: <bound method> = bound_method %.loc19_38.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_38.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -2400,11 +2301,11 @@ fn F() {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36(%self.param: ref bool) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32(%self.param: ref bool) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36(%self.param: ref bool) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32(%self.param: ref bool) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36(%self.param: ref bool) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32(%self.param: ref bool) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param)
|
||||
@@ -2565,9 +2466,9 @@ fn F() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %equal.patt: %pattern_type.831 = value_binding_pattern equal [concrete = constants.%equal.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref.loc23: ref %EqualC = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc23: ref %EqualC = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc23: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %c1.ref.loc21: ref %EqualC = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc21: ref %EqualC = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc21: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %not_equal: bool = wrapper_binding not_equal, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = value_binding_pattern not_equal [concrete = constants.%not_equal.patt]
|
||||
@@ -3072,10 +2973,10 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc14: type = splice_block %C.ref.loc14 [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalOpN.ref.loc14: <namespace> = name_ref GlobalOpN, imports.%GlobalOpN [concrete = imports.%GlobalOpN]
|
||||
// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %C.ref.loc12 [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalOpN.ref.loc12: <namespace> = name_ref GlobalOpN, imports.%GlobalOpN [concrete = imports.%GlobalOpN]
|
||||
// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c3: %C = wrapper_binding c3, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
|
||||
+40
-120
@@ -118,15 +118,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''c++
|
||||
struct LessReturnsBoolish {
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+9]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator<(LessReturnsBoolish) const -> int;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator<(LessReturnsBoolish) const -> int;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Less(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+3]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+2]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3-38: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
auto operator<(LessReturnsBoolish) const -> int;
|
||||
auto operator<=(LessReturnsBoolish) const -> bool;
|
||||
auto operator>(LessReturnsBoolish) const -> bool;
|
||||
@@ -167,87 +161,37 @@ struct AllReturnBoolish {
|
||||
};
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+82]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+32]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-36]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator<=(LessEqualReturnsBoolish) const -> int*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-39]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator<=(LessEqualReturnsBoolish) const -> int*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn LessOrEquivalent(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+69]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-34]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-35]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3-50: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+27]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-39]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator>=(GreaterEqualReturnsBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-42]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator>=(GreaterEqualReturnsBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:31:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn GreaterOrEquivalent(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+56]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-29]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-30]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:31:3-53: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+22]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-37]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator<(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-40]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator<(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Less(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-19]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-20]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3-38: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-49]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator<=(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-52]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator<=(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn LessOrEquivalent(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+30]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-23]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-24]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3-50: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+12]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-61]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator>(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-64]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator>(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:30:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Greater(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-27]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-28]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:30:3-41: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+7]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-73]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator>=(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-76]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator>=(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:31:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn GreaterOrEquivalent(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+4]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-31]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-32]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:31:3-53: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+2]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
x < y;
|
||||
@@ -332,57 +276,33 @@ fn Test(missing_less: Cpp.MissingLess,
|
||||
no_relevant_members: Cpp.NoRelevantMembers,
|
||||
less_returns_void: Cpp.LessReturnsVoid,
|
||||
less_non_const: Cpp.LessNonConst) {
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingLess` into type implementing `Core.OrderedWith(Cpp.MissingLess)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(missing_less, missing_less);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-41: error: cannot convert type `Cpp.MissingLess` into type implementing `Core.OrderedWith(Cpp.MissingLess)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-15]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(missing_less, missing_less);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingLessEqual` into type implementing `Core.OrderedWith(Cpp.MissingLessEqual)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(missing_less_equal, missing_less_equal);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-26]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-53: error: cannot convert type `Cpp.MissingLessEqual` into type implementing `Core.OrderedWith(Cpp.MissingLessEqual)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-20]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(missing_less_equal, missing_less_equal);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingGreater` into type implementing `Core.OrderedWith(Cpp.MissingGreater)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(missing_greater, missing_greater);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-35]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-47: error: cannot convert type `Cpp.MissingGreater` into type implementing `Core.OrderedWith(Cpp.MissingGreater)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-25]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(missing_greater, missing_greater);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingGreaterEqual` into type implementing `Core.OrderedWith(Cpp.MissingGreaterEqual)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(missing_greater_equal, missing_greater_equal);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-44]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-59: error: cannot convert type `Cpp.MissingGreaterEqual` into type implementing `Core.OrderedWith(Cpp.MissingGreaterEqual)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-30]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(missing_greater_equal, missing_greater_equal);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.OrderedWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(no_relevant_members, no_relevant_members);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-53]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-55: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.OrderedWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-35]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(no_relevant_members, no_relevant_members);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.LessReturnsVoid` into type implementing `Core.OrderedWith(Cpp.LessReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(less_returns_void, less_returns_void);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-62]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-51: error: cannot convert type `Cpp.LessReturnsVoid` into type implementing `Core.OrderedWith(Cpp.LessReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-40]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(less_returns_void, less_returns_void);
|
||||
|
||||
|
||||
+15
-45
@@ -152,57 +152,31 @@ fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly,
|
||||
returns_partial_ordering: Cpp.ReturnsPartialOrdering,
|
||||
cross_type_lhs: Cpp.CrossTypeLhs,
|
||||
cross_type_rhs: Cpp.CrossTypeRhs) {
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: EqWith(default_spaceship_only, default_spaceship_only);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-25]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-56: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-23]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(default_spaceship_only, default_spaceship_only);
|
||||
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(default_spaceship_only, default_spaceship_only);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-27]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-61: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-21]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(default_spaceship_only, default_spaceship_only);
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(returns_strong_ordering, returns_strong_ordering);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-35]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-63: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-25]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(returns_strong_ordering, returns_strong_ordering);
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(returns_partial_ordering, returns_partial_ordering);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-65: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-29]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(returns_partial_ordering, returns_partial_ordering);
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(cross_type_lhs, cross_type_rhs);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-51]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-45: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-33]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(cross_type_lhs, cross_type_rhs);
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+11]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(cross_type_rhs, cross_type_lhs);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-59]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+5]]:3-45: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-37]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-52]]:9: warning: binding `returns_weak_ordering` unused [UnusedBinding]
|
||||
// CHECK:STDERR: returns_weak_ordering: Cpp.ReturnsWeakOrdering,
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-28]]:9-54: warning: binding `returns_weak_ordering` unused [UnusedBinding]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(cross_type_rhs, cross_type_lhs);
|
||||
}
|
||||
@@ -216,12 +190,8 @@ import Cpp library "three_way_comparable_types.h";
|
||||
fn EqWith[U: type, T: Core.EqWith(U)](unused x: T, unused y: U) {}
|
||||
|
||||
fn Test(returns_strong_ordering: Cpp.ReturnsStrongOrdering) {
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.ReturnsStrongOrdering` into type implementing `Core.EqWith(Cpp.ReturnsStrongOrdering)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(returns_strong_ordering, returns_strong_ordering);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](unused x: T, unused y: U) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-58: error: cannot convert type `Cpp.ReturnsStrongOrdering` into type implementing `Core.EqWith(Cpp.ReturnsStrongOrdering)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-4]]:1-65: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(returns_strong_ordering, returns_strong_ordering);
|
||||
}
|
||||
|
||||
@@ -52,12 +52,8 @@ import Cpp;
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+7]]:25: error: semantics TODO: `Unsupported: builtin type: long double` [SemanticsTodo]
|
||||
// CHECK:STDERR: let cpp_long_double : Cpp.long_double = 1.0 as f64;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+4]]:25: note: in `Cpp` name lookup for `long_double` [InCppNameLookup]
|
||||
// CHECK:STDERR: let cpp_long_double : Cpp.long_double = 1.0 as f64;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+3]]:25-39: error: semantics TODO: `Unsupported: builtin type: long double` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+2]]:25-39: note: in `Cpp` name lookup for `long_double` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
let cpp_long_double : Cpp.long_double = 1.0 as f64;
|
||||
let unused carbon_long_double: f64 = cpp_long_double;
|
||||
@@ -71,9 +67,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_not_builtin.carbon:[[@LINE+4]]:28: error: member name `not_builtin` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused not_builtin : Cpp.not_builtin = 1;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_not_builtin.carbon:[[@LINE+2]]:28-42: error: member name `not_builtin` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused not_builtin : Cpp.not_builtin = 1;
|
||||
}
|
||||
@@ -87,9 +81,7 @@ namespace MyNamespace {}
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_lookup_in_other_scopes.carbon:[[@LINE+4]]:21: error: member name `long` not found in `Cpp.MyNamespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: let unused long : Cpp.MyNamespace.long = 1;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_lookup_in_other_scopes.carbon:[[@LINE+2]]:21-40: error: member name `long` not found in `Cpp.MyNamespace` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
let unused long : Cpp.MyNamespace.long = 1;
|
||||
}
|
||||
@@ -501,21 +493,21 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float.6da]
|
||||
// CHECK:STDOUT: %f64.loc15: type = type_literal constants.%f64.761 [concrete = constants.%f64.761]
|
||||
// CHECK:STDOUT: %f64.loc11: type = type_literal constants.%f64.761 [concrete = constants.%f64.761]
|
||||
// CHECK:STDOUT: %impl.elem0: %.dac = impl_witness_access constants.%As.impl_witness.553, element0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.882]
|
||||
// CHECK:STDOUT: %bound_method.loc15_47.1: <bound method> = bound_method %float, %impl.elem0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc11_47.1: <bound method> = bound_method %float, %impl.elem0 [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.FloatLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.FloatLiteral.as.As.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc15_47.2: <bound method> = bound_method %float, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.call: init %f64.761 = call %bound_method.loc15_47.2(%float) [concrete = constants.%float.a71]
|
||||
// CHECK:STDOUT: %.loc15_47.1: %f64.761 = value_of_initializer %Core.FloatLiteral.as.As.impl.Convert.call [concrete = constants.%float.a71]
|
||||
// CHECK:STDOUT: %.loc15_47.2: %f64.761 = converted %float, %.loc15_47.1 [concrete = constants.%float.a71]
|
||||
// CHECK:STDOUT: %bound_method.loc11_47.2: <bound method> = bound_method %float, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.call: init %f64.761 = call %bound_method.loc11_47.2(%float) [concrete = constants.%float.a71]
|
||||
// CHECK:STDOUT: %.loc11_47.1: %f64.761 = value_of_initializer %Core.FloatLiteral.as.As.impl.Convert.call [concrete = constants.%float.a71]
|
||||
// CHECK:STDOUT: %.loc11_47.2: %f64.761 = converted %float, %.loc11_47.1 [concrete = constants.%float.a71]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %cpp_long_double: <error> = wrapper_binding cpp_long_double, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %cpp_long_double.patt: <error> = value_binding_pattern cpp_long_double [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %cpp_long_double.ref: <error> = name_ref cpp_long_double, %cpp_long_double [concrete = <error>]
|
||||
// CHECK:STDOUT: %f64.loc16: type = type_literal constants.%f64.761 [concrete = constants.%f64.761]
|
||||
// CHECK:STDOUT: %f64.loc12: type = type_literal constants.%f64.761 [concrete = constants.%f64.761]
|
||||
// CHECK:STDOUT: %carbon_long_double: %f64.761 = wrapper_binding carbon_long_double, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %carbon_long_double.patt: %pattern_type.667 = value_binding_pattern carbon_long_double [concrete = constants.%carbon_long_double.patt]
|
||||
|
||||
@@ -63,9 +63,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:1: error: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+2]]:1-8: error: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR:
|
||||
class C;
|
||||
|
||||
@@ -73,12 +71,8 @@ fn F() -> array(C, 5)*;
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:33: error: subscript of pointer to incomplete type 'Carbon::C' [CppInteropParseError]
|
||||
// CHECK:STDERR: 22 | Carbon::C *p = &(*Carbon::F())[0];
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~^
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-9]]:8: note: forward declaration of 'Carbon::C' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 9 | class C;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:33: error: subscript of pointer to incomplete type 'Carbon::C' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-7]]:8: note: forward declaration of 'Carbon::C' [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::C *p = &(*Carbon::F())[0];
|
||||
}
|
||||
|
||||
Vendored
+1
-3
@@ -20,8 +20,6 @@ import Cpp inline '''
|
||||
auto GetWC() -> wchar_t;
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_todo_wide_char_t.carbon:[[@LINE+4]]:32: error: semantics TODO: `Unsupported: return type: wchar_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn CallGetWC() -> u32 { return Cpp.GetWC(); }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_wide_char_t.carbon:[[@LINE+2]]:32-42: error: semantics TODO: `Unsupported: return type: wchar_t` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn CallGetWC() -> u32 { return Cpp.GetWC(); }
|
||||
+11
-33
@@ -85,12 +85,8 @@ import Cpp;
|
||||
|
||||
fn F() {
|
||||
let carbon_i64: i64 = 1;
|
||||
// CHECK:STDERR: fail_implicit_conversion_i64_to_long.carbon:[[@LINE+7]]:35: error: cannot implicitly convert expression of type `i64` to `Cpp.long` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused cpp_long: Cpp.long = carbon_i64;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_implicit_conversion_i64_to_long.carbon:[[@LINE+4]]:35: note: type `i64` does not implement interface `Core.ImplicitAs(Cpp.long)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused cpp_long: Cpp.long = carbon_i64;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_implicit_conversion_i64_to_long.carbon:[[@LINE+3]]:35-44: error: cannot implicitly convert expression of type `i64` to `Cpp.long` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_implicit_conversion_i64_to_long.carbon:[[@LINE+2]]:35-44: note: type `i64` does not implement interface `Core.ImplicitAs(Cpp.long)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused cpp_long: Cpp.long = carbon_i64;
|
||||
}
|
||||
@@ -214,14 +210,10 @@ import Cpp;
|
||||
fn ComparisonsHeterogeneousLongAndI128() {
|
||||
let a: Cpp.long = 1;
|
||||
let b: i128 = 1;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a == b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a == b;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: b == a;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
b == a;
|
||||
}
|
||||
@@ -322,14 +314,10 @@ fn AssertSameType[T: type](unused a: T, unused b: T) {}
|
||||
fn ArithmeticHeterogeneousLongAndI128() {
|
||||
let x: Cpp.long = 1;
|
||||
let y: i128 = 1;
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(x + y, y);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.AddWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(x + y, y);
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(y + x, y);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.AddWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(y + x, y);
|
||||
}
|
||||
@@ -432,14 +420,10 @@ fn BitWiseHeterogeneousLongAndI128() {
|
||||
let a: Cpp.long = 1;
|
||||
let b: i128 = 1;
|
||||
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.BitAndWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(a & b, b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.BitAndWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(a & b, b);
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.BitAndWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(b & a, b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.BitAndWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(b & a, b);
|
||||
}
|
||||
@@ -539,9 +523,7 @@ import Cpp;
|
||||
|
||||
fn CompoundAssignmentHeterogeneousLongAndI64() {
|
||||
var a: Cpp.long = 1;
|
||||
// CHECK:STDERR: fail_compound_assignment_heterogeneous_long_and_i64.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.AddAssignWith(i64)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a += (1 as i64);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_compound_assignment_heterogeneous_long_and_i64.carbon:[[@LINE+2]]:3-17: error: cannot access member of interface `Core.AddAssignWith(i64)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a += (1 as i64);
|
||||
}
|
||||
@@ -599,12 +581,8 @@ fn F() {
|
||||
|
||||
// For portability reasons, this is not allowed even though `u64`
|
||||
// happens to fit in `unsigned long` on this target.
|
||||
// CHECK:STDERR: fail_pass_u64_to_ulong.carbon:[[@LINE+7]]:53: error: cannot implicitly convert expression of type `u64` to `Cpp.unsigned_long` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused cpp_unsigned_long: Cpp.unsigned_long = carbon_u64;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_u64_to_ulong.carbon:[[@LINE+4]]:53: note: type `u64` does not implement interface `Core.ImplicitAs(Cpp.unsigned_long)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused cpp_unsigned_long: Cpp.unsigned_long = carbon_u64;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_u64_to_ulong.carbon:[[@LINE+3]]:53-62: error: cannot implicitly convert expression of type `u64` to `Cpp.unsigned_long` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_pass_u64_to_ulong.carbon:[[@LINE+2]]:53-62: note: type `u64` does not implement interface `Core.ImplicitAs(Cpp.unsigned_long)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused cpp_unsigned_long: Cpp.unsigned_long = carbon_u64;
|
||||
}
|
||||
|
||||
+19
-57
@@ -79,12 +79,8 @@ import Cpp;
|
||||
|
||||
fn F() {
|
||||
let cpp_long: Cpp.long = 1;
|
||||
// CHECK:STDERR: fail_implicit_conversion_long_to_i32.carbon:[[@LINE+7]]:32: error: cannot implicitly convert expression of type `long` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused carbon_i32: i32 = cpp_long;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_implicit_conversion_long_to_i32.carbon:[[@LINE+4]]:32: note: type `Cpp.long` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused carbon_i32: i32 = cpp_long;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_implicit_conversion_long_to_i32.carbon:[[@LINE+3]]:32-39: error: cannot implicitly convert expression of type `long` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_implicit_conversion_long_to_i32.carbon:[[@LINE+2]]:32-39: note: type `Cpp.long` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused carbon_i32: i32 = cpp_long;
|
||||
}
|
||||
@@ -195,14 +191,10 @@ import Cpp;
|
||||
fn ComparisonsHeterogeneousLongAndI16() {
|
||||
let a: Cpp.long = 1;
|
||||
let b: i16 = 1;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i16.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(i16)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a == b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i16.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(i16)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a == b;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i16.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(Cpp.long)` in type `i16` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: b == a;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i16.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(Cpp.long)` in type `i16` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
b == a;
|
||||
}
|
||||
@@ -216,14 +208,10 @@ import Cpp;
|
||||
fn ComparisonsHeterogeneousLongAndI128() {
|
||||
let a: Cpp.long = 1;
|
||||
let b: i128 = 1;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a == b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a == b;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: b == a;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
b == a;
|
||||
}
|
||||
@@ -325,15 +313,11 @@ fn AssertSameType[T: type](unused a: T, unused b: T) {}
|
||||
fn ArithmeticHeterogeneousLongAndI16() {
|
||||
let x: Cpp.long = 1;
|
||||
let y: i16 = 1;
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i16.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(i16)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(x + y, x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i16.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.AddWith(i16)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(x + y, x);
|
||||
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i16.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(Cpp.long)` in type `i16` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(y + x, x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i16.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.AddWith(Cpp.long)` in type `i16` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(y + x, x);
|
||||
}
|
||||
@@ -349,15 +333,11 @@ fn AssertSameType[T: type](unused a: T, unused b: T) {}
|
||||
fn ArithmeticHeterogeneousLongAndI128() {
|
||||
let x: Cpp.long = 1;
|
||||
let y: i128 = 1;
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(x + y, y);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.AddWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(x + y, y);
|
||||
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(y + x, y);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.AddWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(y + x, y);
|
||||
}
|
||||
@@ -461,14 +441,10 @@ fn BitWiseHeterogeneousLongAndI16() {
|
||||
let a: Cpp.long = 1;
|
||||
let b: i16 = 1;
|
||||
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i16.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.BitAndWith(i16)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(a & b, a);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i16.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.BitAndWith(i16)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(a & b, a);
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i16.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.BitAndWith(Cpp.long)` in type `i16` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(b & a, a);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i16.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.BitAndWith(Cpp.long)` in type `i16` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(b & a, a);
|
||||
}
|
||||
@@ -485,14 +461,10 @@ fn BitWiseHeterogeneousLongAndI128() {
|
||||
let a: Cpp.long = 1;
|
||||
let b: i128 = 1;
|
||||
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.BitAndWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(a & b, b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.BitAndWith(i128)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(a & b, b);
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i128.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.BitAndWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(b & a, b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_and_i128.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.BitAndWith(Cpp.long)` in type `i128` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(b & a, b);
|
||||
}
|
||||
@@ -581,9 +553,7 @@ import Cpp;
|
||||
|
||||
fn CompoundAssignmentHeterogeneousI16Long() {
|
||||
var a: Cpp.long = 1;
|
||||
// CHECK:STDERR: fail_todo_compound_assignment_heterogeneous_long_and_i16.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.AddAssignWith(i16)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a += (1 as i16);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_compound_assignment_heterogeneous_long_and_i16.carbon:[[@LINE+2]]:3-17: error: cannot access member of interface `Core.AddAssignWith(i16)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a += (1 as i16);
|
||||
}
|
||||
@@ -596,9 +566,7 @@ import Cpp;
|
||||
|
||||
fn CompoundAssignmentHeterogeneousI64Long() {
|
||||
var a: Cpp.long = 1;
|
||||
// CHECK:STDERR: fail_compound_assignment_heterogeneous_long_and_i64.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.AddAssignWith(i64)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a += (1 as i64);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_compound_assignment_heterogeneous_long_and_i64.carbon:[[@LINE+2]]:3-17: error: cannot access member of interface `Core.AddAssignWith(i64)` in type `Cpp.long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a += (1 as i64);
|
||||
}
|
||||
@@ -656,16 +624,10 @@ fn F() {
|
||||
|
||||
// For portability reasons, this is not allowed even though `unsigned long`
|
||||
// happens to fit in `u32` on this target.
|
||||
// CHECK:STDERR: fail_no_ulong_to_u32.carbon:[[@LINE+11]]:25: error: cannot implicitly convert expression of type `unsigned_long` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: let carbon_u32: u32 = cpp_unsigned_long;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_no_ulong_to_u32.carbon:[[@LINE+8]]:25: note: type `Cpp.unsigned_long` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let carbon_u32: u32 = cpp_unsigned_long;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_no_ulong_to_u32.carbon:[[@LINE+5]]:25-41: error: cannot implicitly convert expression of type `unsigned_long` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_no_ulong_to_u32.carbon:[[@LINE+4]]:25-41: note: type `Cpp.unsigned_long` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_no_ulong_to_u32.carbon:[[@LINE+4]]:7: warning: binding `carbon_u32` unused [UnusedBinding]
|
||||
// CHECK:STDERR: let carbon_u32: u32 = cpp_unsigned_long;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_no_ulong_to_u32.carbon:[[@LINE+2]]:7-21: warning: binding `carbon_u32` unused [UnusedBinding]
|
||||
// CHECK:STDERR:
|
||||
let carbon_u32: u32 = cpp_unsigned_long;
|
||||
}
|
||||
|
||||
+15
-45
@@ -78,12 +78,8 @@ import Cpp;
|
||||
|
||||
fn F() {
|
||||
let cpp_long_long: Cpp.long_long = 1;
|
||||
// CHECK:STDERR: fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+7]]:32: error: cannot implicitly convert expression of type `long_long` to `i64` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused carbon_i64: i64 = cpp_long_long;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+4]]:32: note: type `Cpp.long_long` does not implement interface `Core.ImplicitAs(i64)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused carbon_i64: i64 = cpp_long_long;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+3]]:32-44: error: cannot implicitly convert expression of type `long_long` to `i64` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_implicit_conversion_long_long_to_i64.carbon:[[@LINE+2]]:32-44: note: type `Cpp.long_long` does not implement interface `Core.ImplicitAs(i64)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused carbon_i64: i64 = cpp_long_long;
|
||||
}
|
||||
@@ -181,14 +177,10 @@ import Cpp;
|
||||
fn ComparisonsHeterogeneousLongLongAndI32() {
|
||||
let a: Cpp.long_long = 1;
|
||||
let b: i32 = 1;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_long_and_i32.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(i32)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a == b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_long_and_i32.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(i32)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a == b;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_long_and_i32.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(Cpp.long_long)` in type `i32` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: b == a;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_long_and_i32.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(Cpp.long_long)` in type `i32` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
b == a;
|
||||
}
|
||||
@@ -215,14 +207,10 @@ import Cpp;
|
||||
fn ComparisonsHeterogeneousLongLongAndI256() {
|
||||
let a: Cpp.long_long = 1;
|
||||
let b: i256 = 1;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_long_and_i256.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(i256)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a == b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_long_and_i256.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(i256)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a == b;
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_long_and_i256.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.EqWith(Cpp.long_long)` in type `i256` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: b == a;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparisons_heterogeneous_long_long_and_i256.carbon:[[@LINE+2]]:3-8: error: cannot access member of interface `Core.EqWith(Cpp.long_long)` in type `i256` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
b == a;
|
||||
}
|
||||
@@ -307,15 +295,11 @@ fn AssertSameType[T: type](unused a: T, unused b: T) {}
|
||||
fn ArithmeticHeterogeneousLongLongAndI32() {
|
||||
let x: Cpp.long_long = 1;
|
||||
let y: i32 = 1;
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_long_and_i32.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(i32)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(x + y, x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_long_and_i32.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.AddWith(i32)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(x + y, x);
|
||||
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_long_and_i32.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(Cpp.long_long)` in type `i32` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(y + x, x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_arithmetic_heterogeneous_long_long_and_i32.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.AddWith(Cpp.long_long)` in type `i32` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(y + x, x);
|
||||
}
|
||||
@@ -417,14 +401,10 @@ fn BitWiseHeterogeneousLongLongAndI32() {
|
||||
let a: Cpp.long_long = 1;
|
||||
let b: i32 = 1;
|
||||
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_long_and_i32.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.BitAndWith(i32)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(a & b, a);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_long_and_i32.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.BitAndWith(i32)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(a & b, a);
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_long_and_i32.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.BitAndWith(Cpp.long_long)` in type `i32` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: AssertSameType(b & a, a);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_bitwise_heterogeneous_long_long_and_i32.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.BitAndWith(Cpp.long_long)` in type `i32` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
AssertSameType(b & a, a);
|
||||
}
|
||||
@@ -529,9 +509,7 @@ import Cpp;
|
||||
|
||||
fn CompoundAssignmentHeterogeneousLongLongAndI32() {
|
||||
var a: Cpp.long_long = 1;
|
||||
// CHECK:STDERR: fail_todo_compound_assignment_heterogeneous_long_long_and_i32.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.AddAssignWith(i32)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a += (1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_compound_assignment_heterogeneous_long_long_and_i32.carbon:[[@LINE+2]]:3-17: error: cannot access member of interface `Core.AddAssignWith(i32)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a += (1 as i32);
|
||||
}
|
||||
@@ -544,9 +522,7 @@ import Cpp;
|
||||
|
||||
fn CompoundAssignmentHeterogeneousLongLongAndI128() {
|
||||
var a: Cpp.long_long = 1;
|
||||
// CHECK:STDERR: fail_compound_assignment_heterogeneous_long_long_and_i128.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.AddAssignWith(i128)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: a += (1 as i128);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_compound_assignment_heterogeneous_long_long_and_i128.carbon:[[@LINE+2]]:3-18: error: cannot access member of interface `Core.AddAssignWith(i128)` in type `Cpp.long_long` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
a += (1 as i128);
|
||||
}
|
||||
@@ -604,16 +580,10 @@ fn F() {
|
||||
|
||||
// For portability reasons, this is not allowed even though `unsigned long
|
||||
// long` happens to fit in `u64` on this target.
|
||||
// CHECK:STDERR: fail_pass_ulonglong_to_u64.carbon:[[@LINE+11]]:25: error: cannot implicitly convert expression of type `unsigned_long_long` to `u64` [ConversionFailure]
|
||||
// CHECK:STDERR: let carbon_u64: u64 = cpp_unsigned_long_long;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_ulonglong_to_u64.carbon:[[@LINE+8]]:25: note: type `Cpp.unsigned_long_long` does not implement interface `Core.ImplicitAs(u64)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let carbon_u64: u64 = cpp_unsigned_long_long;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_ulonglong_to_u64.carbon:[[@LINE+5]]:25-46: error: cannot implicitly convert expression of type `unsigned_long_long` to `u64` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_pass_ulonglong_to_u64.carbon:[[@LINE+4]]:25-46: note: type `Cpp.unsigned_long_long` does not implement interface `Core.ImplicitAs(u64)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_pass_ulonglong_to_u64.carbon:[[@LINE+4]]:7: warning: binding `carbon_u64` unused [UnusedBinding]
|
||||
// CHECK:STDERR: let carbon_u64: u64 = cpp_unsigned_long_long;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_ulonglong_to_u64.carbon:[[@LINE+2]]:7-21: warning: binding `carbon_u64` unused [UnusedBinding]
|
||||
// CHECK:STDERR:
|
||||
let carbon_u64: u64 = cpp_unsigned_long_long;
|
||||
}
|
||||
|
||||
@@ -27,12 +27,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
fn G() {
|
||||
// CHECK:STDERR: fail_void_abstract.carbon:[[@LINE+7]]:17: error: binding pattern has abstract type `Cpp.void` in `var` pattern [AbstractTypeInVarPattern]
|
||||
// CHECK:STDERR: var unused x: Cpp.void;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: {{.*}}/prelude/types/cpp/void.carbon:24:1: note: class was declared abstract here [ClassAbstractHere]
|
||||
// CHECK:STDERR: abstract class CppCompat.VoidBase {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_void_abstract.carbon:[[@LINE+3]]:17-24: error: binding pattern has abstract type `Cpp.void` in `var` pattern [AbstractTypeInVarPattern]
|
||||
// CHECK:STDERR: {{.*}}/prelude/types/cpp/void.carbon:24:1-35: note: class was declared abstract here [ClassAbstractHere]
|
||||
// CHECK:STDERR:
|
||||
var unused x: Cpp.void;
|
||||
}
|
||||
@@ -44,23 +40,17 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp inline "void F(int);";
|
||||
|
||||
fn G(v: Cpp.void) {
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE+7]]:10: error: no matching function for call to 'F' [CppInteropParseError]
|
||||
// CHECK:STDERR: 14 | Cpp.F(v);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE-6]]:6: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'int' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | void F(int);
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE+4]]:3-7: error: no matching function for call to 'F' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE-4]]:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE-5]]:8-10: note: cannot convert argument of incomplete type 'void' to 'int' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.F(v);
|
||||
}
|
||||
|
||||
fn H(p: Cpp.void*) {
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE+7]]:11: error: no matching function for call to 'F' [CppInteropParseError]
|
||||
// CHECK:STDERR: 25 | Cpp.F(*p);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE-17]]:6: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'int' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | void F(int);
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE+4]]:3-7: error: no matching function for call to 'F' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE-12]]:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE-13]]:8-10: note: cannot convert argument of incomplete type 'void' to 'int' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.F(*p);
|
||||
}
|
||||
@@ -76,12 +76,8 @@ struct S {};
|
||||
|
||||
fn F(input: Cpp.void*) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+7]]:26: error: cannot convert expression of type `void*` to `Cpp.S*` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused p: Cpp.S* = input as Cpp.S*;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+4]]:26: note: type `Cpp.void*` does not implement interface `Core.As(Cpp.S*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused p: Cpp.S* = input as Cpp.S*;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+3]]:26-40: error: cannot convert expression of type `void*` to `Cpp.S*` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon:[[@LINE+2]]:26-40: note: type `Cpp.void*` does not implement interface `Core.As(Cpp.S*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused p: Cpp.S* = input as Cpp.S*;
|
||||
//@dump-sem-ir-end
|
||||
@@ -97,12 +93,8 @@ class C {}
|
||||
|
||||
fn F(input: Cpp.void*) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+7]]:22: error: cannot convert expression of type `void*` to `C*` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused p: C* = input as C*;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+4]]:22: note: type `Cpp.void*` does not implement interface `Core.As(C*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused p: C* = input as C*;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+3]]:22-32: error: cannot convert expression of type `void*` to `C*` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_explicit_as_from_void_pointer_to_carbon_class_pointer.carbon:[[@LINE+2]]:22-32: note: type `Cpp.void*` does not implement interface `Core.As(C*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused p: C* = input as C*;
|
||||
//@dump-sem-ir-end
|
||||
@@ -406,14 +398,14 @@ fn F(input: Cpp.void*) {
|
||||
// CHECK:STDOUT: fn @F(%input.param: %ptr.00a) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %input.ref: %ptr.00a = name_ref input, %input
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17_35: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc17_38: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %ptr.loc17_40: type = ptr_type %S.ref.loc17_38 [concrete = constants.%ptr.037]
|
||||
// CHECK:STDOUT: %.loc17_32: %ptr.037 = converted %input.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc17_22: type = splice_block %ptr.loc17_22 [concrete = constants.%ptr.037] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17_17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc17_20: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %ptr.loc17_22: type = ptr_type %S.ref.loc17_20 [concrete = constants.%ptr.037]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13_35: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc13_38: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %ptr.loc13_40: type = ptr_type %S.ref.loc13_38 [concrete = constants.%ptr.037]
|
||||
// CHECK:STDOUT: %.loc13_32: %ptr.037 = converted %input.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc13_22: type = splice_block %ptr.loc13_22 [concrete = constants.%ptr.037] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13_17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc13_20: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %ptr.loc13_22: type = ptr_type %S.ref.loc13_20 [concrete = constants.%ptr.037]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: %ptr.037 = wrapper_binding p, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -437,12 +429,12 @@ fn F(input: Cpp.void*) {
|
||||
// CHECK:STDOUT: fn @F(%input.param: %ptr.00a) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %input.ref: %ptr.00a = name_ref input, %input
|
||||
// CHECK:STDOUT: %C.ref.loc17_31: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %ptr.loc17_32: type = ptr_type %C.ref.loc17_31 [concrete = constants.%ptr.6b6]
|
||||
// CHECK:STDOUT: %.loc17_28: %ptr.6b6 = converted %input.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc17_18: type = splice_block %ptr.loc17_18 [concrete = constants.%ptr.6b6] {
|
||||
// CHECK:STDOUT: %C.ref.loc17_17: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %ptr.loc17_18: type = ptr_type %C.ref.loc17_17 [concrete = constants.%ptr.6b6]
|
||||
// CHECK:STDOUT: %C.ref.loc13_31: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %ptr.loc13_32: type = ptr_type %C.ref.loc13_31 [concrete = constants.%ptr.6b6]
|
||||
// CHECK:STDOUT: %.loc13_28: %ptr.6b6 = converted %input.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc13_18: type = splice_block %ptr.loc13_18 [concrete = constants.%ptr.6b6] {
|
||||
// CHECK:STDOUT: %C.ref.loc13_17: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %ptr.loc13_18: type = ptr_type %C.ref.loc13_17 [concrete = constants.%ptr.6b6]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: %ptr.6b6 = wrapper_binding p, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
|
||||
+631
-753
File diff suppressed because it is too large.
Load diff
@@ -45,13 +45,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_too_few_arguments.carbon:[[@LINE+8]]:26: error: too few template arguments for class template 'TwoTypes' [CppInteropParseError]
|
||||
// CHECK:STDERR: 14 | var x: Cpp.TwoTypes(Cpp.A);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_too_few_arguments.carbon:[[@LINE-5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_too_few_arguments.carbon:[[@LINE+4]]:26: error: too few template arguments for class template 'TwoTypes' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_too_few_arguments.carbon:[[@LINE-3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./templates.h:5:41: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | template<typename T, typename U> struct TwoTypes {};
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTypes(Cpp.A);
|
||||
|
||||
@@ -61,13 +57,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_too_many_arguments.carbon:[[@LINE+8]]:40: error: too many template arguments for class template 'TwoTypes' [CppInteropParseError]
|
||||
// CHECK:STDERR: 14 | var x: Cpp.TwoTypes(Cpp.A, Cpp.A, Cpp.A);
|
||||
// CHECK:STDERR: | ~~^
|
||||
// CHECK:STDERR: fail_too_many_arguments.carbon:[[@LINE-5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_too_many_arguments.carbon:[[@LINE+4]]:38-40: error: too many template arguments for class template 'TwoTypes' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_too_many_arguments.carbon:[[@LINE-3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./templates.h:5:41: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | template<typename T, typename U> struct TwoTypes {};
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTypes(Cpp.A, Cpp.A, Cpp.A);
|
||||
|
||||
@@ -98,23 +90,15 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE+8]]:57: error: too few template arguments for class template 'Inner' [CppInteropParseError]
|
||||
// CHECK:STDERR: 14 | var too_few: Cpp.FixedSizePack(Cpp.A, Cpp.A).Inner(Cpp.B);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE-5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE+4]]:57: error: too few template arguments for class template 'Inner' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_fixed_size_pack_wrong_size.carbon:[[@LINE-3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./templates.h:15:33: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 15 | template<True<T> ...U> struct Inner {};
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~~~~~~~~~ ^
|
||||
// CHECK:STDERR:
|
||||
var too_few: Cpp.FixedSizePack(Cpp.A, Cpp.A).Inner(Cpp.B);
|
||||
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE+8]]:72: error: too many template arguments for class template 'Inner' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | var too_many: Cpp.FixedSizePack(Cpp.A, Cpp.A).Inner(Cpp.B, Cpp.B, Cpp.B);
|
||||
// CHECK:STDERR: | ~~^
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE-15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE+4]]:70-72: error: too many template arguments for class template 'Inner' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_fixed_size_pack_wrong_size.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./templates.h:15:33: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 15 | template<True<T> ...U> struct Inner {};
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~~~~~~~~~ ^
|
||||
// CHECK:STDERR:
|
||||
var too_many: Cpp.FixedSizePack(Cpp.A, Cpp.A).Inner(Cpp.B, Cpp.B, Cpp.B);
|
||||
|
||||
|
||||
@@ -41,12 +41,8 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_int_param_mismatch.carbon:[[@LINE+7]]:1: error: cannot implicitly convert expression of type `Cpp.Simple` to `Cpp.Simple` [ConversionFailure]
|
||||
// CHECK:STDERR: var s: Cpp.Simple(456) = Cpp.MakeSimple123();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_int_param_mismatch.carbon:[[@LINE+4]]:1: note: type `Cpp.Simple` does not implement interface `Core.ImplicitAs(Cpp.Simple)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: var s: Cpp.Simple(456) = Cpp.MakeSimple123();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_int_param_mismatch.carbon:[[@LINE+3]]:1-22: error: cannot implicitly convert expression of type `Cpp.Simple` to `Cpp.Simple` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_param_mismatch.carbon:[[@LINE+2]]:1-22: note: type `Cpp.Simple` does not implement interface `Core.ImplicitAs(Cpp.Simple)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
var s: Cpp.Simple(456) = Cpp.MakeSimple123();
|
||||
|
||||
@@ -139,12 +135,8 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_type_argument.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `type` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: var x: Cpp.TwoNonType(1, Cpp.A) = {};
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_type_argument.carbon:[[@LINE+4]]:26: note: type `type` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: var x: Cpp.TwoNonType(1, Cpp.A) = {};
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_type_argument.carbon:[[@LINE+3]]:26-30: error: cannot implicitly convert expression of type `type` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_type_argument.carbon:[[@LINE+2]]:26-30: note: type `type` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoNonType(1, Cpp.A) = {};
|
||||
|
||||
@@ -156,12 +148,8 @@ import Cpp library "templates.h";
|
||||
|
||||
var n: i32;
|
||||
|
||||
// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `i32*` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: var x: Cpp.TwoNonType(1, &n) = {};
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+4]]:26: note: type `i32*` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: var x: Cpp.TwoNonType(1, &n) = {};
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:26-27: error: cannot implicitly convert expression of type `i32*` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+2]]:26-27: note: type `i32*` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoNonType(1, &n) = {};
|
||||
|
||||
|
||||
+5
-18
@@ -36,20 +36,11 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "templates.h";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE+15]]:35: error: too few template arguments for class template 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: 22 | var x: Cpp.TwoTemplates(Cpp.A, Cpp.C);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE+12]]:35: note: template template argument has different template parameters than its corresponding template template parameter [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | var x: Cpp.TwoTemplates(Cpp.A, Cpp.C);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE+6]]:35: error: too few template arguments for class template 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE+5]]:35: note: template template argument has different template parameters than its corresponding template template parameter [CppInteropParseNote]
|
||||
// CHECK:STDERR: included from: fail_template_mismatch.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./templates.h:6:66: note: previous template template parameter is here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | template<template<typename> typename, template<typename> typename>
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~~~~~ ^
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE-13]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./templates.h:4:37: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | template<typename, typename> struct C {};
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTemplates(Cpp.A, Cpp.C);
|
||||
//@dump-sem-ir-end
|
||||
@@ -62,9 +53,7 @@ import Cpp library "templates.h";
|
||||
|
||||
class X {}
|
||||
|
||||
// CHECK:STDERR: fail_type_argument.carbon:[[@LINE+4]]:32: error: template argument for template template parameter must be a class template or type alias template [CppInteropParseError]
|
||||
// CHECK:STDERR: 12 | var x: Cpp.TwoTemplates(Cpp.A, X);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_type_argument.carbon:[[@LINE+2]]:32: error: template argument for template template parameter must be a class template or type alias template [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTemplates(Cpp.A, X);
|
||||
|
||||
@@ -74,9 +63,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_non_type_argument.carbon:[[@LINE+4]]:32: error: template argument for template template parameter must be a class template or type alias template [CppInteropParseError]
|
||||
// CHECK:STDERR: 10 | var x: Cpp.TwoTemplates(Cpp.A, true);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_non_type_argument.carbon:[[@LINE+2]]:32: error: template argument for template template parameter must be a class template or type alias template [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTemplates(Cpp.A, true);
|
||||
|
||||
|
||||
@@ -43,12 +43,8 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_non_type_argument.carbon:[[@LINE+7]]:28: error: cannot implicitly convert non-type value of type `bool` to `type` [ConversionFailureNonTypeToFacet]
|
||||
// CHECK:STDERR: var x: Cpp.TwoTypes(Cpp.A, true);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_non_type_argument.carbon:[[@LINE+4]]:28: note: type `bool` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: var x: Cpp.TwoTypes(Cpp.A, true);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_non_type_argument.carbon:[[@LINE+3]]:28-31: error: cannot implicitly convert non-type value of type `bool` to `type` [ConversionFailureNonTypeToFacet]
|
||||
// CHECK:STDERR: fail_non_type_argument.carbon:[[@LINE+2]]:28-31: note: type `bool` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTypes(Cpp.A, true);
|
||||
|
||||
@@ -58,9 +54,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_unsupported_type.carbon:[[@LINE+4]]:28: error: semantics TODO: `unsupported type used as template argument` [SemanticsTodo]
|
||||
// CHECK:STDERR: var x: Cpp.TwoTypes(Cpp.A, {});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_unsupported_type.carbon:[[@LINE+2]]:28-29: error: semantics TODO: `unsupported type used as template argument` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTypes(Cpp.A, {});
|
||||
|
||||
|
||||
@@ -28,17 +28,13 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_var_unsupported_type.carbon:[[@LINE+4]]:5: error: semantics TODO: `failed to map Carbon type to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR: var unsupported_x: () = ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_var_unsupported_type.carbon:[[@LINE+2]]:5-21: error: semantics TODO: `failed to map Carbon type to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
var unsupported_x: () = ();
|
||||
|
||||
inline Cpp '''
|
||||
void F() {
|
||||
// CHECK:STDERR: fail_var_unsupported_type.carbon:[[@LINE+4]]:11: error: no member named 'unsupported_x' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Carbon::unsupported_x;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_var_unsupported_type.carbon:[[@LINE+2]]:11-23: error: no member named 'unsupported_x' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::unsupported_x;
|
||||
}
|
||||
|
||||
@@ -48,23 +48,15 @@ UnusupportedType unsupported_global;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_unsupported_type.carbon:[[@LINE+2]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./unsupported_type.h:2:7: error: semantics TODO: `Unsupported: Type declaration: UnusupportedType` [SemanticsTodo]
|
||||
// CHECK:STDERR: using UnusupportedType = _BitInt(23);
|
||||
// CHECK:STDERR: ^
|
||||
import Cpp library "unsupported_type.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+11]]:21: note: in `Cpp` name lookup for `UnusupportedType` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.unsupported_global;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+5]]:21-40: note: in `Cpp` name lookup for `UnusupportedType` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+7]]:44: error: semantics TODO: `Unsupported: var type: UnusupportedType` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.unsupported_global;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+4]]:44: note: in `Cpp` name lookup for `unsupported_global` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.unsupported_global;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+3]]:44-65: error: semantics TODO: `Unsupported: var type: UnusupportedType` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+2]]:44-65: note: in `Cpp` name lookup for `unsupported_global` [InCppNameLookup]
|
||||
// CHECK:STDERR:
|
||||
let unused local: Cpp.UnusupportedType = Cpp.unsupported_global;
|
||||
}
|
||||
@@ -220,10 +212,10 @@ fn MyF() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_44: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_44: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %unsupported_global.ref: <error> = name_ref unsupported_global, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %UnusupportedType.ref: <error> = name_ref UnusupportedType, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %local: <error> = wrapper_binding local, <error> [concrete = <error>]
|
||||
|
||||
Reference in new issue
Block a user