[LLVMbugs] [Bug 22350] New: Accepts-invalid (?): clang allows accessing private typedef of specialization in the specialization's template

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 27 07:57:27 PST 2015


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

            Bug ID: 22350
           Summary: Accepts-invalid (?): clang allows accessing private
                    typedef of specialization in the specialization's
                    template
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

clang accepts the following code, which gcc, cl, icc all reject. icc says
"warning #525: type "A<void>::const_pointer" (declared at line 3) is an
inaccessible type (allowed for cfront compatibility)", so this is probably a
clang bug (?)


$ cat repro.ii 
template <class T1> class A;
template <> class A<void> {
  typedef void *const_pointer;
};
template <class T1> class A {
  void m_fn1(A<void>::const_pointer);
};
class F {
  A<int> const_pointer;
};
$ bin/clang -c repro.ii
$ gcc-4.8.1 -c repro.ii 
gcc-4.8.1: warning: couldn’t understand kern.osversion ‘14.0.0
repro.ii: In instantiation of ‘class A<int>’:
repro.ii:9:10:   required from here
repro.ii:3:17: error: ‘typedef void* A<void>::const_pointer’ is private
   typedef void *const_pointer;
                 ^
repro.ii:6:23: error: within this context
   void m_fn1(A<void>::const_pointer);
                       ^

-- 
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/20150127/3bf080d3/attachment.html>


More information about the llvm-bugs mailing list