[LLVMbugs] [Bug 7460] New: Bug in enum-to-value resolution?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 23 07:22:42 PDT 2010


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

           Summary: Bug in enum-to-value resolution?
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: manuel.holtgrewe at fu-berlin.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Hi, I am currently trying to compile some code with heavy use of template
metaprogramming and I think I hit a bug in clang. Or is the following no valid
C++?


// Working.

struct Class
{
  enum { SIZE = 100 };
  static int member[SIZE];
};

int Class::member[Class::SIZE];

// Also working.

template <typename T>
struct TemplateClass
{
  static const int SIZE = 100;
  static T member[SIZE];
};

template <typename T>
T TemplateClass<T>::member[TemplateClass<T>::SIZE];

// Not working.

template <typename T>
struct TemplateClass2
{
  enum { SIZE = 100 };
  static T member[SIZE];
};

template <typename T>
T TemplateClass2<T>::member[TemplateClass2<T>::SIZE];

int main() {return 0;}

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