diff options
author | Mark Wielaard <mark@klomp.org> | 2021-08-14 20:41:26 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2021-08-14 20:42:24 +0200 |
commit | ee3d0b09dc7777cd04587a83f5cfe785101f0dc9 (patch) | |
tree | 8be58e078de992e2b2743557d747521b27b173ae /gcc/rust/backend/rust-compile-resolve-path.cc | |
parent | e53f1acb282a226cd037fd21e587c83f09c2e4af (diff) | |
download | gcc-ee3d0b09dc7777cd04587a83f5cfe785101f0dc9.zip gcc-ee3d0b09dc7777cd04587a83f5cfe785101f0dc9.tar.gz gcc-ee3d0b09dc7777cd04587a83f5cfe785101f0dc9.tar.bz2 |
parse if expression with unary minus or not expression
An if conditional expression doesn't need brackets, but that means
that it doesn't accept struct expressions. Those are not easy to
distinquish from the block that follows. What isn't immediately clear
from the grammar is that unary conditions like minus '-' or not '!'
also shouldn't accept struct expressions (when part of an if
conditional expression) because those also cannot be easily
distinquished from the block that follows.
Add a testcase "ifunaryexpr.rs" that shows a couple of contructs that
should be accepted as if conditional expressions and fix the parser to
pass the restriction of not accepting struct expressions after a unary
expression.
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
0 files changed, 0 insertions, 0 deletions