-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gccrs: fix ice when function is outside of context
Fixes #2477 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): We need to check if a function context exists gcc/testsuite/ChangeLog: * rust/compile/issue-2477.rs: New test. Signed-off-by: Philip Herron <[email protected]>
- Loading branch information
Showing
2 changed files
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const FOO: u32 = return 0; | ||
// { dg-error "return statement outside of function body" "" { target *-*-* } .-1 } | ||
// { dg-error "expected .u32. got" "" { target *-*-* } .-2 } |