[LLVMbugs] [Bug 8771] New: Redeclaring partial specializations is disallowed sometimes
    bugzilla-daemon at llvm.org 
    bugzilla-daemon at llvm.org
       
    Fri Dec 10 05:10:16 PST 2010
    
    
  
http://llvm.org/bugs/show_bug.cgi?id=8771
           Summary: Redeclaring partial specializations is disallowed
                    sometimes
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: schaub.johannes at googlemail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Clang does in general accept redeclaring partial specializations, like
requested by 9.2[class.mem]p1, but does not do so in the following example,
which I derived from wg21 core issue #996
  template<typename T, typename U>
  struct Outer {
    template<typename X, typename Y> struct Inner;
    template<typename Y> struct Inner<T, Y>;
    template<typename Y> struct Inner<U, Y> {};
  };
  Outer<int, int> outer;  
This is a "declared and then later defined" scenario of a member class
template, but Clang shouts:
main1.cpp:5:33: error: class template partial specialization 'Inner<int, Y>'
cannot be redeclared
    template<typename Y> struct Inner<U, Y> {};
                                ^
main1.cpp:8:19: note: in instantiation of template class 'Outer<int, int>'
requested here                                                             
  Outer<int, int> outer;  
                  ^
main1.cpp:4:33: note: previous declaration of class template partial
specialization 'Inner<int, type-parameter-0-0>' is here                         
    template<typename Y> struct Inner<T, Y>;
-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
    
    
More information about the llvm-bugs
mailing list