mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 23:16:35 +00:00

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
7 lines
314 B
C++
7 lines
314 B
C++
// RUN: clang-pseudo -grammar=cxx -source=%s --start-symbol=statement-seq --print-forest | FileCheck %s
|
|
|
|
// Verify there is no false parse of the structured binding declaration.
|
|
ABC[post] = abc;
|
|
// CHECK: statement-seq~expression-statement := expression ;
|
|
// CHECK: postfix-expression [ expr-or-braced-init-list ]
|