summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 64959495269..5ea27c979b1 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -176,13 +176,14 @@ bool Sema::Diag(SourceLocation Loc, unsigned DiagID) {
}
bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg) {
- PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, &Msg, 1);
+ const std::string *Strs[] = { &Msg };
+ PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, Strs, 1);
return true;
}
bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1,
const std::string &Msg2) {
- std::string MsgArr[] = { Msg1, Msg2 };
+ const std::string *MsgArr[] = { &Msg1, &Msg2 };
PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, MsgArr, 2);
return true;
}
@@ -194,21 +195,22 @@ bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const SourceRange& Range) {
bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
const SourceRange& Range) {
- PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, &Msg, 1, &Range,1);
+ const std::string *Strs[] = { &Msg };
+ PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, Strs, 1, &Range,1);
return true;
}
bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1,
const std::string &Msg2, const SourceRange& Range) {
- std::string MsgArr[] = { Msg1, Msg2 };
+ const std::string *MsgArr[] = { &Msg1, &Msg2 };
PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, MsgArr, 2, &Range, 1);
return true;
}
bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1,
const std::string &Msg2, const std::string &Msg3,
- const SourceRange& R1) {
- std::string MsgArr[] = { Msg1, Msg2, Msg3 };
+ const SourceRange &R1) {
+ const std::string *MsgArr[] = { &Msg1, &Msg2, &Msg3 };
PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, MsgArr, 3, &R1, 1);
return true;
}
@@ -223,14 +225,15 @@ bool Sema::Diag(SourceLocation Loc, unsigned DiagID,
bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
const SourceRange& R1, const SourceRange& R2) {
SourceRange RangeArr[] = { R1, R2 };
- PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, &Msg, 1, RangeArr, 2);
+ const std::string *Strs[] = { &Msg };
+ PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, Strs, 1, RangeArr, 2);
return true;
}
bool Sema::Diag(SourceLocation Range, unsigned DiagID, const std::string &Msg1,
const std::string &Msg2, const SourceRange& R1,
const SourceRange& R2) {
- std::string MsgArr[] = { Msg1, Msg2 };
+ const std::string *MsgArr[] = { &Msg1, &Msg2 };
SourceRange RangeArr[] = { R1, R2 };
PP.getDiagnostics().Report(PP.getFullLoc(Range),DiagID, MsgArr,2,RangeArr, 2);
return true;
OpenPOWER on IntegriCloud