[LLVMbugs] [Bug 6896] New: Unhelpful diagnostic on attempt to partially specialize member function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 22 15:29:21 PDT 2010


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

           Summary: Unhelpful diagnostic on attempt to partially
                    specialize member function
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: quality-of-implementation
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jyasskin at google.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Yes, this is invalid, but the compiler should notice and point out the user's
mistake.


jyasskin-macbookpro15:~/tmp$ cat test.cc
class F {
 public:
  template <typename T>
  F(const T& value);
};

// Intending to partially-specialize F::F...
template <unsigned N>
inline F::F(const char (&value)[N]) {
}
jyasskin-macbookpro15:~/tmp$ ~/src/llvm/clang/obj/Debug/bin/clang++  -c test.cc
test.cc:9:11: error: out-of-line definition of 'F' does not match any
declaration in 'F'
inline F::F(const char (&value)[N]) {
       ~~~^
1 error generated.

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