[pseudo] Eliminate a false parse of structured binding declaration.
authorHaojian Wu <hokein.wu@gmail.com>
Fri, 19 Aug 2022 19:55:39 +0000 (21:55 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Tue, 23 Aug 2022 13:25:52 +0000 (15:25 +0200)
commitf7dc91ad5609fab02cb805861dd232cab492340d
treedfa8ee2420c562959c4ebb88fabe28e22f480a0e
parent562accddaaa243e9d4772f1d1ff1389f90594df2
[pseudo] Eliminate a false parse of structured binding declaration.

Using the guard to implement part of the rule https://eel.is/c++draft/dcl.pre#6.

```
void foo() {
  // can be parsed as
  //   - structured-binding declaration (a false parse)
  //   - assignment expression
  array[index] = value;
}
```

Differential Revision: https://reviews.llvm.org/D132260
clang-tools-extra/pseudo/lib/cxx/CXX.cpp
clang-tools-extra/pseudo/lib/cxx/cxx.bnf
clang-tools-extra/pseudo/test/cxx/structured-binding.cpp [new file with mode: 0644]