aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman requested changes to this revision.
aaron.ballman added a reviewer: aaron.ballman.
This revision now requires changes to proceed.

================
Comment at: clang-tidy/modernize/DeprecatedHeadersCheck.cpp:79
@@ -69,3 +78,3 @@
     for (const auto &KeyValue :
          std::vector<std::pair<llvm::StringRef, std::string>>(
              {{"fenv.h", "cfenv"},
----------------
This will definitely fail in MSVC 2013.

================
Comment at: clang-tidy/modernize/DeprecatedHeadersCheck.cpp:89
@@ +88,3 @@
+  for (const auto &Key :
+       std::vector<std::string>({"stdalign.h", "stdbool.h", "iso646.h"})) {
+    DeleteHeaders.insert(Key);
----------------
This one will work fine, but this pattern does not seem safe to me (same as 
above). StringSet::insert expects a StringRef. This vector (and all the 
std::string elements) will be destroyed at the end of the for loop, which means 
the StringSet will have dangling references.


https://reviews.llvm.org/D17990



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to