[clang-tools-extra] r360007 - Fix up after r360006.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Sun May 5 21:00:45 PDT 2019


Author: rsmith
Date: Sun May  5 21:00:45 2019
New Revision: 360007

URL: http://llvm.org/viewvc/llvm-project?rev=360007&view=rev
Log:
Fix up after r360006.

Modified:
    clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp?rev=360007&r1=360006&r2=360007&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp Sun May  5 21:00:45 2019
@@ -278,7 +278,7 @@ bool MakeSmartPtrCheck::replaceNew(Diagn
     return false;
 
   std::string ArraySizeExpr;
-  if (const auto* ArraySize = New->getArraySize()) {
+  if (const auto* ArraySize = New->getArraySize().getValueOr(nullptr)) {
     ArraySizeExpr = Lexer::getSourceText(CharSourceRange::getTokenRange(
                                              ArraySize->getSourceRange()),
                                          SM, getLangOpts())




More information about the cfe-commits mailing list