[clang] e7c2466 - [Concepts] Fix build failures in D41569

Saar Raz via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 15:53:57 PST 2019


Author: Saar Raz
Date: 2019-12-06T01:53:18+02:00
New Revision: e7c24667816edc1a3754b46a49f9eac011dc1fee

URL: https://github.com/llvm/llvm-project/commit/e7c24667816edc1a3754b46a49f9eac011dc1fee
DIFF: https://github.com/llvm/llvm-project/commit/e7c24667816edc1a3754b46a49f9eac011dc1fee.diff

LOG: [Concepts] Fix build failures in D41569

Fix build failures in previous commit.

Added: 
    

Modified: 
    clang/lib/AST/ASTConcept.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ASTConcept.cpp b/clang/lib/AST/ASTConcept.cpp
index b38b0952145f..fc32e768d92f 100644
--- a/clang/lib/AST/ASTConcept.cpp
+++ b/clang/lib/AST/ASTConcept.cpp
@@ -29,10 +29,10 @@ ASTConstraintSatisfaction::ASTConstraintSatisfaction(const ASTContext &C,
                                          Detail.second.get<Expr *>())};
     else {
       auto &SubstitutionDiagnostic =
-          *Detail.second.get<std::pair<SourceLocation, std::string> *>();
+          *Detail.second.get<std::pair<SourceLocation, StringRef> *>();
       unsigned MessageSize = SubstitutionDiagnostic.second.size();
       char *Mem = new (C) char[MessageSize];
-      memcpy(Mem, SubstitutionDiagnostic.second.c_str(), MessageSize);
+      memcpy(Mem, SubstitutionDiagnostic.second.data(), MessageSize);
       auto *NewSubstDiag = new (C) std::pair<SourceLocation, StringRef>(
           SubstitutionDiagnostic.first, StringRef(Mem, MessageSize));
       new (getTrailingObjects<UnsatisfiedConstraintRecord>() + I)


        


More information about the cfe-commits mailing list