================
@@ -1660,7 +1660,7 @@ class Record {
   // this record.
   SmallVector<SMLoc, 4> Locs;
   SmallVector<SMLoc, 0> ForwardDeclarationLocs;
-  SmallVector<SMRange, 0> ReferenceLocs;
+  mutable SmallVector<SMRange, 0> ReferenceLocs;
----------------
jurahul wrote:

No, this is for another case. Essentially, `appendReferenceLoc` is only called 
from TGParser, and now that all those pointers are const (because in most 
cases, reference locs is added post creation of the record) all those functions 
need to either work with const pointers (by making the `ReferenceLocs` mutable) 
or we just const_cast<> in TGParser at the point where it's called. Either way 
works. Let me know what you think is better, and I will make all of them 
consistent.

Maybe const_cast<> so that the change is localized to the actual place?

https://github.com/llvm/llvm-project/pull/110747
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to