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

            Bug ID: 22327
           Summary: Accepts-invalid (?): clang allows accessing private
                    typedef of specialization in the specialization's
                    template
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to