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

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 09:33:07 PDT 2016


omtcyfz added inline comments.

================
Comment at: clang-rename/tool/ClangRename.cpp:65
@@ +64,3 @@
+
+  RenameAllInfo() : Offset(0) {}
+};
----------------
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.


https://reviews.llvm.org/D23198





More information about the cfe-commits mailing list