[LLVMbugs] [Bug 20176] New: Build error with gcc trunk: error:=?UTF-8?Q?=20=E2=80=98clang?=::vfs::OverlayFileSystem* llvm::IntrusiveRefCntPtr<clang::vfs::OverlayFileSystem>:: Obj’ is private

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 1 08:07:13 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20176

            Bug ID: 20176
           Summary: Build error with gcc trunk:  error:
                    ‘clang::vfs::OverlayFileSystem*
                    llvm::IntrusiveRefCntPtr<clang::vfs::OverlayFileSystem
                    >::Obj’ is private
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: octoploid at yandex.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

FAILED: /var/tmp/gcc_test/usr/local/bin/g++   -DCLANG_ENABLE_ARCMT
-DCLANG_ENABLE_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -DclangFrontend_EXPORTS -fPIC -fvisibility-inlines-hidden
-Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers
-pedantic -Wno-long-long -Wno-maybe-uninitialized -Wnon-virtual-dtor
-Wno-comment -std=c++11 -ffunction-sections -fdata-sections -fno-common
-Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -O2  -DNDEBUG -pipe -fPIC
-Itools/clang/lib/Frontend
-I/var/tmp/llvm-project/llvm/tools/clang/lib/Frontend
-I/var/tmp/llvm-project/llvm/tools/clang/include -Itools/clang/include
-Iinclude -I/var/tmp/llvm-project/llvm/include    -fno-exceptions -fno-rtti
-MMD -MT
tools/clang/lib/Frontend/CMakeFiles/clangFrontend.dir/CompilerInvocation.cpp.o
-MF
"tools/clang/lib/Frontend/CMakeFiles/clangFrontend.dir/CompilerInvocation.cpp.o.d"
-o
tools/clang/lib/Frontend/CMakeFiles/clangFrontend.dir/CompilerInvocation.cpp.o
-c /var/tmp/llvm-project/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
In file included from
/var/tmp/llvm-project/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.h:14:0,
                 from
/var/tmp/llvm-project/llvm/tools/clang/include/clang/Frontend/CompilerInvocation.h:13,
                 from
/var/tmp/llvm-project/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp:10:
/var/tmp/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h: In
instantiation of
‘llvm::IntrusiveRefCntPtr<T>::IntrusiveRefCntPtr(llvm::IntrusiveRefCntPtr<X>&&)
[with X = clang::vfs::OverlayFileSystem; T = clang::vfs::FileSystem]’:
/var/tmp/llvm-project/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp:2047:10:
  required from here
/var/tmp/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:137:8: error:
‘clang::vfs::OverlayFileSystem*
llvm::IntrusiveRefCntPtr<clang::vfs::OverlayFileSystem>::Obj’ is private
     T* Obj;
        ^
/var/tmp/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:158:13: error:
within this context
       S.Obj = 0;
             ^

The following patch fixes the issue:

diff --git a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
index 128ada0ec835..74b403c3810b 100644
--- a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
+++ b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
@@ -154,6 +154,9 @@ public:
     }

     template <class X>
+    friend class IntrusiveRefCntPtr;
+
+    template <class X>
     IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.getPtr()) {
       S.Obj = 0;
     }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140701/f8fbbba2/attachment.html>


More information about the llvm-bugs mailing list