njames93 marked an inline comment as done.
njames93 added inline comments.

================
Comment at: clang-tools-extra/clang-tidy/ClangTidyCheck.cpp:224
+  else
+    consumeError(ValueOr.takeError());
+  return llvm::None;
----------------
gribozavr2 wrote:
> Is this specialization defined only because parsing a string option can never 
> fail? I'd let this special case behavior fall out of the primary template if 
> possible.
It's because the call to get that returns a `std::string` isn't a template.
So in the actual template definition of `getOptional`, trying to call `get<T>` 
when `T` is a `std::string` results in a compile time error.
Consuming the error makes sense knowing the it will always be a 
`MissingOptionError`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84812

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

Reply via email to