[cfe-commits] r59507 - /cfe/trunk/include/clang/Basic/Diagnostic.h

Chris Lattner sabre at nondot.org
Mon Nov 17 23:46:43 PST 2008


Author: lattner
Date: Tue Nov 18 01:46:42 2008
New Revision: 59507

URL: http://llvm.org/viewvc/llvm-project?rev=59507&view=rev
Log:
Give DiagnosticInfo a real copy constructor, even though it
is destructive.

Modified:
    cfe/trunk/include/clang/Basic/Diagnostic.h

Modified: cfe/trunk/include/clang/Basic/Diagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Diagnostic.h?rev=59507&r1=59506&r2=59507&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/Diagnostic.h (original)
+++ cfe/trunk/include/clang/Basic/Diagnostic.h Tue Nov 18 01:46:42 2008
@@ -207,7 +207,7 @@
 /// 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 @@
   
   /// 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 @@
     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]) &&





More information about the cfe-commits mailing list