llvm-project/clang-tools-extra
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
..
clang-apply-replacements Use the range-based overload of llvm::sort where possible 2022-07-23 15:13:25 +02:00
clang-change-namespace [clang] Implement ElaboratedType sugaring for types written bare 2022-07-27 11:10:54 +02:00
clang-doc [clang-doc] Add check for pointer validity 2022-07-22 17:36:30 +00:00
clang-include-fixer [clang] Implement ElaboratedType sugaring for types written bare 2022-07-27 11:10:54 +02:00
clang-move [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
clang-query [clang-query] Add check to prevent setting srcloc when no introspection is available. 2021-04-28 11:21:35 +01:00
clang-reorder-fields Use llvm::sort instead of std::sort where possible 2022-07-23 15:19:05 +02:00
clang-tidy [clang-tidy] Add CLANG_TIDY_CONFUSABLE_CHARS_GEN cmake cache variable to avoid building when cross compiling 2022-07-28 12:00:21 +03:00
clangd Use pseudoparser-based folding ranges in ClangdServer. 2022-07-28 05:43:17 +02:00
docs Bump the trunk major version to 16 2022-07-26 21:34:45 -07:00
include-cleaner [include-cleaner] Fix build error in unit test 2022-06-09 03:38:13 -04:00
modularize Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 00:31:44 -07:00
pp-trace [pp-trace] Print HashLoc in InclusionDirective callback 2022-06-03 19:29:59 +08:00
pseudo [pseudo] Eliminate the false `::` nested-name-specifier ambiguity 2022-07-28 11:01:15 +02:00
test [clang] Implement ElaboratedType sugaring for types written bare 2022-07-27 11:10:54 +02:00
tool-template
unittests [clang] Implement ElaboratedType sugaring for types written bare 2022-07-27 11:10:54 +02:00
.gitignore
CMakeLists.txt Generalize "check-all" umbrella targets, use for check-clang-tools 2022-05-06 12:30:49 +02:00
CODE_OWNERS.TXT
LICENSE.TXT
README.txt [NFC] update clang-tools-extra README.txt 2022-06-10 16:59:57 +05:30

README.txt

//===----------------------------------------------------------------------===//
// Clang Tools repository
//===----------------------------------------------------------------------===//

Welcome to the repository of extra Clang Tools.  This repository holds tools
that are developed as part of the LLVM compiler infrastructure project and the
Clang frontend.  These tools are kept in a separate "extra" repository to
allow lighter weight checkouts of the core Clang codebase.

All discussion regarding Clang, Clang-based tools, and code in this repository
should be held using the standard Clang forum:
  https://discourse.llvm.org/c/clang

Code review for this tree should take place on the standard Clang patch and
commit lists:
  http://lists.llvm.org/mailman/listinfo/cfe-commits

If you find a bug in these tools, please file it in the LLVM bug tracker:
  https://github.com/llvm/llvm-project/issues/