llvm-project/clang-tools-extra/pseudo/test
Haojian Wu 6f6c40a875 [pseudo] Eliminate the false `::` nested-name-specifier ambiguity
The solution is to favor the longest possible nest-name-specifier, and
drop other alternatives by using the guard, per per C++ [basic.lookup.qual.general].

Motivated cases:

```
Foo::Foo() {};
// the constructor can be parsed as:
//  - Foo ::Foo(); // where the first Foo is return-type, and ::Foo is the function declarator
//  + Foo::Foo(); // where Foo::Foo is the function declarator
```

```
void test() {

// a very slow parsing case when there are many qualifers!
X::Y::Z;
// The statement can be parsed as:
//  - X ::Y::Z; // ::Y::Z is the declarator
//  - X::Y ::Z; // ::Z is the declarator
//  + X::Y::Z;  // a declaration without declarator (X::Y::Z is decl-specifier-seq)
//  + X::Y::Z;  // a qualifed-id expression
}
```

Differential Revision: https://reviews.llvm.org/D130511
2022-07-28 11:01:15 +02:00
..
Unit Reapply [pseudo] Move pseudoparser from clang to clang-tools-extra" 2022-03-16 01:10:55 +01:00
crash [pseudo] Only expand UCNs for raw_identifiers 2022-05-06 08:53:31 +02:00
cxx [pseudo] Eliminate the false `::` nested-name-specifier ambiguity 2022-07-28 11:01:15 +02:00
.clang-format [pseudo] Don't clang-format test inputs. NFC 2022-06-09 14:18:30 +02:00
CMakeLists.txt [pseudo] Add fuzzer for the pseudoparser. 2022-05-06 09:22:28 +02:00
check-cxx-bnf.test [pseudo] Update the cxx.bnf path in comments to reflect the new 2022-06-29 15:10:39 +02:00
fuzzer.cpp [pseudo] Eliminate multiple-specified-types ambiguities using guards 2022-07-25 12:57:07 +02:00
glr-variant-start.cpp [pseudo] Support parsing variant target symbols. 2022-05-16 10:38:16 +02:00
glr.cpp [pseudo] Add ambiguity & unparseability metrics to -print-statistics 2022-07-22 10:35:06 +02:00
html-forest.c [pseudo] Add `clang-pseudo -html-forest=<output.html>`, an HTML forest browser 2022-07-19 22:32:11 +02:00
lex.c [pseudo] Strip directives from a token stream 2022-05-06 12:15:08 +02:00
lit.cfg.py Reapply [pseudo] Move pseudoparser from clang to clang-tools-extra" 2022-03-16 01:10:55 +01:00
lit.local.cfg [pseudo] Move cxx grammar into the cxx/ directory. NFC 2022-06-28 16:02:10 +02:00
lit.site.cfg.py.in [cmake] Provide CURRENT_TOOLS_DIR centrally, replacing CLANG_TOOLS_DIR 2022-03-25 20:22:01 +01:00
lr-build-basic.test [pseudo] Check follow-sets instead of tying reduce actions to lookahead tokens. 2022-06-28 00:36:16 +02:00
lr-build-conflicts.test [pseudo] Check follow-sets instead of tying reduce actions to lookahead tokens. 2022-06-28 00:36:16 +02:00
strip-directives.c [pseudo] Strip directives from a token stream 2022-05-06 12:15:08 +02:00