[LLVMbugs] [Bug 6962] New: A Concrete class inside a template class is identified as abstract

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 28 02:06:03 PDT 2010


           Summary: A Concrete class inside a template class is identified
                    as abstract
           Product: clang
           Version: 2.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: etienne.pierre at c-s.fr
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Created an attachment (id=4755)
 --> (http://llvm.org/bugs/attachment.cgi?id=4755)
Source to reproduce the bug

Attached is a simple code example (complied with clang++ -c bug.cpp) that
reproduces the problem.

Inside a template class (template <class T> class TemplateClass) are 2 inner
classes, the first one is abstract (Interface), the second inherits from it and
is concrete (Concrete). If I try to add a member to TemplateClass of type
Concrete, the compiler gives me the following message :

bug.cpp:21:14: error: field type 'Concrete' is an abstract class
    Concrete m_c;

bug.cpp:10:22: note: pure virtual function 'Write'
        virtual void Write(const char * a_pBuf) = 0;

The funny thing is that, if you remove line 21 (Concrete m_c;), the compiler
doesn't complain on line 26 (which uses TemplateClass<char>::Concrete but
outside TemplateClass).

Thanks for the great work on clang.

√Čtienne PIERRE

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