[llvm] r264293 - Define ErrorInfo::ID explicitly.

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 08:26:44 PDT 2016


Author: chapuni
Date: Thu Mar 24 10:26:43 2016
New Revision: 264293

URL: http://llvm.org/viewvc/llvm-project?rev=264293&view=rev
Log:
Define ErrorInfo::ID explicitly.

Modified:
    llvm/trunk/include/llvm/Support/Error.h
    llvm/trunk/lib/Support/Error.cpp
    llvm/trunk/unittests/Support/ErrorTest.cpp

Modified: llvm/trunk/include/llvm/Support/Error.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Error.h?rev=264293&r1=264292&r2=264293&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Error.h (original)
+++ llvm/trunk/include/llvm/Support/Error.h Thu Mar 24 10:26:43 2016
@@ -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> {

Modified: llvm/trunk/lib/Support/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Error.cpp?rev=264293&r1=264292&r2=264293&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Error.cpp (original)
+++ llvm/trunk/lib/Support/Error.cpp Thu Mar 24 10:26:43 2016
@@ -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 {

Modified: llvm/trunk/unittests/Support/ErrorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ErrorTest.cpp?rev=264293&r1=264292&r2=264293&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/ErrorTest.cpp (original)
+++ llvm/trunk/unittests/Support/ErrorTest.cpp Thu Mar 24 10:26:43 2016
@@ -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) {}




More information about the llvm-commits mailing list