diff options
Diffstat (limited to 'tools/libclang/CIndexDiagnostic.cpp')
-rw-r--r-- | tools/libclang/CIndexDiagnostic.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/libclang/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp index fa3b1ce..0fcdab7 100644 --- a/tools/libclang/CIndexDiagnostic.cpp +++ b/tools/libclang/CIndexDiagnostic.cpp @@ -220,7 +220,8 @@ CXString clang_getDiagnosticOption(CXDiagnostic Diag, CXString *Disable) { return createCXString(""); unsigned ID = StoredDiag->Diag.getID(); - if (const char *Option = DiagnosticIDs::getWarningOptionForDiag(ID)) { + llvm::StringRef Option = DiagnosticIDs::getWarningOptionForDiag(ID); + if (!Option.empty()) { if (Disable) *Disable = createCXString((llvm::Twine("-Wno-") + Option).str()); return createCXString((llvm::Twine("-W") + Option).str()); |