[llvm-branch-commits] [clang] [clang] NFC: introduce UnsignedOrNone as a replacement for std::optional<unsigned> (PR #134142)

Matheus Izvekov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Apr 2 17:23:05 PDT 2025


================
@@ -13343,28 +13344,25 @@ class Sema final : public SemaBase {
   /// The current index into pack expansion arguments that will be
   /// used for substitution of parameter packs.
   ///
-  /// The pack expansion index will be -1 to indicate that parameter packs
+  /// The pack expansion index will be none to indicate that parameter packs
   /// should be instantiated as themselves. Otherwise, the index specifies
   /// which argument within the parameter pack will be used for substitution.
-  int ArgumentPackSubstitutionIndex;
+  UnsignedOrNone ArgPackSubstIndex;
 
   /// RAII object used to change the argument pack substitution index
   /// within a \c Sema object.
   ///
-  /// See \c ArgumentPackSubstitutionIndex for more information.
-  class ArgumentPackSubstitutionIndexRAII {
+  /// See \c ArgPackSubstIndex for more information.
+  class ArgPackSubstIndexRAII {
----------------
mizvekov wrote:

Yep pretty much, it also made changing everything easier. There were lots of instances where we were storing this in a variable named in the shorter style, so hopefully it's more consistent now.

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


More information about the llvm-branch-commits mailing list