From 55857c5bed5fc97dd468606b2f0615c445e3fa60 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 24 Aug 2018 22:33:53 +0000 Subject: [PATCH] Add documentation comment to ForwardTemplateReference. This node doesn't directly correspond to a mangled name fragment, so it's useful to explicitly describe when it's created and what it's for. llvm-svn: 340664 --- llvm/include/llvm/Demangle/ItaniumDemangle.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h index af717b3..d74f83e 100644 --- a/llvm/include/llvm/Demangle/ItaniumDemangle.h +++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h @@ -1118,6 +1118,24 @@ public: } }; +/// A forward-reference to a template argument that was not known at the point +/// where the template parameter name was parsed in a mangling. +/// +/// This is created when demangling the name of a specialization of a +/// conversion function template: +/// +/// \code +/// struct A { +/// template operator T*(); +/// }; +/// \endcode +/// +/// When demangling a specialization of the conversion function template, we +/// encounter the name of the template (including the \c T) before we reach +/// the template argument list, so we cannot substitute the parameter name +/// for the corresponding argument while parsing. Instead, we create a +/// \c ForwardTemplateReference node that is resolved after we parse the +/// template arguments. struct ForwardTemplateReference : Node { size_t Index; Node *Ref = nullptr; -- 2.7.4