alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:453
+
+  StringRef FileName(Loc.printToString(Loc.getManager()));
+  if(getHeaderFilter()->match(FileName))
----------------
That'll result in a dangling pointer. `SourceLocation::printToString` returns a 
temporary std::string that will be destroyed at the end of expression, but 
`FileName` will point to its data.

Also, the `printToString` method will contain much more than just the filename. 
`SourceManager::getPresumedLoc` should do a better job here.


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

https://reviews.llvm.org/D59135



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

Reply via email to