mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
C++ Interop: Don't crash when trying to call a C++ function with undeduced return type (#6363)
This crashed on trying to build a C++ thunk because the error wasn't propagated. Part of #5436.
This commit is contained in:
@@ -35,6 +35,26 @@ fn F() {
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Undeduced return type
|
||||
// ============================================================================
|
||||
|
||||
// --- fail_return_undeduced_auto.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
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:
|
||||
Cpp.UndeducedReturn();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- import_multiple.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
|
||||
Reference in New Issue
Block a user