[PATCH] D69758: [Gnu toolchain] Look at standard GCC paths for libstdcxx by default

Kristina Brooks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 13 12:14:42 PST 2019


kristina added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:2623
+  int MaxVersion = 0;
+  std::string MaxVersionString = "";
+  for (llvm::vfs::directory_iterator LI = vfs.dir_begin(base, EC), LE;
----------------
sthibaul wrote:
> kristina wrote:
> > No need for `= ""` here.
> (it's the existing code just moved to here actually)
> 
> I'm afraid that a not-that-smart compiler would complain that it could be used uninitialized below, I have seen such cases produce warnings before because the compiler was not making the connection with MaxVersion being 0. Are we confident that this will not pose problem?
`std::string` has a default constructor, but the `int` needs to be initialized. I was only referring to the string.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69758/new/

https://reviews.llvm.org/D69758





More information about the cfe-commits mailing list