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

             Bug #: 12524
           Summary: Structure not a POD within a template class
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


The following simple program creates a variable length array of structures:

//template<typename T>
class Test {
public:
 struct toto {
   int* x;
 };

 void method(int nb) {
   toto ary[nb];
   for(int i = 0; i < nb; ++i)
     ary[i].x = 0;
 }
};


int main(int argc, char* argv[]) {
 //Test<char> t;
 Test t;
 t.method(5);

 return 0;
}

In compiles properly as written with clang++ version 3.0. When
uncommeting the templated version, then the compiler complains:

POD.cc:9:13: error: variable length array of non-POD element type
'Test<char>::toto'
   toto ary[nb];

The structure toto is still a POD in the templated class and this code should
compile without error.

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