diff options
| author | Haojian Wu <hokein.wu@gmail.com> | 2022-07-26 22:27:09 +0200 |
|---|---|---|
| committer | Haojian Wu <hokein.wu@gmail.com> | 2022-07-28 11:01:15 +0200 |
| commit | 6f6c40a875c84443f255f3a6b4efc0bc0f2fb67a (patch) | |
| tree | 67c3c2237e6af1aab89352bf9be49fa5ce48d4a1 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h | |
| parent | dc95d0c525636aed53a3b38258efa2dff4c83edf (diff) | |
| download | llvm-6f6c40a875c84443f255f3a6b4efc0bc0f2fb67a.zip llvm-6f6c40a875c84443f255f3a6b4efc0bc0f2fb67a.tar.gz llvm-6f6c40a875c84443f255f3a6b4efc0bc0f2fb67a.tar.bz2 | |
[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
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h')
0 files changed, 0 insertions, 0 deletions
