const DisplayHint Hint;
std::vector<SourceRange> ranges;
-public:
+ // Do not implement:
+ PathDiagnosticPiece();
+ PathDiagnosticPiece(const PathDiagnosticPiece &P);
+ PathDiagnosticPiece& operator=(const PathDiagnosticPiece &P);
+public:
PathDiagnosticPiece(FullSourceLoc pos, const std::string& s,
Kind k = Event,
DisplayHint hint = Above);
std::string Desc;
std::string Category;
std::vector<std::string> OtherDesc;
-
+
public:
- PathDiagnostic() : Size(0) {}
-
+ PathDiagnostic();
+
PathDiagnostic(const char* bugtype, const char* desc, const char* category);
PathDiagnostic(const std::string& bugtype, const std::string& desc,
PathDiagnosticPiece::PathDiagnosticPiece(FullSourceLoc pos,
const std::string& s,
Kind k, DisplayHint hint)
- : Pos(pos), str(s, 0, GetNumCharsToLastNonPeriod(s)), kind(k), Hint(hint) {}
+ : Pos(pos), str(s, 0, GetNumCharsToLastNonPeriod(s)), kind(k), Hint(hint) {
+ assert(Pos.isValid() &&
+ "PathDiagnosticPiece's must have a valid location.");
+}
PathDiagnosticPiece::PathDiagnosticPiece(FullSourceLoc pos,
const char* s, Kind k,
DisplayHint hint)
- : Pos(pos), str(s, GetNumCharsToLastNonPeriod(s)), kind(k), Hint(hint) {}
+ : Pos(pos), str(s, GetNumCharsToLastNonPeriod(s)), kind(k), Hint(hint) {
+ assert(Pos.isValid() &&
+ "PathDiagnosticPiece's must have a valid location.");
+}
+
+PathDiagnostic::PathDiagnostic() : Size(0) {}
PathDiagnostic::~PathDiagnostic() {
for (iterator I = begin(), E = end(); I != E; ++I) delete &*I;
PathDiagnostic::PathDiagnostic(const char* bugtype, const char* desc,
const char* category)
- : BugType(bugtype, GetNumCharsToLastNonPeriod(bugtype)),
+ : Size(0),
+ BugType(bugtype, GetNumCharsToLastNonPeriod(bugtype)),
Desc(desc, GetNumCharsToLastNonPeriod(desc)),
Category(category, GetNumCharsToLastNonPeriod(category)) {}
PathDiagnostic::PathDiagnostic(const std::string& bugtype,
const std::string& desc,
const std::string& category)
- : BugType(bugtype, 0, GetNumCharsToLastNonPeriod(bugtype)),
+ : Size(0),
+ BugType(bugtype, 0, GetNumCharsToLastNonPeriod(bugtype)),
Desc(desc, 0, GetNumCharsToLastNonPeriod(desc)),
Category(category, 0, GetNumCharsToLastNonPeriod(category)) {}