diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-18 07:46:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-18 07:46:42 +0000 |
commit | 520987fc4e5e60c80bcce613b0f8813ffb2fdca0 (patch) | |
tree | b012581761c6b03683c6585c876f61ffd69a4fa7 | |
parent | 28030c9b0237e83ddea6a6aa2dae3aabf9d1d577 (diff) |
Give DiagnosticInfo a real copy constructor, even though it
is destructive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59507 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/Diagnostic.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index 566b5e3d48..fb1d7a629e 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -207,7 +207,7 @@ private: /// this reason, we stick state in the Diagnostic class, see the comment there /// for more info. class DiagnosticInfo { - Diagnostic *DiagObj; + mutable Diagnostic *DiagObj; FullSourceLoc Loc; unsigned DiagID; void operator=(const DiagnosticInfo&); // DO NOT IMPLEMENT @@ -221,7 +221,7 @@ public: /// Copy constructor. When copied, this "takes" the diagnostic info from the /// input and neuters it. - DiagnosticInfo(DiagnosticInfo &D) { + DiagnosticInfo(const DiagnosticInfo &D) { DiagObj = D.DiagObj; Loc = D.Loc; DiagID = D.DiagID; @@ -262,7 +262,7 @@ public: assert(Idx < DiagObj->NumDiagRanges && "Invalid diagnostic range index!"); return *DiagObj->DiagRanges[Idx]; } - + DiagnosticInfo &operator<<(const std::string &S) { assert((unsigned)DiagObj->NumDiagArgs < sizeof(DiagObj->DiagArguments)/sizeof(DiagObj->DiagArguments[0]) && |