[clang] [Clang][ASTImporter] Fix cycle in importing template specialization on auto type with typename (PR #162514)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 11 03:08:16 PST 2025
================
@@ -254,6 +256,13 @@ class TypeSourceInfo;
/// Declaration (from, to) pairs that are known not to be equivalent
/// (which we have already complained about).
NonEquivalentDeclSet NonEquivalentDecls;
+ /// A FunctionDecl can have properties that have a reference to the
+ /// function itself and are imported before the function is created. This
+ /// can come for example from auto return type or when template parameters
+ /// are used in the return type or parameters. This member is used to detect
+ /// cyclic import of FunctionDecl objects to avoid infinite recursion.
+ std::unique_ptr<FunctionReturnTypeDeclCycleDetector>
+ FunctionReturnTypeCycleDetector;
----------------
ganenkokb-yandex wrote:
as unique_ptr it requires only forward declaration. You need full class declaration otherwise.
https://github.com/llvm/llvm-project/pull/162514
More information about the cfe-commits
mailing list