[LLVMbugs] [Bug 7979] New: Clang requires a definition of a member function before it can be explicitly instantiated

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 24 00:54:59 PDT 2010


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

           Summary: Clang requires a definition of a member function
                    before it can be explicitly instantiated
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chandlerc at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


% cat t.cc 
template <typename T> struct S {
  void f();
};

template void S<int>::f();

template <typename T> void S<T>::f() {}

% ./bin/clang -fsyntax-only t.cc
t.cc:5:23: error: explicit instantiation of undefined member function 'f' of
class template 'S<int>'
template void S<int>::f();
                      ^
t.cc:2:8: note: explicit instantiation refers here
  void f();
       ^
1 error generated.


[temp.explicit] 14.7.2/3 says only that "A definition of a class template shall
be in scope at the point of an explicit instantiation of a member function or a
static data member of the class template." No mention is made of the definition
of the member function.

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