[LLVMbugs] [Bug 8326] New: const union member in template class gives invalid error

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 7 06:34:37 PDT 2010


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

           Summary: const union member in template class gives invalid
                    error
           Product: clang
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ext-llvm.org at sidvind.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5583)
 --> (http://llvm.org/bugs/attachment.cgi?id=5583)
test case

const_union_member.cpp:5:3: error: constructor for 'Foo<int>' must explicitly
initialize the const member ''
  Foo()
  ^
const_union_member.cpp:21:12: note: in instantiation of member function
'Foo<int>::Foo' requested here
  Foo<int> baz;
           ^
const_union_member.cpp:11:9: note: '' declared here
  const union {

Both gcc and msvc accepts the code, and no error is generated if const or
template is dropped.

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