[clang] [clang] Serialization: support hashing null template arguments (PR #141890)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Thu May 29 17:54:03 PDT 2025


================
@@ -65,7 +65,9 @@ void TemplateArgumentHasher::AddTemplateArgument(TemplateArgument TA) {
 
   switch (Kind) {
   case TemplateArgument::Null:
-    llvm_unreachable("Expected valid TemplateArgument");
+    // These can occur in incomplete substitutions performed with code
+    // completion (see PartialOverloading).
----------------
mizvekov wrote:

It's the term of art within clang, and the name of the flag as used in source code.
A search on doxygen for this term should lead to:
```C++
  /// AddOverloadCandidate - Adds the given function to the set of
  /// candidate functions, using the given function call arguments.  If
  /// @p SuppressUserConversions, then don't allow user-defined
  /// conversions via constructors or conversion operators.
  ///
  /// \param PartialOverloading true if we are performing "partial" overloading
  /// based on an incomplete set of function arguments. This feature is used by
  /// code completion.
```

This term can also easily be greped for, and there are no irrelevant results.
But this is mostly undocumented.

https://github.com/llvm/llvm-project/pull/141890


More information about the cfe-commits mailing list