diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2016-03-24 15:26:43 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2016-03-24 15:26:43 +0000 |
commit | e6d29c9928077ae9a8fe78e0f0091f577568f541 (patch) | |
tree | 58372e3d0be023dc19d10c29105206931633d7f2 /llvm | |
parent | e1c42ac12b29462944af83719c92fa5546da6a90 (diff) | |
download | bcm5719-llvm-e6d29c9928077ae9a8fe78e0f0091f577568f541.tar.gz bcm5719-llvm-e6d29c9928077ae9a8fe78e0f0091f577568f541.zip |
Define ErrorInfo::ID explicitly.
llvm-svn: 264293
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Support/Error.h | 3 | ||||
-rw-r--r-- | llvm/lib/Support/Error.cpp | 3 | ||||
-rw-r--r-- | llvm/unittests/Support/ErrorTest.cpp | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h index 1432cb1a06d..ed3d4077a65 100644 --- a/llvm/include/llvm/Support/Error.h +++ b/llvm/include/llvm/Support/Error.h @@ -291,9 +291,6 @@ private: static char ID; }; -template <typename MyErrT, typename ParentErrT> -char ErrorInfo<MyErrT, ParentErrT>::ID = 0; - /// Special ErrorInfo subclass representing a list of ErrorInfos. /// Instances of this class are constructed by joinError. class ErrorList final : public ErrorInfo<ErrorList> { diff --git a/llvm/lib/Support/Error.cpp b/llvm/lib/Support/Error.cpp index ebf4d65f20a..5bda6aae690 100644 --- a/llvm/lib/Support/Error.cpp +++ b/llvm/lib/Support/Error.cpp @@ -37,6 +37,9 @@ namespace { void ErrorInfoBase::anchor() {} char ErrorInfoBase::ID = 0; +template <> char ErrorInfo<ErrorList>::ID = 0; +template <> char ErrorInfo<ECError>::ID = 0; + static ManagedStatic<ErrorErrorCategory> ErrorErrorCat; std::error_code ErrorList::convertToErrorCode() const { diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp index 9c307f7113f..43ceec15d3a 100644 --- a/llvm/unittests/Support/ErrorTest.cpp +++ b/llvm/unittests/Support/ErrorTest.cpp @@ -45,6 +45,8 @@ protected: int Info; }; +template <> char ErrorInfo<CustomError>::ID = 0; + // Custom error class with a custom base class and some additional random // 'info'. class CustomSubError : public ErrorInfo<CustomSubError, CustomError> { @@ -70,6 +72,8 @@ protected: int ExtraInfo; }; +template <> char ErrorInfo<CustomSubError, CustomError>::ID = 0; + static Error handleCustomError(const CustomError &CE) { return Error(); } static void handleCustomErrorVoid(const CustomError &CE) {} |