Skip to content

Commit 6429c47

Browse files
committed
more cleanups
1 parent 5f9c4f9 commit 6429c47

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

clang/include/clang/AST/ASTConcept.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ using UnsatisfiedConstraintRecord =
4444
/// The result of a constraint satisfaction check, containing the necessary
4545
/// information to diagnose an unsatisfied constraint.
4646
class ConstraintSatisfaction : public llvm::FoldingSetNode {
47-
private:
4847
// The template-like entity that 'owns' the constraint checked here (can be a
4948
// constrained entity or a concept).
5049
const NamedDecl *ConstraintOwner = nullptr;

clang/lib/Sema/SemaConcept.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,7 @@ StringRef allocateStringFromConceptDiagnostic(const Sema &S,
508508
SmallString<128> DiagString;
509509
DiagString = ": ";
510510
Diag.EmitToString(S.getDiagnostics(), DiagString);
511-
unsigned MessageSize = DiagString.size();
512-
char *Mem = new (S.Context) char[MessageSize];
513-
memcpy(Mem, DiagString.c_str(), MessageSize);
514-
return StringRef(Mem, MessageSize);
511+
return S.getASTContext().backupStr(DiagString);
515512
}
516513

517514
} // namespace

0 commit comments

Comments
 (0)