[pseudo]Pull out the operator< test, NFC

Fix the review comment in https://reviews.llvm.org/D125479.
This commit is contained in:
Haojian Wu 2022-06-07 10:51:45 +02:00
parent cf88150c48
commit 28eeea1e27
2 changed files with 12 additions and 12 deletions

View File

@ -0,0 +1,12 @@
// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s
bool operator<();
// CHECK: translation-unit~simple-declaration := decl-specifier-seq init-declarator-list ;
// CHECK-NEXT: ├─decl-specifier-seq~BOOL
// CHECK-NEXT: ├─init-declarator-list~noptr-declarator := noptr-declarator parameters-and-qualifiers
// CHECK-NEXT: │ ├─noptr-declarator~operator-function-id := OPERATOR operator-name
// CHECK-NEXT: │ │ ├─OPERATOR
// CHECK-NEXT: │ │ └─operator-name~<
// CHECK-NEXT: │ └─parameters-and-qualifiers := ( )
// CHECK-NEXT: │ ├─(
// CHECK-NEXT: │ └─)
// CHECK-NEXT: └─;

View File

@ -21,15 +21,3 @@ void foo() {
// CHECK-NEXT: │ └─ptr-declarator~IDENTIFIER := tok[7]
// CHECK-NEXT: └─; := tok[8]
}
bool operator<();
// CHECK: declaration~simple-declaration := decl-specifier-seq init-declarator-list ;
// CHECK-NEXT: ├─decl-specifier-seq~BOOL
// CHECK-NEXT: ├─init-declarator-list~noptr-declarator := noptr-declarator parameters-and-qualifiers
// CHECK-NEXT: │ ├─noptr-declarator~operator-function-id := OPERATOR operator-name
// CHECK-NEXT: │ │ ├─OPERATOR
// CHECK-NEXT: │ │ └─operator-name~<
// CHECK-NEXT: │ └─parameters-and-qualifiers := ( )
// CHECK-NEXT: │ ├─(
// CHECK-NEXT: │ └─)
// CHECK-NEXT: └─;