llvm-capstone/clang-tools-extra
Nathan Ridge 0c1dcd6752 [clangd] [HeuristicResolver] Protect against infinite recursion on DependentNameTypes (#83542)
When resolving names inside templates that implement recursive
compile-time functions (e.g. waldo<N>::type is defined in terms
of waldo<N-1>::type), HeuristicResolver could get into an infinite
recursion, specifically one where resolveDependentNameType() can
be called recursively with the same DependentNameType*.

To guard against this, HeuristicResolver tracks, for each external
call into a HeuristicResolver function, the set of DependentNameTypes
that it has seen, and bails if it sees the same DependentNameType again.

To implement this, a helper class HeuristicResolverImpl is introduced
to store state that persists for the duration of an external call into
HeuristicResolver (but does not persist between such calls).

Fixes https://github.com/clangd/clangd/issues/1951

(cherry picked from commit e6e53ca8470d719882539359ebe3ad8b442a8cb0)
2024-03-16 15:26:15 -07:00
..
clang-apply-replacements [clang-apply-replacements] Deduplicate Implementation of collectReplacementsFromDirectory (NFC) (#78630) 2024-01-19 15:57:02 +03:00
clang-change-namespace Use StringRef::{starts,ends}_with (NFC) 2023-12-14 07:53:20 -08:00
clang-doc [clang-doc] Use SmallString::operator std::string (NFC) 2024-01-14 12:17:56 -08:00
clang-include-fixer [emacs] Fix Emacs library formatting (#76110) 2024-01-10 13:14:21 +01:00
clang-move [clang] NFCI: Use FileEntryRef for FileID creation (#67838) 2023-10-03 13:07:46 -07:00
clang-query [clang-query] Use StringRef::ltrim (NFC) 2024-01-10 20:31:41 -08:00
clang-reorder-fields [clang] NFCI: Use FileEntryRef for FileID creation (#67838) 2023-10-03 13:07:46 -07:00
clang-tidy [misc-coroutine-hostile-raii] Use getOperand instead of getCommonExpr. (#79206) 2024-01-23 23:07:00 +01:00
clangd [clangd] [HeuristicResolver] Protect against infinite recursion on DependentNameTypes (#83542) 2024-03-16 15:26:15 -07:00
docs [clangd] Add clangd 18 release notes (#84436) 2024-03-14 21:37:43 -07:00
include-cleaner [include-cleaner] Add --only-headers flag, opposite of --ignore-headers (#78714) 2024-01-22 16:03:37 +01:00
modularize [modularize] Use SmallString::operator std::string (NFC) 2024-01-15 21:25:51 -08:00
pp-trace [clang] NFCI: Use FileEntryRef in 'clang-tools-extra' 2023-09-10 19:53:54 -07:00
pseudo Use StringRef::{starts,ends}_with (NFC) 2023-12-14 07:53:20 -08:00
test [misc-coroutine-hostile-raii] Use getOperand instead of getCommonExpr. (#79206) 2024-01-23 23:07:00 +01:00
tool-template
unittests Use StringRef::{starts,ends}_with (NFC) 2023-12-14 07:53:20 -08: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 Update the clang and clang-tools-extra code owners files 2022-09-06 08:28:03 -04:00
LICENSE.TXT
README.txt [NFC] update clang-tools-extra README.txt 2022-06-10 16:59:57 +05:30

//===----------------------------------------------------------------------===//
// 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/