We might want try a different strategy so hold back on this for the moment, but
fix the off-by-one error in the original function template.
This reverts commit r200190.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200193
91177308-0d34-0410-b5e6-
96231b3b80d8
///
/// \param FormatString A fixed diagnostic format string that will be hashed
/// and mapped to a unique DiagID.
- unsigned getCustomDiagID(Level L, ConstStringRef FormatString) {
- return Diags->getCustomDiagID((DiagnosticIDs::Level)L, FormatString);
+ template <unsigned N>
+ unsigned getCustomDiagID(Level L, const char (&FormatString)[N]) {
+ return Diags->getCustomDiagID((DiagnosticIDs::Level)L,
+ StringRef(FormatString, N - 1));
}
/// \brief Converts a diagnostic argument (as an intptr_t) into the string
namespace llvm {
// ADT's.
class StringRef;
- class ConstStringRef;
class Twine;
template<typename T> class ArrayRef;
template<typename T> class OwningPtr;
using llvm::None;
using llvm::Optional;
using llvm::StringRef;
- using llvm::ConstStringRef;
using llvm::Twine;
using llvm::ArrayRef;
using llvm::OwningPtr;