[PATCH] D67649: [FileCheck] Move private interface to its own header

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 09:07:07 PDT 2019


thopre marked 2 inline comments as done.
thopre added inline comments.


================
Comment at: llvm/include/llvm/Support/FileCheck.h:147
+  //CXX17 TODO: make this a std::vector.
+  std::vector<FileCheckString> *CheckStrings;
 
----------------
arichardson wrote:
> Why can't this be by-vaule? Shouldn't a vector of an incomplete type be fine as long as you have an out-of-line ctor+dtor?
I think it works in practice with ctor+dtor but is undefined behavior according to C++14 section 17.6.4.8 paragraph 2.5 IIRC.


================
Comment at: llvm/lib/Support/FileCheck.cpp:1726
+FileCheck::~FileCheck() {
+  delete PatternContext;
+  delete CheckStrings;
----------------
arichardson wrote:
> Use `unique_ptr` instead of new delete?
I had errors at first because of PatternContext being incomplete but the standards does allow unique_ptr to have an incomplete type parameter so I'll try again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67649





More information about the llvm-commits mailing list