[PATCH] D23466: ADT: Remove UB in ilist (and use a circular linked list)

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 13 14:54:04 PDT 2016


> On 2016-Aug-12, at 17:31, Duncan P. N. Exon Smith via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
>> 
>> ================
>> Comment at: include/llvm/ADT/ilist.h:324
>> @@ -424,7 +323,3 @@
>> 
>> -  iplist() : Head(this->provideInitialHead()) {}
>> -  ~iplist() {
>> -    if (!Head) return;
>> -    clear();
>> -    Traits::destroySentinel(getTail());
>> -  }
>> +  iplist() = default;
>> +  ~iplist() { clear(); }
>> ----------------
>> Could be removed?
> 
> Certainly the destructor needs to stay.  I'll remove the default constructor if it still compiles (but I'm always wary about what will or will not compile on MSVC...)

BTW, this didn't compile without `iplist() = default`.


More information about the llvm-commits mailing list