[LLVMbugs] [Bug 12227] New: Clang does not use partial specialization

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 10 07:10:55 PST 2012


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

             Bug #: 12227
           Summary: Clang does not use partial specialization
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: schaub.johannes at googlemail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I thought this should select the partial specialization (because "K" can be
deduced to "{E}"). But clang always selects the primary template of "B":

template<typename T> struct valid { typedef int type; }; 
template<typename U, typename ...T> struct A { 
  template<typename K> struct B; 
  template<typename ...K, typename valid<K..., T>::type...> 
  struct B<K...> { }; 
}; 

enum E { }; 
A<int>::B<E> a;

Clang says: "implicit instantiation of undefined template 'A<int, >::B<E>'". 

This code does not contain a template whose only valid specializations have
empty template parameter packs. Hence the template definition itself is
well-formed. 

I thought that when "K" is deduced to "{ E }", then we are supposed to
substitute it into the latter pack expansion, which results in an empty list of
more template parameters.  Hence we have deduced all template parameters and
use the partial specialization.

Is there something wrong with my analysis?

-- 
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