[clang] [Clang][Sema] Remove invalid ctor (NFC) (PR #82161)

via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 18 04:09:43 PST 2024


https://github.com/Smertig created https://github.com/llvm/llvm-project/pull/82161

`TemplateArgumentLocInventIterator` default constructor should not exists
https://github.com/llvm/llvm-project/blob/3496927edcd0685807351ba88a7e2cfb006e1c0d/clang/lib/Sema/TreeTransform.h#L4742
 because it doesn't and couldn't initialize `Self` member that is reference:
https://github.com/llvm/llvm-project/blob/3496927edcd0685807351ba88a7e2cfb006e1c0d/clang/lib/Sema/TreeTransform.h#L4721-L4723

Instantiation of this constructor is always a compile-time error. 

Please note, that I didn't run any tests, because cannot imagine situation where this constructor can be properly used. There's no new tests for this fix for the same reason.

>From fb582783665aa67ec2895d4a847deeb4f7768e90 Mon Sep 17 00:00:00 2001
From: Smertig <akaraevz at mail.ru>
Date: Sun, 18 Feb 2024 13:58:40 +0200
Subject: [PATCH] [Clang][Sema] Remove invalid ctor (NFC)

- TemplateArgumentLocInventIterator default constructor should not exists, because it doesn't and couldn't initialize 'Self' member that is reference. Instantiation of this ctor is always a compile-time error.
---
 clang/lib/Sema/TreeTransform.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index a32a585531873a..07f11c965cde62 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -4739,8 +4739,6 @@ class TemplateArgumentLocInventIterator {
     const TemplateArgumentLoc *operator->() const { return &Arg; }
   };
 
-  TemplateArgumentLocInventIterator() { }
-
   explicit TemplateArgumentLocInventIterator(TreeTransform<Derived> &Self,
                                              InputIterator Iter)
     : Self(Self), Iter(Iter) { }



More information about the cfe-commits mailing list