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

           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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to