[clang-tools-extra] r283525 - Revert "Revert "Add a static_assert to enforce that parameters to llvm::format() are not totally unsafe""

Mehdi Amini via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 01:25:43 PDT 2016


Author: mehdi_amini
Date: Fri Oct  7 03:25:42 2016
New Revision: 283525

URL: http://llvm.org/viewvc/llvm-project?rev=283525&view=rev
Log:
Revert "Revert "Add a static_assert to enforce that parameters to llvm::format() are not totally unsafe""

This reverts commit r283510 and reapply r283509, with updates to
clang-tools-extra as well.

Modified:
    clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp?rev=283525&r1=283524&r2=283525&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp Fri Oct  7 03:25:42 2016
@@ -777,7 +777,7 @@ void IdentifierNamingCheck::check(const
         DEBUG(llvm::dbgs()
               << Decl->getLocStart().printToString(*Result.SourceManager)
               << llvm::format(": unable to split words for %s '%s'\n",
-                              KindName.c_str(), Name));
+                              KindName.c_str(), Name.str().c_str()));
       }
     } else {
       NamingCheckFailure &Failure = NamingCheckFailures[NamingCheckId(
@@ -811,7 +811,7 @@ void IdentifierNamingCheck::checkMacro(S
       DEBUG(
           llvm::dbgs() << MacroNameTok.getLocation().printToString(SourceMgr)
                        << llvm::format(": unable to split words for %s '%s'\n",
-                                       KindName.c_str(), Name));
+                                       KindName.c_str(), Name.str().c_str()));
     }
   } else {
     NamingCheckId ID(MI->getDefinitionLoc(), Name);




More information about the cfe-commits mailing list