[llvm] r220233 - Try to fix GCC error about invalid use of const_cast in const version of ErrorOr::get()

Alexey Samsonov vonosmas at gmail.com
Mon Oct 20 13:41:21 PDT 2014


Author: samsonov
Date: Mon Oct 20 15:41:21 2014
New Revision: 220233

URL: http://llvm.org/viewvc/llvm-project?rev=220233&view=rev
Log:
Try to fix GCC error about invalid use of const_cast in const version of ErrorOr::get()

Modified:
    llvm/trunk/include/llvm/Support/ErrorOr.h

Modified: llvm/trunk/include/llvm/Support/ErrorOr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ErrorOr.h?rev=220233&r1=220232&r2=220233&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/ErrorOr.h (original)
+++ llvm/trunk/include/llvm/Support/ErrorOr.h Mon Oct 20 15:41:21 2014
@@ -173,7 +173,7 @@ public:
   }
 
   reference get() { return *getStorage(); }
-  const_reference get() const { return const_cast<ErrorOr<T> >(this)->get(); }
+  const_reference get() const { return const_cast<ErrorOr<T> *>(this)->get(); }
 
   std::error_code getError() const {
     return HasError ? *getErrorStorage() : std::error_code();





More information about the llvm-commits mailing list