[PATCH] D23198: clang-rename rename-all: support reading old/newname pairs from a YAML file

Miklos Vajna via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 11:26:29 PDT 2016


vmiklos added inline comments.

================
Comment at: clang-rename/tool/ClangRename.cpp:65
@@ +64,3 @@
+
+  RenameAllInfo() : Offset(0) {}
+};
----------------
omtcyfz wrote:
> omtcyfz wrote:
> > vmiklos wrote:
> > > omtcyfz wrote:
> > > > AFAIK there's no need to do that, integer types are by default initialized with 0, aren't they?
> > > Are you sure? Here is a minimal version that shows what goes wrong when that's not initialized explicitly: http://pastebin.com/raw/2ZsUgWf6 The "Use of uninitialised value of size 8" goes away with an explicit initialization.
> > Well, in this case - yes. But in that case the default unsigned constructor isn't called.
> > 
> > What I meant is:
> > 
> > ```
> > RenameAllInfo() : Offset(0) {}
> > ```
> > - > 
> > ```
> > RenameAllInfo() : Offset() {}
> > ```
> > 
> > In this case Offset is default-constructed. However, it is also true that one might argue that it's less "trivial" (whatever "triviality" definition would be :]). I guess it's fine to leave it like this.
> > Well, in this case - yes. But in that case the default unsigned constructor isn't called.
> 
> <to prevent confusion>
> 
> -> Well, in the case you sent - yes. But there is no default-construction there as there is no constructor with initializer list at all.
Ah, I see what you mean. :-) I don't mind either way, but then I'll leave it as-is for now.


https://reviews.llvm.org/D23198





More information about the cfe-commits mailing list